function popupWindow(url) {
	window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=420,height=400,screenX=400,screenY=300,top=200,left=450')
}

function showExtraDescription(divno){
	
	

	ieD='item_extra_description'+divno;
	lsE='link_show_ExtraDetails'+divno;
	lhE='link_hide_ExtraDetails'+divno;
	
	document.getElementById(ieD).style.display = 'block';
	document.getElementById(lsE).style.display = 'none';
	document.getElementById(lhE).style.display = 'block';
	
	
		
}


function hideExtraDescription(divno){

	ieD='item_extra_description'+divno;
	lsE='link_show_ExtraDetails'+divno;
	lhE='link_hide_ExtraDetails'+divno;

	document.getElementById(ieD).style.display = 'none';
	document.getElementById(lhE).style.display = 'none';
	document.getElementById(lsE).style.display = 'block';
	
}

function is_email(str){
	pattern = /^[0-9a-z]([-_\.]?[0-9a-z])*@[0-9a-z]([-\.]?[0-9a-z])*\.[a-z]{2,6}$/gi;
	return pattern.test(str);
}

function checkform(){

	f=document.orderform;

	
	if (f.first_name.value=='') 
		{	
		alert ("{You must provide a first name} !"); 
		f.first_name.focus();		
		document.getElementById('fnl').className='tderror';
		document.getElementById('fnv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('fnl').className='';
			document.getElementById('fnv').className='';
			}
	
	if (f.last_name.value=='') 
		{	
		alert ("{You must provide a last name} !"); 
		f.last_name.focus();		
		document.getElementById('lnl').className='tderror';
		document.getElementById('lnv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('lnl').className='';
			document.getElementById('lnv').className='';
			}
	if (f.primary_address.value=='') 
		{	
		alert ("{You must provide a primary address} !"); 
		f.primary_address.focus();		
		document.getElementById('pal').className='tderror';
		document.getElementById('pav').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('pal').className='';
			document.getElementById('pav').className='';
			}
	
	if (f.select_country.value==0) 
		{	
		alert ("{Please choose your country} !"); 
		f.select_country.focus();		
		document.getElementById('ctrl').className='tderror';
		document.getElementById('ctrv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('ctrl').className='';
			document.getElementById('ctrv').className='';
			}
	
	if (f.city.value=='') 
		{	
		alert ("{You must provide a city} !"); 
		f.city.focus();		
		document.getElementById('ctyl').className='tderror';
		document.getElementById('ctyv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('ctyl').className='';
			document.getElementById('ctyv').className='';
			}
	if (f.zip.value=='') 
		{	
		alert ("{You must provide a zip/code} !"); 
		f.zip.focus();		
		document.getElementById('zpl').className='tderror';
		document.getElementById('zpv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('zpl').className='';
			document.getElementById('zpv').className='';
			}
	if (f.phnumber.value=='') 
		{	
		alert ("You must provide a phone number !"); 
		f.phnumber.focus();		
		document.getElementById('phnl').className='tderror';
		document.getElementById('phnv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('phnl').className='';
			document.getElementById('phnv').className='';
			}
	if (f.email.value==''||!is_email(f.email.value)) 
		{	
		alert ("Email missing or invalid !"); 
		f.email.focus();		
		document.getElementById('emll').className='tderror';
		document.getElementById('emlv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('emll').className='';
			document.getElementById('emlv').className='';
			}
	f.submit();


}


function checkform2(){

	f=document.orderform;

	
	if (f.ccfullname.value=='') 
		{	
		alert ("You must provide a full name !"); 
		f.ccfullname.focus();		
		document.getElementById('ccfullnamel').className='tderror';
		document.getElementById('ccfullnamev').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('ccfullnamel').className='';
			document.getElementById('ccfullnamev').className='';
			}
	
	if (f.ccaddress.value=='') 
		{	
		alert ("You must provide an address matching credit card statements !"); 
		f.ccaddress.focus();		
		document.getElementById('ccaddressl').className='tderror';
		document.getElementById('ccaddressv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('ccaddressl').className='';
			document.getElementById('ccaddressv').className='';
			}
	
	if (f.cccity.value=='') 
		{	
		alert ("You must provide a city !"); 
		f.cccity.focus();		
		document.getElementById('cccityl').className='tderror';
		document.getElementById('cccityv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('cccityl').className='';
			document.getElementById('cccityv').className='';
			}
	if (f.cczip.value=='') 
		{	
		alert ("You must provide a zip/code !"); 
		f.cczip.focus();		
		document.getElementById('cczipl').className='tderror';
		document.getElementById('cczipv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('cczipl').className='';
			document.getElementById('cczipv').className='';
			}
	if (f.ccnumber.value=='') 
		{	
		alert ("You must provide a phone number !"); 
		f.ccnumber.focus();		
		document.getElementById('ccnumberl').className='tderror';
		document.getElementById('ccnumberv').className='tderror';
		return;
		}
		else 
			{
			document.getElementById('ccnumberl').className='';
			document.getElementById('ccnumberv').className='';
			}
	


}
