///////////////////////////////////////////
//------ LAUNCH WINDOW FUNCTIONS --------//
///////////////////////////////////////////

function launchWindow (url,recId,h,w) {
	var width=(w);
	var height=(h);
	var left = ('10');
  	var top = ('10');
 	var messWinStyle = 'width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+',titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resize=0,copyhistory=1';
	window.open('popups/'+url+'.asp?ClientID='+recId,'title',messWinStyle);
}

function launchWindow_cal (url,recId,h,w) {
	var width=(w);
	var height=(h);
	var left = ('10');
  	var top = ('10');
 	var messWinStyle = 'width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+',titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resize=0,copyhistory=1';
	window.open('../popups/'+url+'.asp?id='+recId,'title',messWinStyle);
}
function launchWindow_stdLV(url,recId,h,w) {
	if (screen.height == 600){
		var height=(h);
	}else{
		var height=((screen.height)-100);
	}
	var width=(w);
	var left = ('10');
  	var top = ('10');
 	var messWinStyle = 'width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+',titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resize=0,copyhistory=1';
	window.open('../popups/'+url+'.asp?ClientID='+recId,'title',messWinStyle);
}

function launchWindow_std (url,recId,h,w) {
	if (screen.height == 600){
		var height=(h);
	}else{
		var height=((screen.height)-100);
	}
	var width=(w);
	var left = ('10');
  	var top = ('10');
 	var messWinStyle = 'width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+',titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resize=0,copyhistory=1';
	window.open('popups/'+url+'.asp?ClientID='+recId,'title',messWinStyle);
}

function launchWindow_pop(url,recId,h,w) {
	if (screen.height == 600){
		var height=(h);
	}else{
		var height=((screen.height)-100);
	}
	var width=(w);
	var left = ('10');
  	var top = ('10');
 	var messWinStyle = 'width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+',titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resize=0,copyhistory=1';
	window.open(url+'.asp?ClientID='+recId,'title',messWinStyle);
}
///////////////////////////////////////////
// ------- SITE FORM VALIDATION -------- //
///////////////////////////////////////////

function check_holidayForm(holidayForm) {
	if ((!document.holidayForm.AccomType1.checked) && (!document.holidayForm.AccomType2.checked) && (!document.holidayForm.AccomType3.checked) && (!document.holidayForm.AccomType4.checked) && (!document.holidayForm.AccomType5.checked) && (!document.holidayForm.AccomType6.checked) && (!document.holidayForm.AccomType29.checked) && (!document.holidayForm.AccomType30.checked) && (!document.holidayForm.AccomType37.checked) && (!document.holidayForm.AccomType52.checked)){
		alert(" You must choose an Accomodation Type ")
		return false;
	}else{
		return true;
	}
}

function check_enquiryForm(enquiryForm) {
var message = "------------------------------------------------------------------   \n*     Please enter the following details and try again    *\n------------------------------------------------------------------   \n\n";
var message01 = "";
var check = 0;
var name;
	if (document.enquiryForm.name.value == ""){
		message01 = message01 + " -     Your Name. \n\n";
	}
	name = document.enquiryForm.email.value.split("@");
	if (name.length > 1){
		check = check + 1;
		if (name[0].length > 1){
			check = check + 1;
			at = name[1].split(".");
			if (at.length > 1){
				check = check + 1;
			}
		}
	}
	if (check != 3){
	message01 = message01 + " -     Your Email must be a valid address. \n\n";   
	} 
	if (document.enquiryForm.Phone.value == ""){
		message01 = message01 + " -     Your Phone Number. \n\n";
	}else{
		if (!parseInt(document.enquiryForm.Phone.value)){
		message01 = message01 + " -     Your Phone Number must be a Number. \n\n";
		}
	}
	  	
	if (document.enquiryForm.enquiry.value == ""){
	message01 = message01 + " -     Your Message. \n\n";
	}
	
	if (message01.length != 0){
		alert(message + message01);
		return false;
	}else{	
		return true;
	}
}

function check_freeAddForm(freeAddForm) {
var message = "------------------------------------------------------------------   \n*     Please enter the following details and try again    *\n------------------------------------------------------------------   \n\n";
var message01 = "";
var check = 0;
var name;
	if (document.freeAddForm.Name.value == ""){
		message01 = message01 + " -     Your Business Name. \n\n";
	}
	if (document.freeAddForm.FirstName.value == ""){
		message01 = message01 + " -     Your First Name. \n\n";
	}
	if (document.freeAddForm.LastName.value == ""){
		message01 = message01 + " -     Your Surname. \n\n";
	}
	if (document.freeAddForm.Street.value == ""){
		message01 = message01 + " -     Your Street. \n\n";
	}
	if (document.freeAddForm.Town.value == ""){
		message01 = message01 + " -     Your Town. \n\n";
	}
	if (document.freeAddForm.Postcode.value == ""){
		message01 = message01 + " -     Your Postcode. \n\n";
	}
	name = document.freeAddForm.Email.value.split("@");
	if (name.length > 1){
		check = check + 1;
		if (name[0].length > 1){
			check = check + 1;
			at = name[1].split(".");
			if (at.length > 1){
				check = check + 1;
			}
		}
	}
	if (check != 3){
	message01 = message01 + " -     Your Email must be a valid address. \n\n";   
	} 
	if (document.freeAddForm.Phone.value == ""){
		message01 = message01 + " -     Your Phone Number. \n\n";
	}else{
		if (!parseInt(document.freeAddForm.Phone.value)){
		message01 = message01 + " -     Your Phone Number must be a Number. \n\n";
		}
	}
	
	if (message01.length != 0){
		alert(message + message01);
		return false;
	}else{	
		return true;
	}
}
		
		
		
				
		
		
		
		
		
		
		
		
		
		
		
		