///////////////////////////////function for placead.tpl ///////////////////////////////////



jQuery(document).ready(function(){

	jQuery("#submit").click(function(){

		jQuery("#registration").validate({rules:

										 {

											ref: { required: false, email: true}, 

										 	password: "required",  

											conPass: {equalTo: "#password"}

										 }

										});

		});

	});





//////////////////////// set hidden value for select language variable	////////////////////////////////

function hiddenvalue()

{

	document.getElementById('req').value=1;	

}



/////////////////////////// select language... 	dialog box 	///////////////////////////////////

jQuery(document).ready(function() {



            jQuery("#lang").click(function() {

				jQuery("fieldset#signin_menu").toggle();

				jQuery("#lang").toggleClass("menu-open");

            });

			

			jQuery("fieldset#signin_menu").mouseup(function() {

				return false

			});

			jQuery(document).mouseup(function(e) {

				if(jQuery(e.target).parent("a#lang").length==0) {

					jQuery("#lang").removeClass("menu-open");

					jQuery("fieldset#signin_menu").hide();

				}

			});			

			

        });

///////////////////////////	for selection of language	/////////////////////////////





function selectLanguageEN()

{	document.getElementById('language').value ="english";	}

function selectLanguageSP()

{	document.getElementById('language').value ="spanish";	}

function selectLanguageFR()

{	document.getElementById('language').value = "french";	}	



//////////////////////////// for opening find more pages   ////////////////////////////////////



function openwindow1()

{	window.open("findmore_step1.php","mywindow","resizable=1,width=780,height=630,location=1,status=1,scrollbars=1");	}

function openwindow2()

{	window.open("findmore_step2.php","mywindow","resizable=1,width=750,height=600,location=1,status=1,scrollbars=1");	}

function openwindow3()

{	window.open("findmore_step3.php","mywindow","resizable=1,width=750,height=680,location=1,status=1,scrollbars=1");	}

function more()

{	window.open("more.php","mywindow","resizable=1,width=750,height=600,location=1,status=1,scrollbars=1");	}

function needhelp()

{	window.open("needhelp.php","mywindow","resizable=1,width=750,height=300,location=1,status=1,scrollbars=1");	}

function termConditions()

{	window.open("termConditions.php","mywindow","resizable=1,width=750,height=500,location=1,status=1,scrollbars=1");	}

function conditions_booking()

{	window.open("conditions_booking.php","mywindow","resizable=1,width=750,height=500,location=1,status=1,scrollbars=1");	}

function openwindow5(ss)

{

	

	if(ss=='english')

	{

		window.open("new_main.swf","mywindow","resizable=1,width=750,height=500,location=1,status=1,scrollbars=1");	

	}

	else

	{

		window.open("new_mainfr.swf","mywindow","resizable=1,width=750,height=500,location=1,status=1,scrollbars=1");	

	}

}

/////////////////////////////	pymt Mode	/////////////////////////////////

var xmlhttp;

function pymtMode(str,lang)

{

xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)

  {

  alert ("Browser does not support HTTP Request");

  return;

  }

  

var pvalue	=	document.getElementById('paymentMode').value;  

var url=str+"pymt.php";

url=url+"?q="+pvalue+"&language="+lang;

url=url+"&sid="+Math.random();

xmlhttp.onreadystatechange=stateChanged;

xmlhttp.open("GET",url,true);

xmlhttp.send(null);

}



function stateChanged()

{

if (xmlhttp.readyState==4)

{

document.getElementById("pymt").innerHTML=xmlhttp.responseText;

}

}



function GetXmlHttpObject()

{

if (window.XMLHttpRequest)

  {

  // code for IE7+, Firefox, Chrome, Opera, Safari

  return new XMLHttpRequest();

  }

if (window.ActiveXObject)

  {

  // code for IE6, IE5

  return new ActiveXObject("Microsoft.XMLHTTP");

  }

return null;

}





////////////////////////////////	method new	////////////////////////////////////



