//browser detection
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck()

//cookie functions
	
function SetCookie (name, value) {
         var argv = SetCookie.arguments;
         var argc = SetCookie.arguments.length;
         var expires = (argc > 2) ? argv[2] : null;
         var path = (argc > 3) ? argv[3] : null;
         var domain = (argc > 4) ? argv[4] : null;
         var secure = (argc > 5) ? argv[5] : false;
         document.cookie = name + "=" + escape (value) +
         ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
         ((path == null) ? "" : ("; path=" + path)) +
         ((domain == null) ? "" : ("; domain=" + domain)) +
         ((secure == true) ? "; secure" : "");
}

function setC(form) {
	
   var expdate = new Date ();
   expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 31));
   SetCookie (form.name, form.value, expdate);
}


// Get Cookie Value function
function getCookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   return unescape (document.cookie.substring(offset, endstr));
}

// Get Cookie function
function GetCookie(name) {
   var arg = name+"=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg) return getCookieVal(j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
   }
   return null;
}
// end cookie functions.

function disableProt()
{
		var expdate = new Date ();
   		expdate.setTime (expdate.getTime() + (2 * 60 * 60 * 1000 * 1));
   		SetCookie ('disableprot', 'yes', expdate,'../index.html');	
}

// browser detection-redirection
unsuppMode = GetCookie('disableprot');
//if(((is.b=='ns'||is.b=='ie')||(is.v==6&&(is.b=='ns')))&& unsuppMode!='yes') document.location.href='browserdisclaimer.html';
if(is.v<4&&(is.b=='ns'||is.b=='ie')&& unsuppMode!='yes') document.location.href='browserdownload.html';
if(((is.b!='ns'&&is.b!='ie')||is.v==6&&(is.b=='ns'))&& unsuppMode!='yes') document.location.href='browserdisclaimer.html';


//popup functions

copyrightWin = null;

function copyPopIt()
	{
	if (copyrightWin&&(!copyrightWin.closed)) 
	{
	copyrightWin.close();
	}

copyrightWin = window.open('copyright.html','copyright_popup_window','width=470,resizable=yes,height=400,top=25,left=25,scrollbars=yes');
}

function changeImageGnsOut(layer,imgName,imgSrc,section)
{

	if (sectionId==section)
	{
	imgSrc=imgSrc.substr(0,(imgSrc.length-4))+'_down'+imgSrc.substr((imgSrc.length-4),(imgSrc.length-1));
	}
	if (document.images) {
		if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = "'+imgSrc+'"')
		else document.images[imgName].src = imgSrc
	}
}

function quickTourHandleClick()
{
if (!quickTourStatus) 
{
changeImage('divMaskR.document.divQuickTour', 'quickTourBar', 'images/icn_tor_quickt.jpg');
quickTourSlide.glideTo('slow','slow',0,137,10,20,'quickTourStatus = true');	
}
else if (quickTourStatus) 
{
changeImage('divMaskR.document.divQuickTour', 'quickTourBar', 'images/icn_tor_quickt.gif');
quickTourSlide.glideTo('slow','slow',0,275,10,20,'quickTourStatus = false');
}
}
prntPackPop=null;

function prntPack()
{
	if (prntPackPop&&(!prntPackPop.closed)) 
	{
	prntPackPop.close();
	}

prntPackPop = window.open('opr_printable.html','prntPack_popup_window','width=580,resizable=yes,height=500,top=25,left=25,scrollbars=yes');
}

menuPop=null;

function menuPopup()
{
	if (menuPop&&(!menuPop.closed)) 
	{
	menuPop.close();
	}

(is.ie)? menuPop = window.open('ctr_services_sample.html','menuPop_popup_window','width=377,resizable=yes,height=410,top=25,left=25,scrollbars=no'): window.open('../ctr_services_sample.html','menuPop_popup_window','width=377,resizable=yes,height=410,top=25,left=25,scrollbars=no');

}
