/*
sfHover=function() {
	var sfEls=document.getElementById("navul").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
*/

function popwin(pageName, windowWidth, windowHeight){
	window.open(pageName, 'window', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+windowWidth+',height='+windowHeight+',top=150,left=150');return false;
	return false;
}

function u(id, img){	
	document.getElementById(id).src='images/'+img;
}

function tabbed(id,num){
	document.getElementById('tab'+id).style.display='block';

	for(i=1;i<=num;i++){
		if(i!=id) document.getElementById('tab'+i).style.display='none';
	}

	for(i=1;i<=num;i++){
		if(i!=id){
			document.getElementById('li'+i).className='unsel';
		}else{
			document.getElementById('li'+i).className='sel';
		}
	}
}

function showproducts(visible)
{
    var menu = document.getElementById('productsmenu');
    if(menu!=null)
    {
	    if (visible){
		    menu.style.display='block';
	    } else {
		    menu.style.display='none';	
	    }
	}
}

function acart(){
	var count=1;
	var hstring="";
	if (document.f.q1.selectedIndex > 0){
		hstring=hstring+"<input type=\"hidden\" name=\"item_name_"+count+"\" value=\""+document.f.i1.value+"\">\n<input type=\"hidden\" name=\"amount_"+count+"\" value=\""+document.f.a1.value+"\">\n<input type=\"hidden\" name=\"quantity_"+count+"\" value=\""+document.f.q1[document.f.q1.selectedIndex].value+"\">";
		count++;
	}
	if (document.f.q2.selectedIndex > 0){
		hstring=hstring+"<input type=\"hidden\" name=\"item_name_"+count+"\" value=\""+document.f.i2.value+"\">\n<input type=\"hidden\" name=\"amount_"+count+"\" value=\""+document.f.a2.value+"\">\n<input type=\"hidden\" name=\"quantity_"+count+"\" value=\""+document.f.q2[document.f.q2.selectedIndex].value+"\">";
		count++;
	}
	document.f.shopping_url.value=location.href;
	document.getElementById("h").innerHTML=hstring;


}
function g(href){
	window.location = "#"+href;
}

function check(){
	var email_filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (document.f.first_name.value == ""){
		alert("Please enter your first name.");
		document.f.first_name.focus();
		return false;
	}
	if (document.f.last_name.value == ""){
		alert("Please enter your last name.");
		document.f.last_name.focus();
		return false;
	}
	if (document.f.email.value==""){
		alert("Please enter your email address.");
		document.f.email.focus();
		return false;
	}
	if (!email_filter.test(document.f.email.value)){
		alert("The email address entered does not appear to be valid.\nPlease enter a valid email address.");
		document.f.email.focus();
		return false;
	}
	return true;
}

