/*  
=================================================
	Author		: Cornelius Dito (Swara Technology)
	Domain		: www.swarastore.com
	WebDesign 	: Swara Technology 
=================================================
*/
 
function validate(){ 
	var theForm = document.forms["contactus"];
	var emailRE = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	var userRE0 = new RegExp("http://");
	var errMsg = "";
	var setfocus = "";


	//if (theForm.prices_class.value == ""){
	//	errMsg = "Warning!\nPlease select the price !";
	//	setfocus = "['prices_class']";
	//}
	//if (theForm.accommodation.value == ""){
	//	errMsg = "Warning!\nPlease type of accommodation !";
	//	setfocus = "['accommodation']";
	//}
	
	//if (theForm.pax.value == ""){
	//	errMsg = "Warning!\nPlease select of pax !";
	//	setfocus = "['pax']";
	//}
	
	//if (theForm.length.value == ""){
	//	errMsg = "Warning!\nPlease type of length !";
	//	setfocus = "['length']";
	//}
	
	//if (theForm.day.value == "" || theForm.month.value == "" || theForm.year.value == ""){
	//	errMsg = "Warning!\nPlease select date!";
	//	setfocus = "['day']";
	//}

	//if (theForm.classification.value == "" || theForm.classification2.value == "" || theForm.desc.value == ""){
	//	errMsg = "Warning!\nPlease type of holiday 1232";
	//	setfocus = "['holiday']";
	//}
	
	//if (theForm.holiday.value == ""){
	//	errMsg = "Warning!\nPlease type of holiday !";
	//	setfocus = "['holiday']";
	//}
	
	if (!emailRE.test(theForm.email.value)){
		errMsg = "Warning!\nPlease check your email !";
		setfocus = "['email']";
	}
	
	if (theForm.email.value == ""){
		errMsg = "Warning!\nPlease enter your email!";
		setfocus = "['email']";
	}
	
	//if (theForm.country.value == ""){
	//	errMsg = "Warning!\nEnter your Country were your leave.";
	//	setfocus = "['country']";
	//}
	
	//if (theForm.lname.value == ""){
	//	errMsg = "Warning!\nEnter your Last Name";
	//	setfocus = "['lname']";
	//}
	
	if (theForm.fname.value == ""){
		errMsg = "Warning!\nEnter your First Name";
		setfocus = "['fname']";
	}

	if (errMsg != ""){
		alert(errMsg);
		eval("theForm" + setfocus + ".focus()");
	}
	
	else theForm.submit();
}

function validate_security(){
	var theForm = document.forms["contactus"];
	var emailRE = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	var userRE0 = new RegExp("http://");
	var errMsg = "";
	var setfocus = "";	
	
	if (theForm.secure_text.value == ""){
		errMsg = "Warning!\nEnter the Code!";
		setfocus = "['secure_text']";
	}

	if (errMsg != ""){
		alert(errMsg);
		eval("theForm" + setfocus + ".focus()");
	}
	
	else theForm.submit();	
}

function createIsland()
{
	island=document.contactus.island;
	txt='';
	for (i=0;i<island.length;++ i)
  	{
  		if (island[i].checked)
    		{
    			txt=txt + island[i].value + ', ';
    		}
  	}
document.getElementById('classification').value= txt;
}

function createActivities()
{
	activities=document.contactus.activities;
	txt='';
	for (i=0;i<activities.length;++ i)
  	{
  		if (activities[i].checked)
    		{
    			txt=txt + activities[i].value + ', ';
    		}
  	}
document.getElementById('classification2').value= txt;
}


function createPrice()
{
	price=document.contactus.price;
	txt='';
	for (i=0;i<price.length;++ i)
  	{
  		if (price[i].checked)
    		{
    			txt=txt + price[i].value + ' ';
    		}
  	}
document.getElementById('prices_class').value= txt;
}

function hidedisply2() {
	document.getElementById('disply1').style.display = 'none'; 
	document.getElementById('disply2').style.display = 'inline'; 
  }
  
function hidedisply1() {
	document.getElementById('disply1').style.display = 'inline'; 
	document.getElementById('disply2').style.display = 'none'; 
  }
