StartupParameters.CLIENT_MIN_SUPPORTED = 3.6; 
StartupParameters.CLIENT_MIN_LAUNCHER = 3.7;
StartupParameters.CLIENT_MIN_SG_VERSION = 3.7;
StartupParameters.CLIENT_MIN_MSVISTA_VERSION = 3.9;
StartupParameters.CLIENT_MIN_MSVISTA_BUILD = 200;

function StartupParameters() {	
	this.autoStart = false;
	this.bypassMode = 0;
	this.debugLevel = 0;
	this.anetQuery = "";
	this.signCode = "";
	this.dutyCode = "";
	this.password = "";
	this.atid     = "";
	this.officeId = "";
	this.cid = '';
	this.ccTransport;
	this.ccIP;
	this.certificateSite;
	this.multiMediaSite;
	this.caller = "";
	this.develPath = "";
	this.cruisePath = "";
	this.clientRelease = "";
	this.clientVersion = "";
	this.clientBuild = "";
	this.auRelease  = "";
	this.auVersion = "";
	this.auBuild = "";
	this.cruiseInstalled = false;
	this.sgCompatible = false;
	this.helpSite = "";
	this.vistaSite = "";
	this.ferrySite = "";

	this.isInstalled = function () {return(this.cruiseInstalled);}
	this.getVersionString = function () {return this.clientRelease;}
	this.getVersionNr = function () {this.clientVersion;}
	this.isSGCompatible = function() {return this.sgCompatible;}
	
	this.isMSVista = function() {	return (navigator.userAgent.indexOf("Windows NT 6.0")!=-1)}
	
	this.isXPSP2 = function () {return (this.isXP() && ((window.navigator.userAgent.indexOf("SV1") != -1) || this.isIE7()));}
	this.isXP = function () {return (navigator.userAgent.indexOf("Windows NT 5.1")!=-1);}
	this.is2003 = function () {return (navigator.userAgent.indexOf("Windows NT 5.2")!=-1);}
	this.isIE7 = function () {return (navigator.userAgent.indexOf("MSIE 7")!=-1);}
	this.isIE8 = function () {return (navigator.userAgent.indexOf("MSIE 8")!=-1);}
	this.isValidVersion = function () {return (this.clientVersion >= StartupParameters.CLIENT_MIN_SUPPORTED)}
	this.useLauncher = function () {return (this.clientVersion >= StartupParameters.CLIENT_MIN_LAUNCHER && (this.isXP() || this.is2003() || this.isIE7() || this.isIE8()))}
	this.useSameWindow = function () {return (this.autoStart && this.bypassMode!="2");}
	this.isAutoStart = function() {return this.autoStart;}
	this.isAutoClose = function() {return (this.autoStart && this.bypassMode=="2");}
	
	this.isLessThan39p200 = function () {	
	if (this.clientVersion<StartupParameters.CLIENT_MIN_MSVISTA_VERSION) return true;
	if ((this.clientVersion==StartupParameters.CLIENT_MIN_MSVISTA_VERSION) && (this.clientBuild<StartupParameters.CLIENT_MIN_MSVISTA_BUILD)) return true;
	return false;
	}
	
	this.isValidAUVersion = function () {
		var result = ( (! this.useLauncher()) ||
    					(this.auVersion > 2.4) ||
    					(this.auVersion == 2.4 && this.auBuild >= 200));
		return result;
	}
	
	
	this.getCruisePath = function() {
		var result = (this.develPath != "") ? this.develPath : this.cruisePath;
		result = "file:///" + result + "/UI/cruise.htm?"
			+ "+ATID="		+ this.atid.toUpperCase()
			+ "+OFFICE="	+ this.officeId.toUpperCase()
			+ "+CID="		+ this.cid
			+ "+IP="		+ this.ccIP
			+ "+TTYPE="		+ this.ccTransport
			+ "+SIGN="		+ this.signCode.toUpperCase()
			+ "+DUTY="		+ this.dutyCode.toUpperCase()
			+ "+PASSWORD="	+ this.password
			+ "+HOSTNAME="	+ window.parent.location.hostname
			+ "+HELPSITE="	+ this.helpSite
			+ "+MULTIMEDIASITE=" + this.multiMediaSite
			+ "+LANG=" + langManager.siteLanguage
			+ "+DBG_LVL=" + this.debugLevel
			+ this.anetQuery
		return result;
	}

	
	this.getClientWinParams = function() {
		var w = (screen.availWidth<800)? screen.availWidth : 800;
		var h = (screen.availHeight<600)? screen.availHeight : 600;
		var t = ((screen.availHeight - h) / 2);
		var l = ((screen.availWidth - w) / 2);
		var result = 'resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ (w-9) +',height=' + (h-27) + ',top='+t+'px,left='+l+'px';
		return result;
	}	
	
		
	this.getCertificateSite = function() {
		var result = this.certificateSite // + "?LANGUAGE=" + langManager.languageISO;
		return result;
	}
	

}
