
function GoSearch(frm){
	frm.txtSearch.focus();
}


/* ################################################################################ */
/* ##### Begin Page Contact Us #################################################### */

function SendMailContactUs(){
	sCad = "";
	var frm = document.frmContactUs;
	var kName = frm.txtName.value;
	var kEmail = frm.txtEmail.value;
	var kMsg = frm.txtMessage.value;
	if (kName.Trim() == "") sCad += "\tName\n";
	if (kEmail.Trim() == "") sCad += "\tEmail\n";
	if (kMsg.Trim() == "") sCad += "\tMessage\n";
	if (sCad == ""){
		frm.Target.value = "SENDMAIL";
		frm.submit();
	}else{
		var sMsg = "The form was not submited.\nThe following field(s) must be filled:\n__________________________________________";
		sMsg = sMsg + "\n\n" + sCad;
		alert(sMsg);
	}
}
function SendMail222(frm){
	sCad = "";
//	var frm = document.frmEmail;
	var kName = frm.txtName.value.Trim();
	var kEmail = frm.txtEmail.value.Trim();
	var kPhone = frm.txtPhone.value.Trim();
//	var kMsg = frm.txtMessage.value.Trim();
	if (kName == "") sCad += "\tName\n";
	if (kEmail == "") sCad += "\tEmail\n";
	if (kPhone == "") sCad += "\tPhone\n";
//	if (kMsg.Trim() == "") sCad += "\tMessage\n";
	if (sCad == ""){
		frm.Target.value = "SENDMAIL";
		frm.submit();
	}else{
		var sMsg = "The form was not submited.\nThe following field(s) must be filled:\n__________________________________________";
		sMsg = sMsg + "\n\n" + sCad;
		alert(sMsg);
	}
}

/* ##### End Page Contact Us ###################################################### */
/* ################################################################################ */


/* ################################################################################ */
/* ##### Begin Newsletters ######################################################## */

/*## suscribe ##*/

function SendSuscribe(){
	var frm = document.frmSuscribe;
	var SubsDefa = "Enter email";
	if (frm.SubsDefa) SubsDefa = frm.SubsDefa.value;
//	var ErrorMsg1 = "Please fill e-mail";
//	if (frm.ErrorMsg1) ErrorMsg1 = frm.ErrorMsg1.value;
//	var ErrorMsg2 = "Please enter valid e-mail";
//	if (frm.ErrorMsg2) ErrorMsg2 = frm.ErrorMsg2.value;
	var iEmail = frm.txtEmail.value.Trim();
//	if (iEmail == SubsDefa) iEmail = "";
	document.getElementById("dtfHomeErrorMsg1").style.cssText = "display:none";
	document.getElementById("dtfHomeErrorMsg2").style.cssText = "display:none";
	if ((iEmail == "") || (iEmail == SubsDefa)){
		if (iEmail=="") frm.txtEmail.value = SubsDefa;
		frm.txtEmail.focus();
		document.getElementById("dtfHomeErrorMsg1").style.cssText = "display:block";
	}else{
		if (isEmail(iEmail)){
			frm.submit();
		}else{
			document.getElementById("dtfHomeErrorMsg2").style.cssText = "display:block";
			//frm.txtEmail.style.cssText = "color:#f00; border:solid 1px #f00;";
			frm.txtEmail.focus();
			frm.txtEmail.select();
			//alert(ErrorMsg2);
		}
	}
}

function FocusSubscribe(){
	var frm = document.frmSuscribe;
	if (frm.SubsDefa.value == frm.txtEmail.value) frm.txtEmail.value=""
}


/*##############*/
/*## validate ##*/

function GoValidateAccount(){
	frm = document.frmValidateAccount;
	var txtEmail = frm.txtEmail.value.Trim();
	var txtPwd = frm.txtPwd.value.Trim();
	var xObj = "";
	if (txtEmail == ""){
		if (xObj == "") xObj = "txtEmail";
		frm.txtEmail.style.cssText = "border:2px solid #f00;";
		frm.txtEmail.focus();
	}else{
		frm.txtEmail.style.cssText = "border:2px solid #445979;";
	}
	if (txtPwd == ""){
		if (xObj == "") xObj = "txtPwd";
		frm.txtPwd.style.cssText = "border:2px solid #f00;";
		frm.txtEmail.focus();
	}else{
		frm.txtPwd.style.cssText = "border:2px solid #445979;";
	}
	if (xObj == ""){
		frm.tg.value = "VALIDATEACCOUNT";
		frm.submit();
	}else{
		eval("document.frmValidateAccount." +xObj+ ".focus()");
	}
}

