function avjax_subscribe_newsletter() {
		//document.getElementById('front_email_message_text').innerHTML = 'this feature not yet implemented';
		
		var pars = Form.serialize('newsletter_form');
		myRequest = new Ajax.Request(
						'/index.php?action=subscribe_newletter',
						{
							method: 'post',
							parameters: pars,
							onFailure: function() { alert('Something went wrong...') }
							//,onSuccess: function(transport) { alert(transport.responseText) }
						}
		);
		
	}	

	function reset_newsletter_form() {
		document.getElementById('front_email_intro').innerHTML = 'Just give us your e-mail and we\'ll let you know about new arrivals and promotions.';
		document.getElementById('front_email_field_div').innerHTML = '<input type="text" name="newsletter_email" class="front_email_field" id="front_email_field" />';
		document.getElementById('front_email_button').innerHTML = '<input type="image" src="layout/front_email_button.jpg"  onclick="avjax_subscribe_newsletter();" />';
	}


/*document.onkeypress = function(e) {
	e = e || window.event;
	if (typeof e != 'undefined') {
		var tgt = e.target || e.srcElement;
		if (typeof tgt != 'undefined' && /input/i.test(tgt.nodeName)) return (typeof e.keyCode != 'undefined') ? e.keyCode != 13 : true;
	}
}*/

function isArray(obj) {
	if (obj.constructor.toString().indexOf("Array") == -1)
		return false;
	else
		return true;
}

function lt_pn(whichLayer, fromLayer) {
	if (document.getElementById) {
		var style2 = document.getElementById(fromLayer).style;
		var style3 = document.getElementById(whichLayer).style;
		style3.display=(style3.display=="block")?"none":"block";
		style2.display=(style2.display=="block")?"none":"block";
	}
}
function toggleFD(whichText) {
	if (document.getElementById) {
		document.getElementById('framed_details_text').innerHTML = whichText;
	}
}
function toggle_big_image() {
	if (document.getElementById) {
		var style2 = document.getElementById('big_product_image_div').style;
		style2.display=(style2.display=="block")?"none":"block";
	}
}
function swapImg(whichSrc, imgClass, largeImg) {
	if (document.getElementById) {
		if (imgClass != "clear") {
			document.getElementById('product_image').src = "/images/artwork_framed/medium/"+whichSrc+"-MD.jpg";
			document.getElementById('big_product_image').src = "/images/artwork_framed/large/"+whichSrc+"-LG.jpg";
		} else {
			document.getElementById('product_image').src = whichSrc;
			document.getElementById('big_product_image').src = largeImg;
		}
	}
}
function checkRadio(whichSrc) {
	if (document.getElementById) {
		document.getElementById('radio_'+whichSrc).checked = 'checked';
	}
}

function show_payment_info(theID, numIDs) {
	
	for (var i = 0; i <= numIDs; i++) {		
		document.getElementById('payment_' + i).style.display = 'none';
	}
	
	document.getElementById(theID).style.display = 'block';
	
}

function view_shipping_off() {
	var style2 = document.getElementById('shipping_address').style;
	style2.display="none";
}

function view_shipping_on() {
	var style2 = document.getElementById('shipping_address').style;
	style2.display="block";
}

function MM_jumpMenu(selObj) {
	var aURL = selObj.options[selObj.selectedIndex].value;
	if (aURL) window.location = aURL;
}

function clearPanels(id) {
	if (id == 'myaccount_fixed') {
		document.getElementById('myaccount_fixed').style.display = "block";
		document.getElementById('myaccount_fixed_result').innerHTML = '';
	} else {
		document.getElementById('myaccount_fixed').style.display = "none";
	}
	if (id == 'myaccount_edit') {
		document.getElementById('myaccount_edit').style.display = "block";
		document.getElementById('myaccount_edit_submit').disabled = false;
		document.getElementById('myaccount_edit_result').innerHTML = '';
	} else {
		document.getElementById('myaccount_edit').style.display = "none";
	}
	if (id == 'myaccount_email') {
		document.getElementById('myaccount_email').style.display = "block";
		document.getElementById('myaccount_email_submit').disabled = false;
		document.getElementById('myaccount_email_result').innerHTML = '';
	} else {
		document.getElementById('myaccount_email').style.display = "none";
	}
	if (id == 'myaccount_password') {
		document.getElementById('myaccount_password').style.display = "block";
		document.getElementById('myaccount_password_submit').disabled = false;
		document.getElementById('myaccount_password_result').innerHTML = '';
	} else {
		document.getElementById('myaccount_password').style.display = "none";
	}
}

