// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write('<scr'+'ipt language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('Sub daFlashMovie_FSCommand(ByVal command, ByVal args)\n');
document.write('	Call daFlashMovie_DoFSCommand(command, args)\n');
document.write('End Sub\n');
document.write('Sub daFlashMovie2_FSCommand(ByVal command, ByVal args)\n');
document.write('	Call daFlashMovie2_DoFSCommand(command, args)\n');
document.write('End Sub\n');
document.write('</script\>\n');
}
	
function Swap(ImageId,ImageName) {
	if(document.images) {
	document.images[ImageId].src=eval(ImageName + ".src");
	}
	else {
	return null;
	}
}

var active2="";

function toggle2(mousepos,layerID) {

	var divleft=mousepos.clientX - 520;
	//var divtop=mousepos.clientY - 250;
	var divtop=300;
	
	if(active2 != "") {
	//killtimer2();
	hidelayer2();
	showlayer2(divleft,divtop,layerID);
	}
	else {
	showlayer2(divleft,divtop,layerID);
	}
}

function toggle3(mousepos,layerID) {

	var divleft=mousepos.clientX - 340;
	//var divtop=mousepos.clientY - 250;
	var divtop=300;
	
	if(active2 != "") {
	//killtimer2();
	hidelayer2();
	showlayer2(divleft,divtop,layerID);
	}
	else {
	showlayer2(divleft,divtop,layerID);
	}
}


function showlayer2(posleft,postop,which) {
	if(document.layers)
	{	
	damenu = document.layers[which];
	}
	if(document.all)
	{
	damenu = document.all(which).style;
	}
	if(!document.all && document.getElementById)
	{
        damenu = document.getElementById(which).style;
        }

	damenu.left=posleft + "px";
	damenu.top=postop + "px";
	damenu.visibility = "visible";
	active2 = which;
}

function hidelayer2() {	
	if(document.layers)
	{
	damenu = document.layers[active2];
	}
	if(document.all)
	{
	damenu = document.all(active2).style;
	}
	damenu.visibility = "hidden";	
}

function timer2() {
kill3 = setTimeout("hidelayer2();",800);
}

function killtimer2() {
clearTimeout(kill3);
}

function ClearOptin() {
	if(document.FormOptin.c_email.value=="email" && document.FormOptin.c_name.value=="name") {
	document.FormOptin.c_email.value="";
	document.FormOptin.c_name.value="";
	}
}

function DoClearOptin() {
	if($F("c_name")=="name" && $F("c_email")=="email") {
	$("c_name").value="";
	$("c_email").value="";
	}
}

// Optin Ajax stuff

function testEmail(e) {
	if(e) {
	p = e.indexOf('@');
	s = e.indexOf(';');
	d = e.lastIndexOf('.');
		if (p<1 || p==(e.length-1) || d<p || d==(e.length-1) || s>-1) {
		return false;
		}
	return true;
	}
return false;
}
	
function DoAjaxOptin() {
	if(testEmail($F('c_email'))) {
		var myAjax = new Ajax.Updater(
			{success: 'OptinContainer'}, 
			"_optin.php", 
			{
			method: 'post', 
			parameters: "OptinEmail="+$F('c_email')+"&OptinName="+$F('c_name'), 
			onFailure: reportError
		});
	}
	else {
	alert("Please provide us with a valid email address");
	return false;
	}
}

function reportError() {
	$("OptinContainer").innerHTML="There was a problem with your subscription.";
}
