<!---

function closewindow(){

window.opener.location.reload();
window.close();
	
}

function popUp($url,w,h) {
   mywindow = window.open ($url,"mywindow","location=0,status=0,scrollbars=1,toolbar=0,menubar=0,titlebar=0,width=" + w + ",height=" + h + "");
  mywindow.moveTo(300,200);
 }
 
 function http(field){
 field.value=field.value.replace('http://','');
 } function http(field){
 field.value=field.value.replace('http://','');
 }
 
 function nav(id,state){
	strsrc = element(id).src;
	
	if(state == "over"){
	element(id).src = strsrc.replace('Off','Over');	
	} else {
	element(id).src = strsrc.replace('Over','Off');	
	}
	 
	 
 }
 
 /*/
function popUp($url,w,h) {
	var rand = Math.random();
   mywindow = window.open($url,rand,"location=0,status=0,scrollbars=1,toolbar=0,menubar=0,titlebar=0,width=" + w + ",height=" + h + "");
  mywindow.moveTo(300,200);
 }/*/
 function element(id){
	 return document.getElementById(id);
 }
 
 
 function pdf(type,id){
	
element('niframe').src='dl2.php?type='+type+'&id='+id;


}
 
function CheckContact(theform){

var error = "";
/*//*/
error += dropdown(theform.title,"Please choose your Title");
error += isBlank(theform.name.value,"Please enter your Name");
error += isBlank(theform.surname.value,"Please enter your Surname");
error += checkEmail(theform.email.value,"Please enter a valid Email Address");
error += isEmptyNum(theform.tel.value,"Please enter a valid Phone Number");
error += isBlank(theform.comments.value,"Please enter your comments or questions");

if(error != ""){ alert(error); return false; }  // else { return true; }
}


function CheckContactFR(theform){

var error = "";
/*//*/
error += dropdown(theform.title,"S'il vous plaît choisir votre titre");
error += isBlank(theform.name.value,"S'il vous plaît entrez votre nom");
error += isBlank(theform.surname.value,"S'il vous plaît entrer votre nom");
error += checkEmail(theform.email.value,"S'il vous plaît entrer une adresse email valide");
error += isEmptyNum(theform.tel.value,"S'il vous plaît entrer un numéro de téléphone valide");
error += isBlank(theform.comments.value,"S'il vous plaît entrer vos commentaires ou questions");

if(error != ""){ alert(error); return false; }  // else { return true; }
}



function CheckContact2(theform){

var error = "";
/*//*/
error += isBlank(theform.name.value,"Please enter your Full Name.");
error += isBlank(theform.company.value,"Please enter your Company Name.");
error += isEmptyNum(theform.tel.value,"Please enter a valid Phone Number.");
error += checkEmail(theform.email.value,"Please enter a valid Email Address.");
error += isBlank(theform.services_required.value,"Please list the Services you require.");
error += isBlank(theform.project_description.value,"Please describe your Project Requirements.");

if(error != ""){ alert(error); return false; }  // else { return true; }
}

function CheckApp(theform){

var error = "";
/*//*/
error += isBlank(theform.company.value,"Please enter your Company Name.");
error += dropdown(theform.title,"Please choose your Title.");
error += isBlank(theform.name.value,"Please enter your Name.");
error += isBlank(theform.surname.value,"Please enter your Surname.");
error += isBlank(theform.position.value,"Please enter your Position in the company.");
error += isEmptyNum(theform.tel.value,"Please enter a valid Phone Number");
error += checkEmail(theform.email.value,"Please enter a valid Email Address");
error += dropdown(theform.cat,"Please select you Nearest Region.");
error += isBlank(theform.country.value,"Please enter your Country.");
error += isBlank(theform.username.value,"Please enter a Username.");
error += isBlank(theform.password.value,"Please enter a Password.");
error += fieldmatch(theform.password.value,theform.password2.value,"Your passwords do no Match.");

if(error != ""){ alert(error); return false; }  // else { return true; }
}


function over(src,state){
	if(state == "on"){
	document.getElementById(src).src='images/salamanav-over_'+src+'.jpg';	
	}
	if(state == "off"){
	document.getElementById(src).src='images/salamanav_'+src+'.jpg';	
	} 
}
/*/ 
/*/
function ismaxlength(obj){

var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""

if (obj.getAttribute && obj.value.length>mlength)

obj.value=obj.value.substring(0,mlength)

}

 function http(field){
 field.value=field.value.replace('http://','');
 } function http(field){
 field.value=field.value.replace('http://','');
 }
 
 ////////////////
 
 

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
 
