function openLink()
 {
  if(form.link.value==1)window.open("http://primary.ullink.net:8080");
  if(form.link.value==2)window.open("http://uat.ullink.net:8080");
  if(form.link.value==3)window.open("http://uat.ullink.net:18093");
  if(form.link.value==4)window.open("http://uat.ullink.net:18092");    
  if(form.link.value==5)window.open("http://primary.ullink.net:18090");    
  if(form.link.value==6)window.open("http://primary.ullink.net:18092");        
  if(form.link.value==7)window.open("http://amazone:8080/nagios/cgi-bin/status.cgi?host=all");  
  if(form.link.value==8)window.open("http://dr-primary.ullink.net:8080");  
  if(form.link.value==9)window.open("http://us-primary.ullink.net:8080");
  if(form.link.value==10)window.open("http://us-uat.ullink.net:8080");
  if(form.link.value==11)window.open("http://us-uat.ullink.net:18090");
  if(form.link.value==12)window.open("http://us-primary.ullink.net:18090");
 }
 
  function openLinkGold()
 {
  if(formGold.link.value==1)window.open("http://ullink-fix-primary:8080");
  if(formGold.link.value==2)window.open("http://10.33.3.103:8080");
  if(formGold.link.value==3)window.open("http://192.168.15.11:9090/Remote/welcome.do");
  if(formGold.link.value==4)window.open("http://jefferies.uk.primary:8080/Remote/welcome.do");
  if(formGold.link.value==5)window.open("http://192.168.16.10:8080");
 }

 
function isInteger(elem)
{ var chaine = elem.value;
  var a="";
  var err=false;
  var point=false;
  var i=1;
  if(chaine.length>0)
  { a = chaine.substr(0,1);
    if(isNaN(parseInt(a)) && a!="-")
    { err=true;
    }
  }
  while(!err && i<chaine.length)
  { a = chaine.substr(i,1);
    if( isNaN(parseInt(a)))
    { err=true;
    	i=chaine.length;
    }
    i++;
  }
  return !err;
}

function isFloat(elem)
{ var chaine = elem.value;
  var a="";
  var err=false;
  var point=false;
  var i=1;
  if(chaine.length>0)
  { a = chaine.substr(0,1);
    if(isNaN(parseInt(a)) && a!="-")
    { if(a!="." && a!=",")
        err=true;
      else
        point=true;
    }
  }
  while(!err && i<chaine.length)
  { a = chaine.substr(i,1);
    if( isNaN(parseInt(a)))
    { if(a=="." || a==",")
      { if(!point)
          point=true
        else
          err=true;
      }
      else
        err=true;
    }
    i++;
  }
  return !err;
}

function confirmAndRedirect(msg,link)
{ if(confirm(msg))
		moveTo(link);
}

function moveTo(link)
{ window.location.href=link;
}

function getBrowser(){
  var detect = navigator.userAgent.toLowerCase();
  if (detect.indexOf('konqueror')+1) browser = "Konqueror";
  else if (detect.indexOf('safari')+1) browser = "Safari";
  else if (detect.indexOf('opera')+1) browser = "Opera";
  else if (detect.indexOf('icab')+1) browser = "iCab";
  else if (detect.indexOf('msie')+1) browser = "Internet Explorer"; 
  else if (detect.indexOf('netscape')+1) browser = "Netscape Navigator";
  else if (detect.indexOf('mozilla')+1) browser = "Mozilla";
  else browser = "Navigateur inconnu";    
  return browser;
}

function getVersion(){
  var detect = navigator.userAgent.toLowerCase();
  if (detect.indexOf('konqueror')+1) version = detect.charAt(detect.indexOf('konqueror') +1 + 'konqueror'.length);
  else if (detect.indexOf('safari')+1) version = detect.charAt(detect.indexOf('safari') +1 + 'safari'.length);
  else if (detect.indexOf('opera')+1) version = detect.charAt(detect.indexOf('opera') +1 + 'opera'.length);
  else if (detect.indexOf('icab')+1) version = detect.charAt(detect.indexOf('icab') +1 + 'icab'.length);
  else if (detect.indexOf('msie')+1) version = detect.charAt(detect.indexOf('msie') +1 + 'msie'.length);
  else if (detect.indexOf('netscape')+1) version = detect.charAt(detect.indexOf('netscape') +1 + 'netscape'.length);
  else if (detect.indexOf('mozilla')+1) version = detect.charAt(detect.indexOf('mozilla') +1 + 'mozilla'.length);    
  else version = "";
  return version;
}

function browserCompatible(){  
  if((getBrowser()=="Internet Explorer" && getVersion()>=6) || (getBrowser()=="Netscape Navigator" && getVersion()>=7)){
    return true;
  }
  return false;
}