// init superfish menu
$(document).ready(function(){
	$("ul.sf-menu").superfish();
	
	$("#icon a img").hover(
		function(){$(this).attr("src",$(this).attr("src").replace(".gif","_on.gif"));},
		function(){$(this).attr("src",$(this).attr("src").replace("_on.gif",".gif"));}
	);

	//menu hover event
	$(".smenu img").not($(".sf-menu *")).hover(
		function(){$(this).attr("src",$(this).attr("src").replace(".gif","_over.gif"));},
		function(){$(this).attr("src",$(this).attr("src").replace("_over.gif",".gif"));}
	);

	// super fish menu hover event
	$(".sf-menu *").hover(
		function(){$(".sf-menu img").attr("src","/images/main/menu_watches_over.gif");},
		function(){$(".sf-menu img").attr("src","/images/main/menu_watches.gif");}
	);
	
	// default page pictures hover event
	$(".ulimg li a img").hover(
		function(){$(this).attr("src",$(this).attr("src").replace(".jpg","_over.jpg"));},
		function(){$(this).attr("src",$(this).attr("src").replace("_over.jpg",".jpg"));}
	);
	
	// left menu
	$("#lmenu ul:first").css({"border":"solid #cc3333","border-width":"5px 0px"});
	$(".entry ul").remove();
	
});


// keep left and right cols have the same height
$(document).ready(function(){
	var l=$("#lcol").height();
	var r=$("#rcol").height();
	if (r>l)
	{$("#lcol").height(r);}
	else
	{$("#rcol").height(l);}
});



// open pricing policy
function policy_open(){
	window.open('/?pageid=103','Policy','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=820,height=500'); 
}

function DoPrint() { 
if (window.print) 
{
	var dv=document.all.orderdv.innerHTML;
	var css='<style type="text/css" media=all>'+
	'	body{background-color:#fff; color:#5b5b5b; font-size:12px; font-family:Verdana; line-height:150%;}'+
	'	#print{display:none;}'+
	'</style>';

	var body ='<table width="700" border="0" cellspacing="0" cellpadding="5">' + 
	' <tr> ' + 
	' <td class="fbody"> ' + 
	' <div align="center" class=ftitle>' + dv + 
	'</div>' + 
	' </td>' + 
	' </tr>' + 
	'</table>';
	
	document.body.innerHTML = '<center>' + css + body + '</center>';
	    
	window.print();
	//window.history.go(0);
}
}

function Contact_From_Validator(theForm)
{

  if (theForm.Subject.value == "")
  {
    alert("Please enter a value for the \"Subject\" field.");
    theForm.Subject.focus();
    return (false);
  }

  if (theForm.Subject.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Subject\" field.");
    theForm.Subject.focus();
    return (false);
  }

  if (theForm.Subject.value.length > 256)
  {
    alert("Please enter at most 256 characters in the \"Subject\" field.");
    theForm.Subject.focus();
    return (false);
  }

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length > 256)
  {
    alert("Please enter at most 256 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 256)
  {
    alert("Please enter at most 256 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
  return (true);
}


function killErrors(){
	return true;
}
window.onerror = killErrors;
