$(document).ready(function(){
//var mainHolderH=$("#mainHolder").css('height');
//var rightH=$("#rightElement").css('height');
//alert(mainHolderH+":"+rightH);
});
function validateEmail(email){
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email)) 
		return false;
	return true;
}

function showFullScreen(url){
tb_show("",url+'', 'page');
}

function validateWarranty(){
	var myForm = document.forms.theForm; 
	var valid=true;
	
	var firstName = myForm.firstname.value;
	var lastName = myForm.lastname.value;
	var address = myForm.address.value;
	var city = myForm.city.value;
	var country = myForm.Country.value;
	var email = myForm.email.value;
	var productModel= myForm.productModel.value;
	var serialNumber= myForm.ProductSerialNumber.value;
	
	if (!validateEmail(email)){
		alert('Incorrect email format');
		myForm.email.focus;
		return false;
		}
		
	if (firstName=="")
		valid=false;
	if (lastName=="")
		valid=false;
	if (address=="")
		valid=false;
	if (city=="")
		valid=false;
//	if (serialNumber=="")
//		valid=false;
	if (country==0)
		valid=false;
	if (productModel==0)
		valid=false;	
	
//	alert(firstName+'-'+lastName+'-'+address+'-'+city+'-'+country+'-'+email+'-'+productModel+'-'+serialNumber+'--=-->'+valid)
	if (valid==true)
		document.forms.theForm.submit();
	else
		alert('Required fields missing');
}

function validateNewsLetter(){
	var myForm = document.forms.theForm; 
	var valid=true;
	
	var firstName = myForm.firstname.value;
	var lastName = myForm.lastname.value;
	var address = myForm.address.value;
	var city = myForm.city.value;
	var country = myForm.Country.value;
	var email = myForm.email.value;
	var interests = myForm.interests;
	
	if (!validateEmail(email)){
		alert('Incorrect email format');
		myForm.email.focus;
		return false;
		}
	
	if (firstName=="")
		valid=false;
	if (lastName=="")
		valid=false;
	if (address=="")
		valid=false;
	if (city=="")
		valid=false;
	if (country==0)
		valid=false;
		
	var str='';
	for (i = 0; i < interests.length; i++)
		if (interests[i].checked)
		str+=interests[i].value+", ";
	
	myForm.myinterests.value=str;	

//	alert(firstName+'-'+lastName+'-'+address+'-'+city+'-'+country+'-'+email+'-'+productModel+'-'+serialNumber+'--=-->'+valid)
	if (valid==true){
		document.forms.theForm.submit();
		}
	else
		alert('Required fields missing');
}

function validateDistributor(){
	var myForm = document.forms.theForm; 
	var valid=true;
	
	var firstName = myForm.firstname.value;
	var lastName = myForm.lastname.value;
	var address = myForm.address.value;
	var city = myForm.city.value;
	var country = myForm.Country.value;
	var email = myForm.email.value;
	var howDidYou= myForm.howDidYou.value;
	var phoneMobile= myForm.phoneMobile.value;
	
	if (!validateEmail(email)){
		alert('Incorrect email format');
		myForm.email.focus;
		return false;
		}
	
	if (firstName=="")
		valid=false;
	if (lastName=="")
		valid=false;
	if (address=="")
		valid=false;
	if (city=="")
		valid=false;
	if (phoneMobile=="")
		valid=false;
/*	if (howDidYou==0)
		valid=false;*/
	if (country==0)
		valid=false;

	
//	alert(firstName+'-'+lastName+'-'+address+'-'+city+'-'+country+'-'+email+'-'+productModel+'-'+serialNumber+'--=-->'+valid)
	if (valid==true)
		document.forms.theForm.submit();
	else
		alert('Required fields missing');
}


//-----------------------------------------------------------------------
function thisMovie(movieName)
{
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	var nAgt = navigator.userAgent;
	var majorVersion = 0;
	var fullVersion  = 0; 
	
	if ((verOffset=nAgt.indexOf("MSIE"))!=-1) 
	{
		fullVersion  = parseFloat(nAgt.substring(verOffset+5));
		majorVersion = parseInt(''+fullVersion);
	}
	if (isIE){
	if (majorVersion>=6) return document[movieName];
	return window[movieName];
	}
	return document[movieName];
}
//-----------------------------------------------------------------------
