/**********************************************************
 * External window                                        *
 **********************************************************/

function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;


/**********************************************************
 * Validate contact forms                                 *
 **********************************************************/
 
function validateString(field, msg, min, max) {
  if (!min) { min = 1 }
  if (!max) { max = 65535 }
  if (!field.value || field.value.length < min || field.value.max > max) {
    alert(msg);
    field.focus();
    field.select();
    return false;
  }
  return true;
}

function validateEmail(email, msg, optional) {
  if (!email.value && optional) {
    return true;
  }
  var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
  if (!re_mail.test(email.value)) {
    alert(msg);
    email.focus();
    email.select();
    return false;
  }
  return true;
}

function validateEmailsSame(emaila, emailb, msg) {
if (emaila.value!=emailb.value) {
 alert(msg);
 emailb.focus();
 emailb.select();
 return false;
} 
  return true;
}


function gotoIndustry(){
  var s = document.getElementById('industrylist');
	if(s[s.selectedIndex].value != 'none') window.location = s[s.selectedIndex].value;
}

function gotoMarket(){
  var s = document.getElementById('marketlist');
	if(s[s.selectedIndex].value != 'none') window.location = s[s.selectedIndex].value;
}

function gotoDesignation(){
  var s = document.getElementById('designationlist');
	if(s[s.selectedIndex].value != 'none') window.location = s[s.selectedIndex].value;
}










