function SwitchStyle(obj){
	if(document.getElementById){
		var bl = document.getElementById("nav"+obj);
		prev_bgcolor = bl.style.backgroundColor
		prev_color = bl.style.color
		//bl.style.backgroundColor = "#F99219"
		//bl.style.color = "#FFFFFF"
		var link1 = document.getElementById("link"+obj);
		prev_link = link1.style.color
		link1.style.color = "#00629F"
	}
}
function SwitchStyleBack(obj){
	if(document.getElementById){
		var bl = document.getElementById("nav"+obj);
		//bl.style.backgroundColor = prev_bgcolor
		//bl.style.color = prev_color
		var link1 = document.getElementById("link"+obj);
		link1.style.color = prev_link
	}
}
var newP = null
function openPrinter(printpage){
	winwidth=720
	winheight=580
	posleft=(screen.width-winwidth)/2
	postop=(screen.height-winheight)/2-60
	if(postop<0){postop=0}
	newP = window.open(printpage,"PrintWin","left="+posleft+",top="+postop+",width="+winwidth+",height="+winheight+",directories=no,scrollbars=yes,status=no,toolbar=yes,menubar=no,location=left,resizable=no");
	if (newP.opener == null){
		newP.opener = window;
	}else{
		newP.focus();
	}
	newP.opener.name = "opener";
}
function Isempty(strvalue)
{
	if(strvalue== "")
	{
		return false
	}
	return true;
}
function validEmail(email){
	invalidChars = " /:,;"
	for(i=0;i<invalidChars.length;i++){
		badChar = invalidChars.charAt(i)
		if(email.indexOf(badChar,0) > -1){
			return false
		}
	}
	atPos = email.indexOf("@",1)
	if(atPos == -1){
		return false
	}
	if(email.indexOf("@",atPos+1) > -1){
		return false
	}
	periodPos = email.indexOf(".",atPos)
	if(periodPos == -1){
		return false
	}
	if(periodPos+3 > email.length){
		return false
	}
	return true
}
function validPostalcode(postalcode){
	newpost=""
	if(postalcode.length<6){
		return false
	}
	for(i=0;i<postalcode.length;i++){
		if(postalcode.charAt(i)!=" "){
			newchar=postalcode.charAt(i)
			newpost+=newchar.toUpperCase()
		}
	}
	if(newpost.length!=6){
		return false
	}
//	if(newpost.charAt(x)<"A" || newpost.charAt(x)>"Z" && newpost.charAt(x)<"a" || newpost.charAt(x)>"z"){
	if(newpost.charAt(0)<"A" || newpost.charAt(0)>"Z"){
		return false
	}
	if(newpost.charAt(2)<"A" || newpost.charAt(2)>"Z"){
		return false
	}
	if(newpost.charAt(4)<"A" || newpost.charAt(4)>"Z"){
		return false
	}
	if(newpost.charAt(1)<"0" || newpost.charAt(1)>"9"){
		return false
	}
	if(newpost.charAt(3)<"0" || newpost.charAt(3)>"9"){
		return false
	}
	if(newpost.charAt(5)<"0" || newpost.charAt(5)>"9"){
		return false
	}
	newpost = newpost.substring(0, 3) + " " + newpost.substring(3, 6)
	return newpost
}
function submitIt(form1) {
	if (!Isempty(form1.Name.value))
	{
		alert("Please enter your name!")
		form1.Name.focus()
		form1.Name.select()
		return false
	}
	if (!Isempty(form1.Company.value))
	{
		alert("Please enter the company name!")
		form1.Company.focus()
		form1.Company.select()
		return false
	}
	if (!Isempty(form1.Address.value))
	{
		alert("Please enter your address!")
		form1.Address.focus()
		form1.Address.select()
		return false
	}
	if (!Isempty(form1.City.value))
	{
		alert("Please enter the city you are living in!")
		form1.City.focus()
		form1.City.select()
		return false
	}
//	if (form1.Province.options[form1.Province.selectedIndex].value == "")
//	{
//		alert("Please enter the province you are living in!")
//		form1.Province.focus()
	//	form1.Province.select()
//		return false
//	}
	if (!Isempty(form1.Postalcode.value))
	{
		alert("Please enter the postal code of your address!")
		form1.Postalcode.focus()
		form1.Postalcode.select()
		return false
	}
	if (!Isempty(form1.Email.value))
	{
		alert("Please enter your email address!")
		form1.Email.focus()
		form1.Email.select()
		return false
	}
	if (!validEmail(form1.Email.value))
	{
		alert("Please enter a valid email address!")
		form1.Email.focus()
		form1.Email.select()
		return false
	}
	if (!Isempty(form1.VEnter.value))
	{
		alert("Please enter the Validation Code!")
		form1.VEnter.focus()
		form1.VEnter.select()
		return false
	}
	return true
}