
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();" />';
}
	


//ov (over) - mouseover call for rollover
function ov(id) {
	document.images[fname[id-1]].src = on[id-1].src
}

//ou (out) - mouseout call for rollover
function ou(id) {
	document.images[fname[id-1]].src = off[id-1].src
}

// front rollovers
function front_ov_init(rot) {
	front_off = new Array();
	front_on = new Array();
	front_fname = new Array('front_panel_'+rot+'_4_2','front_panel_'+rot+'_4_4','front_panel_'+rot+'_4_6', 'front_panel_'+rot+'_4_8');
	
	for (i=0; i<front_fname.length; i++) {
		front_off[i] = new Image;
		front_off[i].src = 'layout/' + front_fname[i] + ".jpg";
		front_on[i] = new Image;
		front_on[i].src = 'layout/' + front_fname[i] + "_on.jpg";
	}
}

function front_ov(id) {
	document.images[front_fname[id-1]].src = front_on[id-1].src
}
function front_ou(id) {
	document.images[front_fname[id-1]].src = front_off[id-1].src
}

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 toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display=(style2.display=="block")?"none":"block";
	}
	else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

function toggleLayerSB(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display=(style2.display=="block")?"none":"block";
		var style3 = document.getElementById(whichLayer + "_close").style;
		style3.display=(style3.display=="inline")?"none":"inline";
	}
}

function togRNload() {
	if (document.getElementById('release_notes')) {document.getElementById('release_notes').style.display='block';}
}

function togRN() {
		var style2 = document.getElementById('release_notes').style;
		style2.display="none";
	}
	
function tog_main(fileName) {
	document.getElementById('main_image').src = '/images/products/'+fileName+'-md.jpg';
	document.getElementById('big_image').src = '/images/products/'+fileName+'-lg.jpg';
}

function tog_big() {
	var theStyle = document.getElementById('big_image_div').style;
	theStyle.display=(theStyle.display=="block")?"none":"block";
}