jQuery(document).ready(function(){

	jQuery("#send").click(function(){

		

		jQuery("#method3").validate();			   

   		jQuery(".error").html('');

		if(jQuery("#method3 input[type='checkbox']:checked").length > 0)

    	 {  		return true;

    	

		 }

		 else

		 	{

				document.getElementById('err').style.visibility="visible";

				return false;

			}

		/*if(jQuery("input[id=^+'send_mail']").is(":checked"))

			return true;

		else

			return false;*/

		});

	});









////////////////////////////////	method 3	////////////////////////////////////



jQuery(document).ready(function(){

	jQuery("#submitM3").click(function(){

   jQuery(".error").html('');

		jQuery("#openinviter").validate();

		});

	});





////////////////////////////////	method 1	////////////////////////////////////



jQuery(document).ready(function(){

	jQuery("#submitM1").click(function(){

   jQuery(".error").html('');

		jQuery("#method1").validate({rules: {password: "required",  conPass: {equalTo: "#password"}}});

		});

	});





////////////////////////////////	method 2	////////////////////////////////////

function textarea_val(lang)

{

	var	txtarea	=	document.getElementById('several_grp').value;

	var a	=	txtarea.substring(txtarea.length-1)

	if(a == ';')

	{

			txtarea		=	txtarea.substring(0,txtarea.length-1)

	}

	if(txtarea=='')

	{	

		if(lang=='english')

			document.getElementById('txt_empty').innerHTML	="Please Fill at least one Email.";

		else if(lang=='spanish')

			document.getElementById('txt_empty').innerHTML	="Por favor, llenar al menos un correo electr&oacute;nico.";

		else

			document.getElementById('txt_empty').innerHTML	="S'il vous pla&Icirc;t remplir au moins un Email.";

		return false;

	}

	

	var split_arr	 =	new Array();

	var split_arr	=	txtarea.split(";");

	var length		=	split_arr.length;

	if(length <=12)

	{

		for(var i = 0; i < length; i++)

		{

			var email	=	split_arr[i];

			while (email.substring(0,1) == ' ') 

       			 email = email.substring(1, email.length);

			while (email.substring(email.length-1,email.length) == ' ')

        			email = email.substring(0, email.length-1);

			var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,3})$/;

			   if(reg.test(email) == false) 

			   {

				   if(lang=='english')

						document.getElementById('txt_empty').innerHTML	="Please fill in proper syntax.";

					else if(lang=='spanish')

						document.getElementById('txt_empty').innerHTML	="Por favor, rellene la sintaxis correcta.";

					else

						document.getElementById('txt_empty').innerHTML	="S'il vous pla&Icirc;t remplir la syntaxe appropri&eacute;e.";

				return false;

			   }

			}

	}

	else

	{

				if(lang=='english')

						document.getElementById('txt_empty').innerHTML	="Saperator exceeds from maximum value.";

					else if(lang=='spanish')

						document.getElementById('txt_empty').innerHTML	="Saperator excede del valor m&aacute;ximo.";

					else

						document.getElementById('txt_empty').innerHTML	="Saperator d&eacute;passe de valeur maximale.";

					return false;

	}

}











////////////////////////////////	method 3	////////////////////////////////////



jQuery(document).ready(function(){

	jQuery("#submitM3").click(function(){

		jQuery("#method3").validate();

		});

	});





////////////////////////////////	Contact us	////////////////////////////////////



jQuery(document).ready(function(){

	jQuery("#submit").click(function(){

		jQuery("#contact").validate();

		});

	});



//////////////////////////////////   Booking  //////////////////////////////////////////

jQuery(document).ready(function(){

	jQuery("#submit").click(function(){

		jQuery("#booking").validate({rules:

										 {

											con_email: {equalTo: "#email"}

										 }

										});

		});

	});





////////////////////////////////	registration agency	////////////////////////////////////



jQuery(document).ready(function(){

	jQuery("#submit_A").click(function(){



		jQuery("#registration_A").validate({rules:

										 {

											password: "required",  

											conPass: {equalTo: "#password"}

										 }

										});

		});

	});



////////////////////////////////	Login form	////////////////////////////////////



jQuery(document).ready(function(){

	jQuery("#submitLogin").click(function(){

   jQuery(".error").html('');

		jQuery("#loginForm").validate();

		});

	});


