function getAppVersion() 
{
	appname= navigator.appName;
	appversion = navigator.appVersion;
	majorver = appversion.substring(0, 1); 
	if ((appname == "Netscape" || appname == "Microsoft Internet Explorer") && ( majorver >= 3 )) 
		return 1;
	
	if ((appname == "Microsoft Internet Explorer") && (majorver >= 4)) 
		return 1;
		return 0;
}
function swtch(num, imgname) 
{
	if (getAppVersion()) 
	{
		imgname.src = img[num].src;
	}
}
imgsrc = new Array();
imgsrc[0] = "/gfx/nav/home.gif";
imgsrc[1] = "/gfx/nav/home_on.gif";
imgsrc[2] = "/gfx/nav/aboutNCO.gif";
imgsrc[3] = "/gfx/nav/aboutNCO_on.gif";
imgsrc[4] = "/gfx/nav/services.gif";
imgsrc[5] = "/gfx/nav/services_on.gif";
imgsrc[6] = "/gfx/nav/industries.gif";
imgsrc[7] = "/gfx/nav/industries_on.gif";
imgsrc[8] = "/gfx/nav/alliances.gif";
imgsrc[9] = "/gfx/nav/alliances_on.gif";
imgsrc[10] = "/gfx/nav/news.gif";
imgsrc[11] = "/gfx/nav/news_on.gif";
imgsrc[12] = "/gfx/nav/investors.gif";
imgsrc[13] = "/gfx/nav/investors_on.gif";
imgsrc[14] = "/gfx/nav/careers.gif";
imgsrc[15] = "/gfx/nav/careers_on.gif";
imgsrc[16] = "/gfx/nav/clientLogin.gif";
imgsrc[17] = "/gfx/nav/clientLogin_on.gif";
imgsrc[18] = "/gfx/nav/contactNCO.gif";
imgsrc[19] = "/gfx/nav/contactNCO_on.gif";
if (getAppVersion()) 
{
	img = new Array();
	for (i = 0; i < imgsrc.length; i++) 
	{
		img[i] = new Image();
		img[i].src = imgsrc[i];
	}
}

/*****************************************************/
/*Function below is to set focus for input fields*/
function setFocus(controlId)
{
	var objInputControl = document.getElementById(controlId);
	if (objInputControl!=null)
		objInputControl.focus();
}
/*****************************************************/

/*****************************************************/
/*Below function is to trim any provided string, 
Usage Example: stringVariable.Trim(); */
String.prototype.Trim = function () 
{
	return this.replace(/^\s*/, "").replace(/\s*$/, "");
}
/*****************************************************/

/*****************************************************/
/*Function below is to open specified URL in new window
url: URL of web page to open
windowName: Name to assign to a new window, this works only in case when url is opend in new window
urlOpenOption: URL to open in, possible options are 0(same window), 1(same window)
*/
function OpenUrl(url, windowName, urlOpenOption)
{

	if (url != null)
	{
		if (url.Trim() != "")
		{
			var objNewWindow;
			var intWidth;
            var intHeight;
			if (urlOpenOption == 1)//in new window
			{
				intWidth = screen.availWidth*97/100;//97%
                intHeight = screen.availHeight*77/100;//77%
				objNewWindow = window.open(url.Trim(),'Name_'+windowName,'toolbar=1,location=1,status=1,menubar=1,scrollbars=1,resizable=1,width='+intWidth+',height='+intHeight+'');
				objNewWindow.focus();
			}
			else if (urlOpenOption == 0)//in same window
				location.replace(url);
			else if (urlOpenOption == 2)//in new window but without menubar,toolbar and addressbar
			{
				intWidth = screen.availWidth*97/100;//97%
                intHeight = screen.availHeight*77/100;//77%
				objNewWindow = window.open(url.Trim(),'Name_'+windowName,'toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+intWidth+',height='+intHeight+'');
				objNewWindow.focus();
			}
			else if (urlOpenOption == 3)
			{
				intWidth = screen.availWidth*97/100;//97%
                intHeight = screen.availHeight*85/100;//85%
				objNewWindow = window.open(url.Trim(),'Name_'+windowName,'left=0,top=0,toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+intWidth+',height='+intHeight+'');
				objNewWindow.focus();
			}

		}//end of if (url.Trim() != "")
	}//end of if (url != null)
}
/*****************************************************/