<!--//--><![CDATA[//><!--

/*
old menu
*/
sfHover = function() {
	if(document.getElementById("nav"))
	{
		var sfEls = document.getElementById("nav").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);

//--><!]]>

/*
New suckerfish menu
*/
$(document).ready(function(){
	$("#nav-one li").hover(
		function(){ $("ul", this).fadeIn("fast"); }, 
		function() { } 
	);

  	if (document.all) {
		$("#nav-one li").hoverClass ("sfHover");
	}
});
	  
$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};	


<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

function showSubCategories(catid)
{
	/* hide all */
	if(catid == -1)
	{
		var ins = document.getElementsByTagName('ul')
		var i;
		for(i=0;i<ins.length;i++)
		{
			ulID = ins[i].id;
			
			if(ulID.match(/subcategory_menu_[0-9]/))
			{
				ins[i].style.display = 'none';
			}
		}
	}
	/* show one */
	else
	{
		showSubCategories(-1);
	
		if(document.getElementById('subcategory_menu_' + catid))
		{
			ul = document.getElementById('subcategory_menu_' + catid);
			ul.style.display = 'block';
		}
	}
}

function confirmOrderCancel()
{
	return confirm("Are you sure you want to cancel your order?");
}

function confirmCancelOrder()
{
	return confirm("Are you sure you want to cancel this order?\nThis can not be undone.");
}

function disableButton(btn)
{
	if(btn.disabled == true)
		btn.disabled = false;
	else
		btn.disabled = true;
	
	return true;
}

function updateItem(url)
{
	window.open(url,'Update Item','toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=1,width=500,height=300,left=200,top=200');
}


function toggleSpecificStateClient(specCountry)
{
	country = document.getElementById('country').value;
	
	if(specCountry != "")
		country = specCountry;

	if(country == "Australia")
	{
		document.getElementById('state_specific').style.display = 'none';
		document.getElementById('state').style.display = 'block';
	}
	else
	{
		document.getElementById('state_specific').style.display = 'block';
		document.getElementById('state').style.display = 'none';
	}
}

function toggleSpecificStateRegister(specCountry)
{
	country = document.registerForm.country.value;
	
	if(specCountry != "")
		country = specCountry;

	if(country == "Australia")
	{
		document.getElementById('state_specific').style.display = 'none';
		document.getElementById('state').style.display = 'block';
	}
	else
	{
		document.getElementById('state_specific').style.display = 'block';
		document.getElementById('state').style.display = 'none';
	}
}

function changeProductImage(id, image, url)
{
	document.getElementById('productimage').setAttribute('src',url+'thumbs/'+image);
	document.getElementById('productlink').setAttribute('href',url+image);
}

function replaceFieldText(field, matchValue, replaceValue)
{
	if(document.getElementById(field))
	{
		f = document.getElementById(field);

		if(f.value == matchValue)
			f.value = replaceValue;
	}
	else
	{
		return false;
	}
}

function clearFieldIf(id, txt)
{
	if(document.getElementById(id))
	{
		div = document.getElementById(id);
		
		if(div.value == txt)
			div.value = '';
	}
}

function printPage()
{
	if(document.getElementById('contentarea'))
	{
		var randID = Math.random();

		childWindow = open('', 'printWindow'+randID,'resizable=yes,scrollbars=yes,width=760,height=500');

		if(childWindow.opener == null) childWindow.opener = self;

		var basetag = document.getElementsByTagName("base")[0];
		var basehref = basetag.href;
		var contentHTML = document.getElementById('contentarea').innerHTML;

		childWindow.document.write("<html><head><base href='"+basehref+"' /></head><body>");
		childWindow.document.write(contentHTML);
		childWindow.document.write("</body></html>");

		childWindow.print();
	}
	else
	{
		alert("Unable to print this page.");
	}
}

function RegenerateSecurityCode() {
        var dt_now = new Date();
        var securityimage_url = '/includes/SecurityImage.php?w=147&h=35&dt=' + dt_now;
        document.images.securitycode.src = securityimage_url;
}