function ReSendValidateCode(){
	var iCode = document.frmValidateAccount.uid.value;
	window.open("/Include/ResendValidation.asp?UID=" + iCode, "RESEND","menubar=0,resizable=0,scroll=0,top=180,left=300,width=450,height=150");
}



/*##############*/
/*## login #####*/

function Login(frm){
	var sw = true;
	var xObj = "";
	frm.txtUser.style.cssText = "border:solid 2px #101410;";
	document.getElementById("divMsgAccEmailR").style.display = "none";
	frm.txtPassword.style.cssText = "color:#42496b; border:solid 2px #101410;";
	document.getElementById("divMsgAccPasswordR").style.display = "none";
	if (frm.txtUser.value.Trim() == ""){
		sw = false;
		frm.txtUser.style.cssText = "border:solid 2px #f00;";
		document.getElementById("divMsgAccEmailR").style.display = "";
		if (xObj == "") xObj = "txtUser";
	}
	if (frm.txtPassword.value.Trim() == ""){
		sw = false;
		frm.txtPassword.style.cssText = "border:solid 2px #f00;";
		document.getElementById("divMsgAccPasswordR").style.display = "";
		if (xObj == "") xObj = "txtPassword";
	}
	if (sw){
		frm.submit();
	}else{
		if (xObj != ""){
			eval("frm." + xObj + ".focus()");
		}
	}
/*	
	
	document.getElementById("tdAccEmail").style.border = "";
	document.getElementById("divMsgAccEmailR").style.display = "none";
	document.getElementById("tdAccPwd").style.border = "";
	document.getElementById("divMsgAccPasswordR").style.display = "none";
//	if (!isEmail(frm.txtUser.value)){
	if (frm.txtUser.value.Trim() == ""){
		sw = false;
//		document.getElementById("tdAccEmail").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccEmailR").style.display = "";
	}
	if (frm.txtPassword.value.Trim() == ""){
		sw = false;
//		document.getElementById("tdAccPwd").style.border = "solid 2px #ff0000";
		document.getElementById("divMsgAccPasswordR").style.display = "";
	}
	if (sw){
		frm.submit();
	}*/
}

function ReSendPwd(){
	window.open("/Include/ResendPassword.asp", "RESEND","menubar=0,resizable=0,scroll=0,top=180,left=300,width=450,height=150");
}

/*##############*/

/* ##### End Newsletters ########################################################## */
/* ################################################################################ */


/* ################################################################################ */
/* ################################################################################ */
/* ##### Begin Languages ########################################################## */
function getCookie(name)
{
  var cookie, offset, end;
  cookie  = " "+document.cookie;
  offset  = cookie.indexOf(" "+name+"=");
  if (offset == -1) return undefined;
  offset += name.length+2;
  end     = cookie.indexOf(";", offset)
  if (end    == -1) end = cookie.length;
  return unescape(cookie.substring(offset, end));
}

function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) + 
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
//  alert(domain);
}

function SetLangIE(laCode){
	var ckName = "dtfLangDisplay";
	var ckExp = null;
	var ckPath = null;
	var ckDomain = null;
//	var ckDomain = "dotfront.com";
	var ckSecure = null;
	setCookie(ckName, laCode, ckExp, ckPath, ckDomain, ckSecure);
//	urlp=history.go(0);
	history.go(0);
	//document.location.href=document.referrer;
	//reload();
//	document.location.href="/Include/incSetLang.asp?urlp="+urlp+"&lacode="+laCode;
}


function SetLang(laCode){
	document.location.href="/Include/incSetLang.asp?lacode="+laCode;
}

/* ##### End Languages ############################################################ */
/* ################################################################################ */
/* ################################################################################ */













// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

