<!--

// browser detection
// browser detection:
var ua = navigator.userAgent;
var ns = (navigator.appName.toLowerCase().indexOf("netscape")!=-1)?1:0;
var ns6 = (document.getElementById && ns)?1:0;
var mac = (navigator.userAgent.toLowerCase().indexOf("mac")!=-1)?1:0;
var macie4 = (mac && !ns && parseInt(ua.substr(ua.indexOf("MSIE")+4,2)) <= 4)?1:0;


var hot_path = "";

var allLImagesOn = new Array(
"images/mnu_home_on.gif",
"images/mnu_gal_on.gif",
"images/mnu_inf_on.gif",
"images/mnu_alt_on.gif",
"images/mnu_contact_on.gif",
"images/mnu_pri_on.gif",
"images/mnu_fac_on.gif",
"images/mnu_agr_on.gif",
"images/mnu_ob_on.gif"
);

var allLImagesOff = new Array(
"images/mnu_home_off.gif",
"images/mnu_gal_off.gif",
"images/mnu_inf_off.gif",
"images/mnu_alt_off.gif",
"images/mnu_contact_off.gif",
"images/mnu_pri_off.gif",
"images/mnu_fac_off.gif",
"images/mnu_agr_off.gif",
"images/mnu_ob_off.gif"
);

var allLinks = new Array(
hot_path+"default.html",
hot_path+"gal.html",
hot_path+"info.html",
hot_path+"info2.html",
hot_path+"contact.html",
hot_path+"prices.html",
hot_path+"facilities.html",
hot_path+"agrement.html",
hot_path+"ob.html"
);

var ObjLImg_on = new Array();
var ObjLImg_off = new Array();

PreloadImages();

// Preloading all the roll-over images in the document:
function PreloadImages() {
	for (var i=0; i<allLImagesOn.length ; i++){
		ObjLImg_on[i] = new Image();
		ObjLImg_on[i].src = allLImagesOn[i];
		ObjLImg_off[i] = new Image();
		ObjLImg_off[i].src = allLImagesOff[i];
	}
}

function swap(name,index,state) {
		eval("document.images['" + name + "'].src = ObjLImg_" + state + "["+index+"].src");
}

var strMenus1 = new String("");
var strMenus2 = new String("");

for (var i=0;i<allLImagesOn.length;i++){
	if (pageNo==i) strMenus1 += '<IMG src="'+ObjLImg_on[i].src+'" border=0 align=absmiddle><BR>';
	else strMenus1 += '<A href="'+allLinks[i]+'" onmouseover="swap(\'mnu_'+i+'\','+i+',\'on\')" onmouseout="swap(\'mnu_'+i+'\','+i+',\'off\')"><IMG src="'+ObjLImg_off[i].src+'" border=0 name="mnu_'+i+'" align=absmiddle></A><BR>';
	//if (i<(allLImagesOn.length-1)) strMenus1 += '<IMG src="images/mnu_sep.gif" border=0 width=2 height=10 align=absmiddle hspace=5>'
}

//trims the leading and trailing blanks from a given string 
function Trim(strToTrim){
	while(strToTrim.charAt(0)==' '){	
		strToTrim = strToTrim.substring(1,strToTrim.length);
	}
	while(strToTrim.charAt(strToTrim.length-1)==' '){	
		strToTrim = strToTrim.substring(0,strToTrim.length-1);
	}
	return strToTrim;
}

/*
Validates the e-mail address from an input.
The parameter is the input object, in format: document.formName.inputName.
*/
function ValidateEmailAddress(objEmail) {
	var strEmail = Trim(objEmail.value);
	if (strEmail == ""){
		alert("Please fill in the E-mail field.");
		objEmail.focus();
		return false;
	} else {
		// checking "@" character:
		if (strEmail.indexOf("@")==-1) {
			alert("Error:\nE-mail field must contain @ character for an e-mail address.");
			objEmail.focus();
			return false;

		} else {
			// "@" cannot be the first character:
			if (strEmail.indexOf("@")==0) {
				alert("Error:\n@ cannot be the first character for an e-mail address.");
				objEmail.focus();
				return false;
			} else {
				// Caracterul "@" sa nu fie ultimul:
				if (strEmail.lastIndexOf("@") == strEmail.length-1) {
					alert("Error:\n@ cannot be the last character for an e-mail address.");
					objEmail.focus();
					return false;
				}
			}
			
			// "@" can appear only once:
			var emailSplited=strEmail.split("@");
			if (emailSplited.length>2) {
				alert("Error:\n@ can be appear only once for an e-mail address.");
				objEmail.focus();
				return false;
			}
			
			// "." must be present:
			if (strEmail.indexOf(".")==-1) {
				alert("Error:\nCharacter . must appear at least once for an e-mail address.");
				objEmail.focus();
				return false;
			} else {
				// "." cannot be the first character:
				if (strEmail.indexOf(".")==0) {
					alert("Error:\nCharacter . cannot be the first for an e-mail address.");
					objEmail.focus();
					return false;
				} else {
					// "." cannot be the last character:
					if (strEmail.lastIndexOf(".")==strEmail.length-1) {
						alert("Error:\nCharacter . cannot be the last for an e-mail address.");
						objEmail.focus();
						return false;
					}
				}
				
				// "." cannot appear one after another.
				if (strEmail.indexOf("..")>-1) {
					alert("Error:\nInvalid e-mail address.");
					objEmail.focus();
					return false;
				}
				
				// "@." or ".@" cannot appear:
				if ((strEmail.indexOf("@.")>-1) || (strEmail.indexOf(".@")>-1)) {
					alert("Error:\nInvalid e-mail address.");
					objEmail.focus();
					return false;
				}
				
				// Sa nu contina alte caractere decat litere (mari si mici), cifre, @ , . , - si _
				var carValide=new String("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@.-_");
				var carEmail=new String("");
				for (var i=0; i<strEmail.length; i++) {
					carEmail = "" + strEmail.substring(i, i+1);
					if (carValide.indexOf(carEmail) == "-1") {
						alert("Error:\nInvalid e-mail address.\nPlease use only digits, letters,  _   .  -");
						objEmail.focus();
						return false;
					}
				}
			}
		}
	}
	return true;
}

var footerHeight = 1;
var nsFix = 0;

function GetTDHeight(){
	if (ns6){
		contHeight = window.innerHeight - headerHeight - footerHeight - 8;
	} else if (ns){
		contHeight = window.innerHeight - headerHeight - footerHeight - 8 - nsFix;
	} else {
		contHeight = document.body.clientHeight - headerHeight - footerHeight - 8;
	}
	document.write("<TD height=" + contHeight + " valign=top>");
}


function GetTableHeight(){
	if (ns6){
		contHeight = window.innerHeight - headerHeight - footerHeight - 0;
	} else if (ns){
		contHeight = window.innerHeight - headerHeight - footerHeight - 0 - nsFix;
	} else {
		contHeight = document.body.clientHeight - headerHeight - footerHeight;
	}
	document.write("<TABLE width=100% cellspacing=0 cellpadding=0 border=0 height=" + contHeight + ">");
}

function StringReplace(strToFilter,filter1,filter2){
  var strFilt1 = new String(filter1);
  var strFilt2 = new String(filter2);
  var strTemp1 = new String(strToFilter);
  var strTemp2 = new String();
  strTemp2 = strTemp1.split(strFilt1);
  strTemp1 = "";
  for(var i=0;i<strTemp2.length;i++){
  		if(i==(strTemp2.length-1)) strFilt2 = "";
  		strTemp1 += strTemp2[i]+strFilt2;
  }
  
  return strTemp1;
}

//-->