function togglePassword() {
	var style2 = document.getElementById('whypassword').style;
	style2.display=(style2.display=="block")?"none":"block";
}

function toggleHoverText() {
	var style2 = document.getElementById('hover_text').style;
	document.getElementById('close_more_about').innerHTML = (style2.display=="block")?"":"Close ";
	style2.display=(style2.display=="block")?"none":"block";	
}

function toggleCVVHelp() {
	var style2 = document.getElementById('cvvhelp').style;
	document.getElementById('cvvhelpbutton').value = (style2.display=="block")?"Locate Code":"Close Help";
	style2.display=(style2.display=="block")?"none":"block";
}

function editAtConfirmation() {
	window.location = 'checkout_payment.php';
}

function tog_mores(divID) {
	var style2 = document.getElementById(divID).style;
	style2.display=(style2.display=="block")?"none":"block";
	var style3 = document.getElementById(divID+'_text');
	style3.innerHTML=(style3.innerHTML=="More")?"Less":"More";
}

function sMale(email) {
	switch (email) {
		case "careers":
			to = "&#99;&#97;&#114;&#101;&#101;&#114;&#115;";
			break;
		case "domains":
			to = "&#100;&#111;&#109;&#97;&#105;&#110;&#115;";
			break;
		case "info":
			to = "&#105;&#110;&#102;&#111;";
			break;
		case "links":
			to = "&#108;&#105;&#110;&#107;&#115;";
			links = 1;
			break;
		case "patrick":
			to = "&#112;&#97;&#116;&#114;&#105;&#99;&#107;";
			break;
		case "pr":
			to = "&#112;&#114;";
			break;
		case "design":
			to = "&#100;&#101;&#115;&#105;&#103;&#110;";
			break;
		case "support":
			to = "&#115;&#117;&#112;&#112;&#111;&#114;&#116;";
			break;
		case "sales":
			to = "&#115;&#97;&#108;&#101;&#115;";
			break;
		case "feedback":
			to = "&#102;&#101;&#101;&#100;&#98;&#97;&#99;&#107;";
			break;
		case "security":
			to = "&#115;&#101;&#99;&#117;&#114;&#105;&#116;&#121;";
			break;
		}
	domain = "&#97;&#114;&#116;&#112;&#97;&#115;&#115;&#105;&#111;&#110;&#115;&#46;&#99;&#111;&#109;";
	at = "&#64;";
	mailto = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;";

	document.write("<a href=\"" + mailto + to + at + domain + "\">" + to + at + domain + "</a>");

}

//window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

function clear_field(field, defaultval) {
	if (field.value == defaultval) {
		field.value = '';
	}
}

function tog_reviews() {
	var style2 = document.getElementById('review_hidden').style;
	style2.display=(style2.display=="block")?"none":"block";
	var style3 = document.getElementById('see_more_reviews');
	style3.innerHTML=(style3.innerHTML=="See More Reviews")?"See Less Reviews":"See More Reviews";
}

function tog_review_form() {
	var style2 = document.getElementById('review_display').style;
	style2.display=(style2.display=="block")?"none":"block";	
}

function tog_promo_help() {
	var promo_style = document.getElementById('promo_help').style;
	promo_style.display=(promo_style.display=="block")?"none":"block";
}

function tog_apo_help() {
	var promo_style = document.getElementById('apo_help').style;
	promo_style.display=(promo_style.display=="block")?"none":"block";
}

function addtocart(products_id, products_sku) {
	var theURL = '/product_info.php' + '?action=add_product&products_id=' + products_id + '&products_sku=' + products_sku;
	window.location = theURL;
}

