function getPlatformDestination(sKey){
	var sKeyDestination = sKey.substring(0,2);
	var sSrvName='INQDE01';
	var sServerIdentifier="";
	if (sSrvName!="") { 
		if (sSrvName.substring(0,3).toUpperCase()=="INQ"){
			sServerIdentifier=sSrvName.substring(3,5).toUpperCase();
			switch(sServerIdentifier) {
			case "JP": sServerIdentifier="99"; break;
			case "CO": sServerIdentifier="34"; break;
			case "DE": sServerIdentifier="45"; break;
			case "MA": sServerIdentifier="88"; break;
			}
		} else {
			sServerIdentifier=sSrvName.substring(0,2).toUpperCase();
			if (sServerIdentifier=="US") sServerIdentifier="59";
			if (sServerIdentifier=="TE") sServerIdentifier="TE";
			if (sServerIdentifier=="SA") sServerIdentifier="SA";
			if (sServerIdentifier=="DE") sServerIdentifier="DE";
			if (sServerIdentifier=="TS") sServerIdentifier="TS";
			
		}
	}
 
	var sCondition = "INQ"+sKeyDestination;
	switch(sKeyDestination){
		case "59":  sCondition="USA";  break;
		case "45":  sCondition="INQDE";break;
		case "34":  sCondition="INQCO";break;
		case "99":  sCondition="INQJP";break;
		case "88":  sCondition="INQMA";break;
		case "TE":  sCondition="TESTING";break;
		case "SA":  sCondition="SANDBOX";break;
		case "DE":  sCondition="DEVELOP";break;
		case "TS":  sCondition="TSTINTERNO";break;
	}
	var aServerList= new Array();
	    aServerList[0]='INQCOLT|www.ntrsupport.com';
        aServerList[1]='USA01|na.ntrsupport.com';
        aServerList[2]='INQJP01|jp.ntrsupport.com';
        aServerList[3]='INQMAD01|eu02.ntrsupport.com';
        aServerList[4]='INQNA3|www.trimbleassistant.com';
        aServerList[5]='INQCN01|cn01.ntrsupport.cn';
        aServerList[6]='INQMX01|200.38.89.23';
     
    //buscamos en el array
    var sUrl='eu.ntrsupport.com'
    for(i=0;i<7;i++){
	    if(aServerList[i].indexOf(sCondition)>-1) break;
	}
 
	if (i<7) return aServerList[i].split("|")[1];
	else return sUrl;
 
}
 
 
 
function check(from)
{   
	if(document.gensession.code.value!='')		
	{	    
		if(document.gensession.typesession[0].checked)		
		{
			//window.open("../inquiero/Interfaces/Web/Customer/newsession.asp?redir=0&owner=&lang=it&exe=0&code=" + document.gensession.code.value + "&auto=1&action=SHOW&sa=1&open=1");
			var sPlatform = getPlatformDestination(document.gensession.code.value)			
			window.open("http://"+sPlatform+"/inquiero/Interfaces/Web/Customer/newsession.asp?redir=0&owner=&lang=it&exe=0&code=" + document.gensession.code.value + "&auto=1&action=SHOW&sa=1&open=1","anonymous","toolbar=0,location=0,statusbar=0,menubar=0,scrollbars=0,resizable=NO,width=476,height=380,top=150,left=200");					
 	        if(from==1) return false;			
		}else{
			document.gensession.submit();
		}			
	}else
	{
	    if(from==1) return false;
	}
}

