NS6 = ((document.getElementById) && (!document.all));
NS = (document.layers);

var webWindowWin = null;
var ConfWin = null;
var wapWindow = null;
var iTvWindow = null;
var PDAWindow = null;
var j2meWindow = null;

function WapOpen()
{
	var widthNum = 271;
	var heightNum = 540;

	var topNum = parseInt((screen.height - heightNum)/2);
	var leftNum = parseInt((screen.width - widthNum)/2);

	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;

	var urlWapMessager = "InTouch/WAP.html";
	var neWindowName = "WapMessager";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",scrollbars=no";
	wapWindow = window.open(urlWapMessager , neWindowName , args);
	wapWindow.focus();
}

function VoiceConferencing(type)
{
	if ((NS6) || (NS))
	{
		var temp1 = eval(screen.height);
		var temp2 = eval(screen.width);
		var heightNum = parseInt(temp1 - 200);
		var widthNum = parseInt(temp2 - 50);
		var topNum = parseInt((temp1 - heightNum)/2-100);
		var leftNum = parseInt((temp2 - widthNum)/2);
	}
	else
	{
		var heightNum = parseInt(screen.height - 55);
		var widthNum = parseInt(screen.width - 20);
		var topNum = parseInt((screen.height - heightNum)/2-15);
		var leftNum = parseInt((screen.width - widthNum)/2);
	}

	heightNum = (heightNum <= 5)? 5:heightNum;
	widthNum = (widthNum <= 5)? 5:widthNum;
	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;

	var urlWebMessager = "http://195.189.192.40/confclient/";
	if(type == "NA")	
		urlWebMessager = " http://sjdemo.cti2.com/confClient/";
	
	var neWindowName = "VoiceConferencing1";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",resizable,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes";
	ConfWin = window.open(urlWebMessager,neWindowName,args);
	ConfWin.focus();
}

function WebMail(type)
{
	if ((NS6) || (NS))
	{
		var temp1 = eval(screen.height);
		var temp2 = eval(screen.width);
		var heightNum = parseInt(temp1 - 200);
		var widthNum = parseInt(temp2 - 50);
		var topNum = parseInt((temp1 - heightNum)/2-100);
		var leftNum = parseInt((temp2 - widthNum)/2);
	}
	else
	{
		var heightNum = parseInt(screen.height - 45);
		var widthNum = parseInt(screen.width - 20);
		var topNum = parseInt((screen.height - heightNum)/2-15);
		var leftNum = parseInt((screen.width - widthNum)/2);
	}

	heightNum = (heightNum <= 5)? 5:heightNum;
	widthNum = (widthNum <= 5)? 5:widthNum;
	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;
	
	var urlWebMessager = "http://195.189.192.40/sensesStatic/Login/Login.html";
	
	if(type == "NA")	
		urlWebMessager = "http://sjdemo.cti2.com/sensesStatic/Login/Login.html";
			
	//var urlWebMessager = "http://195.189.192.40/construction/construction.html";
	var neWindowName = "WebMessager1";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",resizable,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes";
	webWindowWin = window.open(urlWebMessager,neWindowName,args);
	webWindowWin.focus();
}

function AAOpen(type)
{
	var heightNum = parseInt(screen.height - 55);
	var widthNum = parseInt(screen.width - 20);
	var topNum = parseInt((screen.height - heightNum)/2-15);
	var leftNum = parseInt((screen.width - widthNum)/2);

	heightNum = (heightNum <= 5)? 5:heightNum;
	widthNum = (widthNum <= 5)? 5:widthNum;
	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;
	
	var urlWebMessager = "http://195.189.192.40/autoAttClient/";
	
	if(type == "NA")	
		urlWebMessager = "http://sjdemo.cti2.com/autoAttClient/";

	var neWindowName = "WebMessager1";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",resizable,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes";
	webWindowWin = window.open(urlWebMessager,neWindowName,args);
	webWindowWin.focus();
}

function RYCOpen(type)
{
	var heightNum = parseInt(screen.height - 55);
	var widthNum = parseInt(screen.width - 20);
	var topNum = parseInt((screen.height - heightNum)/2-15);
	var leftNum = parseInt((screen.width - widthNum)/2);

	heightNum = (heightNum <= 5)? 5:heightNum;
	widthNum = (widthNum <= 5)? 5:widthNum;
	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;
	
	var urlWebMessager = "http://195.189.192.40/rycClient/";
	
	if(type == "NA")	
		urlWebMessager = "http://sjdemo.cti2.com/rycClient/";

	var neWindowName = "WebMessager1";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",resizable,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes";
	webWindowWin = window.open(urlWebMessager,neWindowName,args);
	webWindowWin.focus();
}


function iTVOpen()
{
	var widthNum = 350;
	var heightNum = 310;

	var topNum = parseInt((screen.height - heightNum)/2);
	var leftNum = parseInt((screen.width - widthNum)/2);

	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;

	var urlItvMessager = "InTouch/iTv.html";
	var neWindowName = "iTv";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",scrollbars=no";
	iTvWindow = window.open(urlItvMessager , neWindowName , args);
	iTvWindow.focus();
}

function PDAOpen()
{
	var widthNum = 300;
	var heightNum = 260;

	var topNum = parseInt((screen.height - heightNum)/2);
	var leftNum = parseInt((screen.width - widthNum)/2);

	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;

	var urlWebMessager = "InTouch/PDAWindow.html";
	var neWindowName = "PDA";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",scrollbars=no";
	PDAWindow = window.open(urlWebMessager , neWindowName , args);
	PDAWindow.focus();
}

function j2meOpen()
{
	var widthNum = 470;
	var heightNum = 460;

	var topNum = parseInt((screen.height - heightNum)/2);
	var leftNum = parseInt((screen.width - widthNum)/2);

	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;

	var urlWebMessager = "InTouch/j2me.html";
	var neWindowName = "j2me";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",scrollbars=no";
	j2meWindow = window.open(urlWebMessager , neWindowName , args);
	j2meWindow.focus();
}


function MClientOpen(type)
{
	var widthNum = 470;
	var heightNum = 460;

	var topNum = parseInt((screen.height - heightNum)/2);
	var leftNum = parseInt((screen.width - widthNum)/2);

	topNum = (topNum <= 5)? 5:topNum;
	leftNum = (leftNum <= 5)? 5:leftNum;

	var urlWebMessager = "InTouch/mclient.html";
	
	if(type == "NA")
		urlWebMessager = "InTouch/NA_mclient.html";
	
	var neWindowName = "mclient";
	var args = "height=" + heightNum + ",width=" + widthNum + ",top=" + topNum + ",left=" + leftNum + ",scrollbars=no";
	j2meWindow = window.open(urlWebMessager , neWindowName , args);
	j2meWindow.focus();
}

function downloading()
{
	document.location.href = "http://195.189.192.40/Indicator/TrayIndicator.zip";
}

function download()
{
	self.location.href = "Download.html";
}

function downloadFile()
{
	self.location.href = "DownloadFile.html";
}