function isBlank(str,msg){
	var error = "";
	str = trim(str)
	if(str.length == 0){ error = msg +'\n'; }
	return error;
	}


function fieldmatch(str1,str2,msg){
	var error = "";
	if(str1 != str2){
	error = msg +'\n';
	}
	return error;

}



function checkEmail (strng,msg) {
var error="";
	if (isBlank(strng)) { error = msg + "\n"; }
	
		var emailFilter=/^.+@.+\..{2,3}$/;
		if (!(emailFilter.test(strng))) { error = msg + "\n"; }
		else {
		   var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
			 if (strng.match(illegalChars)) { error = msg + "\n"; }
		}
	return error;    
}

function isEmptyNum(strng,msg) {
var error = "";
	if (isBlank(strng)) { error = msg + "\n"; } else {
		   var illegalChars= /[\@\<\>\,\;\:\\\"\[\]]/
			 if (strng.match(illegalChars)) { error = msg + "\n"; }
		}
	return error;	  
}
function valNum(strng,msg) {
var error = "";
	if(strng.length != 0){
		   var illegalChars= /[\@\<\>\,\;\:\\\"\[\]]/
			 if (strng.match(illegalChars)) { error = msg + "\n"; }
	}
	return error;	  
}


function radio(radiobut,strng){
var error = "";
var radio_choice = false;
for (i = 0; i < radiobut.length; i++){
if (radiobut[i].checked)
radio_choice = true; 
}
if (!radio_choice){ error = ""+strng+"\n"; }
return error; }

function dropdown(menu,strng){
var error = "";
 if ( menu.selectedIndex == 0 )
    {
        error = strng+" \n";
        valid = false;
    }
	return error; }
	


function toggleLayer(whichLayer){
if (document.getElementById) {
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"block";
}
else if (document.all){
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
} else if (document.layers) {
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"block"; }
}

function dropother(menu,layer){
 if ( menu.selectedIndex == 1 ){
 	toggleLayer(layer); } else { 	
	if(document.getElementById(layer).style.display == "block"){
 	toggleLayer(layer); } }

}
function strMatch(f1,f2,msg){
var error = "";
 if (f1 != f2){
	 error = msg+"\n";
	 }

}

/* Rewrite #anchor links for pages with BASE HREF */
 var anchors = document.getElementsByTagName("a");
 var basehref = document.getElementsByTagName("base")[0].href;
 var url = window.location.href;
 if(url.indexOf("#") > 0) url = url.substr(0, url.indexOf("#")); //strip hash
 if(basehref) {
 for(var i = 0; i < anchors.length; i++) {
 var anchor = anchors[i];
 poundPos = anchor.href.indexOf("/#");
 if (poundPos > 0) {
 anchor.href = url + anchor.href.substr(poundPos + 1);
 }
 }
 }
 
 
 function urlencode(str) {
return escape(str).replace('+', '%2B').replace('%20', '+').replace('*', '%2A').replace('/', '%2F').replace('@', '%40');
}

function urldecode(str) {
return unescape(str.replace('+', ' '));
}
 
  
 function h1(){
	
	if (!document.getElementsByTagName){ return; }
	var h3a = document.getElementsByTagName('h3');
		for (var i=0; i<h3a.length; i++){
			if(h3a[i].className == 'flash'){
				var h3 = h3a[i];
				var text = h3.innerHTML; 
			 
				//alert(text);
				flashheads("h3",text);
				h3.innerHTML = flashheads("h3",text);
				h3.style.visibility = 'visible';
				h3.style.height = 'auto';
			}  
		} 
	var h1a = document.getElementsByTagName('h1');
		for (var i=0; i<h1a.length; i++){
			 if(h1a[i].className == 'flash'){
				var h1 = h1a[i];
				var text = h1.innerHTML;   
				  
				//alert(text);
				h1.innerHTML = flashheads("h1",text);
				h1.style.visibility = 'visible';
				h1.style.height = 'auto';
			 }
		} 



	var h2a = document.getElementsByTagName('h2');
		for (var i=0; i<h2a.length; i++){
			if(h2a[i].className == 'flash'){
				var h2 = h2a[i];
				var text = h2.innerHTML;  
				h2.innerHTML = flashheads("h2",text);
				h2.style.visibility = 'visible';
			}
		} 

 }
		
function html_entity_decode(string) {
   var temphtml=document.createElement('textarea');
   temphtml.innerHTML = string;
   return temphtml.value;
}		
function flashheads(type,text){ 	 
 
var genflash = '';		
text = html_entity_decode(html_entity_decode(text));
		switch(type){
			case "h3":
			fwidth = '210';
			fheight = '22';
			fsrc = 'heads11.swf?var=adsadsqwsdf';
			break;
			case "h1":
			fwidth = '482';
			fheight = '22';
			fsrc = 'heads1.swf?var=sdfsdfa';
			break;

		}
 
genflash += ' <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';

genflash += ' width="' + fwidth +'" height="' + fheight +'" ';
genflash += '  id="FlashIDx"> ';
genflash += '<param name="movie" value="images/'+ fsrc +'" /> ';
genflash += ' <param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="swfversion" value="8.0.35.0" /><!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don\'t want users to see the prompt. --><param name="expressinstall" value="Scripts/expressInstall.swf" /><param name="FlashVars" value="headvar=' + text + '" /><!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --><!--[if !IE]>-->'
genflash += '<object data="images/'+ fsrc +'" type="application/x-shockwave-flash" width="' + fwidth +'" height="' + fheight +'">';
genflash += ' <!--<![endif]--><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="swfversion" value="8.0.35.0" /><param name="expressinstall" value="Scripts/expressInstall.swf" /><param name="FlashVars" value="headvar=' + text + '" /><!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --><div><h3>' + text + '</h3></div><!--[if !IE]>--></object><!--<![endif]--></object>';

return genflash;

}

function checkagm(theform){

var error = "";
/*//*/
error += isBlank(theform.name.value,"Please enter your name.");
error += isBlank(theform.surname.value,"Please enter your surname.");
error += isBlank(theform.company_name.value,"Please enter your company name.");
error += isBlank(theform.nationality.value,"Please enter your nationality.");
error += isBlank(theform.official_title.value,"Please enter your official title.");
error += isBlank(theform.address.value,"Please enter your address.");
error += isEmptyNum(theform.telephone.value,"Please enter your telephone number.");
error += checkEmail(theform.email.value,"Please enter a valid email address.");
error += isEmptyNum(theform.fax.value,"Please enter a valid fax number.");

error += isBlank(theform.country.value,"Please enter your country.");
error += isBlank(theform.passport_type.value,"Please enter a valid passport type.");
error += isEmptyNum(theform.passport_number.value,"Please enter your passport number.");
error += isBlank(theform.passport_date.value,"Please enter your passport date.");
error += isBlank(theform.passport_expirydate.value,"Please enter your passport expiry date.");
error += dropdown(theform.i_am_a,"Please select who you are.");
error += isBlank(theform.spouse_name.value,"Please enter your spouse's name");
error += dropdown(theform.language,"Please select your language");

error += isBlank(theform.flight_arrival_date.value,"Please enter your flight arrival date");
error += isEmptyNum(theform.flight_arrival_number.value,"Please enter your flight arrival number.");
error += isEmptyNum(theform.flight_arrival_time.value,"Please enter your flight arrival time.");
error += isBlank(theform.flight_departure_date.value,"Please enter your departure date");
error += isEmptyNum(theform.flight_departure_number.value,"Please enter your flight departure number.");
error += isEmptyNum(theform.flight_departure_time.value,"Please enter your flight departure time.");

error += dropdown(theform.checkin_date_day,"Please select your check in date");
error += dropdown(theform.checkout_date_day,"Please select your check out");
error += dropdown(theform.hotel_selection,"Please choose your hotel room type");



if(error != ""){ alert(error); return false; }  // else { return true; }
}


function checkEmployment(theform){

var error = "";
/*//*/
error += isBlank(theform.position_of_interest.value,"Please indicate your position of interest.");
error += isBlank(theform.name.value,"Please enter your name.");
error += isBlank(theform.surname.value,"Please enter your surname.");
error += dropdown(theform.gender,"Please select your gender.");
error += dropdown(theform.nationality,"Please select your nationality.");
error += dropdown(theform.dob_day,"Please indicate your date of borth.");
error += isBlank(theform.nationality.value,"Please enter your nationality.");
error += isEmptyNum(theform.tel.value,"Please enter your telephone number.");
error += checkEmail(theform.email.value,"Please enter a valid email address.");
error += isBlank(theform.address.value,"Please enter your address.");

error += isChecked(theform.tcscs,"Please see that the information you provided is accurate and correct.");


if(error != ""){ alert(error); return false; }  // else { return true; }
}
 
 
 function isChecked(fld,msg){
	var error = "";
	if ( fld.checked == false )
	{
		error = msg+" \n";
		valid = false;
	}
	return error; 
	
	}

/*//*/

-->
