//==================CATEGORY===============
var ajax = new Array();
function getCat(sel,child)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	var id=sel.value;
	document.getElementById(child).options.length = 0;
	if(countryCode.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		
		ajax[index].requestFile = 'func/getstate.php?state='+id;	
		ajax[index].onCompletion = function(){ createCities(index,child) };	
		ajax[index].runAJAX();
	}
}
function createCities(index,child)
{
	var obj = document.getElementById(child);
	eval(ajax[index].response);
}
////////////////////////////////////
function restore()
{
		document.getElementById('err1').style.display='none';
		document.getElementById('erre1').style.display='none';
		document.getElementById('err2').style.display='none';
		document.getElementById('err3').style.display='none';
		document.getElementById('err4').style.display='none';
		document.getElementById('err5').style.display='none';
		document.getElementById('err6').style.display='none';
}

function verify()
{
var e;
e=false;
if(!document.form1.firstname.value)
	{
		document.getElementById('err1').style.display='';
		document.form1.firstname.style.backgroundColor='#fdd';
		e=true;
	}
if(!document.form1.lastname.value)
	{
		document.getElementById('err2').style.display='';
		document.form1.lastname.style.backgroundColor='#fdd';
		e=true;
	}
if(!document.form1.email.value.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,4}$/i) )
	{
		document.getElementById('erre1').style.display='';
		document.form1.email.style.backgroundColor='#fdd';
		e=true;
	}
if(!document.form1.password.value)
	{
		document.getElementById('err3').style.display='';
		document.form1.password.style.backgroundColor='#fdd';
		e=true;
	}
if(document.form1.password.value != document.form1.rpassword.value || !document.form1.password.value )
	{
		document.getElementById('err4').style.display='';
		document.form1.rpassword.style.backgroundColor='#fdd';
		e=true;
	}
if(!document.form1.zip.value)
	{
		document.getElementById('err5').style.display='';
		document.form1.zip.style.backgroundColor='#fdd';
		e=true;
	}
if(document.form1.day.value=="00"||document.form1.year.value=="0000"||document.form1.month.value=="00")
	{
		document.getElementById('err6').style.display='';
		document.form1.day.style.backgroundColor='#fdd';
		document.form1.month.style.backgroundColor='#fdd';
		document.form1.year.style.backgroundColor='#fdd';
		e=true;
	}
	
if (e==false)
	{
		document.form1.submit();
	}
}


function verify_fb()
{
var e;
e=false;
if(!document.form1.firstname.value)
	{
		document.getElementById('err1').style.display='';
		document.form1.firstname.style.backgroundColor='#fdd';
		e=true;
	}
if(!document.form1.lastname.value)
	{
		document.getElementById('err2').style.display='';
		document.form1.lastname.style.backgroundColor='#fdd';
		e=true;
	}
/*
if(!document.form1.email.value.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,4}$/i) )
	{
		document.getElementById('erre1').style.display='';
		document.form1.email.style.backgroundColor='#fdd';
		e=true;
	}

if(!document.form1.password.value)
	{
		document.getElementById('err3').style.display='';
		document.form1.password.style.backgroundColor='#fdd';
		e=true;
	}
if(document.form1.password.value != document.form1.rpassword.value || !document.form1.password.value )
	{
		document.getElementById('err4').style.display='';
		document.form1.rpassword.style.backgroundColor='#fdd';
		e=true;
	}

if(!document.form1.zip.value)
	{
		document.getElementById('err5').style.display='';
		document.form1.zip.style.backgroundColor='#fdd';
		e=true;
	}
if(document.form1.day.value=="00"||document.form1.year.value=="0000"||document.form1.month.value=="00")
	{
		document.getElementById('err6').style.display='';
		document.form1.day.style.backgroundColor='#fdd';
		document.form1.month.style.backgroundColor='#fdd';
		document.form1.year.style.backgroundColor='#fdd';
		e=true;
	}
*/	
if (e==false)
	{
		document.form1.submit();
	}
}
