function doNothing() {}

function openWindow(Path,Width,Height) {
	window.open(Path,'','left=50,top=150,width='+Width+',height='+Height+',resizable=no,status=no,address=yes,scrollbars=yes');
}

function openMailForm(Address) {
	Address = Address.replace(/--zavinac--/gi,'@');
	Address = Address.replace(/--tecka--/gi,'.');
	window.open('mailto:'+Address,'','left=50,top=150,width=100,height=100,resizable=no,status=no,address=no,scrollbars=no');
}

function decodeMailAddress(address) {
	address = address.replace(/--AT--/gi,'@');
	address = address.replace(/--DOT--/gi,'.');
	window.open('mailto:'+address,'','width=10,height=10,resizable=no,status=no,address=no,scrollbars=no');
}

// open download form
function OpenDownload(FileName,CultureAlias) {
	window.open('Download.aspx?FileName='+FileName+'&CultureAlias='+CultureAlias,'','left=50,top=150,width=330,height=400,resizable=no,status=no');
}

// open subscribe form
function OpenSubscribeForm(SubscriptionTypeID,CultureAlias) {
	window.open('Subscribe.aspx?SubscriptionTypeID='+SubscriptionTypeID+'&CultureAlias='+CultureAlias,'','left=50,top=150,width=330,height=400,resizable=no,status=no');
}

// open job description
function OpenJobDescription(AliasPath,CultureAlias) {
	window.open('ViewArticle.aspx?AliasPath='+AliasPath+'&CultureAlias='+CultureAlias,'','left=50,top=150,width=400,height=600,resizable=yes,status=no,address=yes,scrollbars=yes');
}

// open job description
function OpenArticle(AliasPath,CultureAlias) {
	window.open('ViewArticle.aspx?AliasPath='+AliasPath+'&CultureAlias='+CultureAlias,'','left=50,top=150,width=400,height=600,resizable=yes,status=no,address=yes,scrollbars=yes');
}

// open application form
function OpenApplicationForm() {
	window.open('OLD/ApplicationForm.asp','','left=50,top=150,width=400,height=600,resizable=yes,status=no,address=yes,scrollbars=yes');
}

// open application form
function OpenPicture(URL) {
	window.open('ViewPicture.aspx?URL='+URL,'','left=50,top=150,width=430,height=450,resizable=yes,status=no,address=yes,scrollbars=yes');
}

//
// validate email address
//

function isEmail(elm) { 
	if (elm.value.indexOf("@") != "-1" && elm.value.indexOf(".") != "-1"){
	return true;
	}else{
	return false;
	}
}

//
// validate download form
//

function ValidateDownloadForm(){
        if (document.frm.txtFirstName.value==""){
          alert("You must enter your first name.");
          document.frm.txtFirstName.focus();
          return false;
        }
        else if (document.frm.txtLastName.value==""){
          alert("You must enter your last name.");
          document.frm.txtLastName.focus();
          return false;
        }
        else if (document.frm.txtPosition.value=="") {
          alert("You must enter your position.");
          document.frm.txtPosition.focus();
          return false;
        }
        else if (document.frm.txtCompany.value=="") {        
          alert("You must enter a company name.");
          document.frm.txtCompany.focus();        
          return false;       
        }
  		else if (document.frm.txtEmail.value=="") {
          alert("You must enter your email address.");
          document.frm.txtEmail.focus();
          return false;        
        }
		else if (isEmail(document.frm.txtEmail) == false) {
          alert("The email address you entered is invalid. Please enter a valid email address.");
          document.frm.txtEmail.focus();
          return false;		
		}
        else {
          return true;
        }        
}

//
// validate subscribe form
//

function ValidateSubscribeForm(){
        if (document.frm.txtFirstName.value==""){
          alert("You must enter your first name.");
          document.frm.txtFirstName.focus();
          return false;
        }
        else if (document.frm.txtLastName.value==""){
          alert("You must enter your last name.");
          document.frm.txtLastName.focus();
          return false;
        }
        else if (document.frm.txtPosition.value=="") {
          alert("You must enter your position.");
          document.frm.txtPosition.focus();
          return false;
        }
        else if (document.frm.txtCompany.value=="") {        
          alert("You must enter a company name.");
          document.frm.txtCompany.focus();        
          return false;       
        }
  		else if (document.frm.txtEmail.value=="") {
          alert("You must enter your email address.");
          document.frm.txtEmail.focus();
          return false;        
        }
		else if (isEmail(document.frm.txtEmail) == false) {
          alert("The email address you entered is invalid. Please enter a valid email address.");
          document.frm.txtEmail.focus();
          return false;		
		}
        else {
          return true;
        }        
}

//
// validate request form
//

function validateRequestForm(){
        if (document.bpForm.txtFirstName.value==""){
          alert("You must enter your first name.");
          document.bpForm.txtFirstName.focus();
          return false;
        }
        else if (document.bpForm.txtLastName.value==""){
          alert("You must enter your last name.");
          document.bpForm.txtLastName.focus();
          return false;
        }
        else if (document.bpForm.txtCompany.value=="") {        
          alert("You must enter a company name.");
          document.bpForm.txtCompany.focus();        
          return false;       
        }
        else if (document.bpForm.txtPosition.value=="") {
          alert("You must enter your position.");
          document.bpForm.txtPosition.focus();
          return false;
        }
  		else if (document.bpForm.txtEmail.value=="") {
          alert("You must enter your email address.");
          document.bpForm.txtEmail.focus();
          return false;        
        }
		else if (isEmail(document.bpForm.txtEmail) == false) {
          alert("The email address you entered is invalid. Please enter a valid email address.");
          document.bpForm.txtEmail.focus();
          return false;		
		}
        else if (document.bpForm.txtTelephone.value=="") {        
          alert("You must enter your telephone.");
          document.bpForm.txtTelephone.focus();        
          return false;       
        }
        else {
          return true;
        }        
}


//
// validate request MSLQS Account form
//

function validateRFMSLQSAccountForm(){
        if (document.bpForm.txtName.value==""){
          alert("You must enter your first name.");
          document.bpForm.txtName.focus();
          return false;
        }
  		else if (document.bpForm.txtEmail.value=="") {
          alert("You must enter your email address.");
          document.bpForm.txtEmail.focus();
          return false;        
        }
		else if (isEmail(document.bpForm.txtEmail) == false) {
          alert("The email address you entered is invalid. Please enter a valid email address.");
          document.bpForm.txtEmail.focus();
          return false;		
		}
        else {
          return true;
        }        
}
