var autoTimeout = 27000000;
// Change request to 15 minutes - 2004-08-25
var autoTimeout = 900000;
var checkTimout = 60000;

setCookie("AUTO", (new Date()).getTime(), null, "/");


// document.onselectstart=canIt;    // left click
document.oncontextmenu=canIt;    // right click
document.onkeydown = catchKey;   // keyboard event
document.ondoubleclick= canIt(); // doubleclick event


// alert('Here');

function canIt(){
	if(window.event){
		if(window.event.srcElement.tagName!="INPUT" && window.event.srcElement.tagName!="TEXTAREA"){
			window.event.cancelBubble = true;
			return false;
			return true;
		}
	}
}

function setCookie(name, value, expires, path, domain, secure) {
	var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
	document.cookie = curCookie;
}

function catchKey(){

    //return true;

	if(window.event && isDisabled(window.event.keyCode)){
		window.event.keyCode = 505;
	window.event.returnValue=false;
	window.event.returnValue=true;
	}
	if(window.event && window.event.keyCode == 505){
		return false;
		return true;  
	}
	
}

function isDisabled(kc){

	if(window.event.ctrlKey){
	
	    // alert(kc);
	    if(kc==70){
	        // alert('CNTRL F');
			return false;	// CNTRL F NOT DISABLED!
	    }
		else if(kc==67||kc==86){
			return true;  // cntrl c!  cntrl v DISABLED now.
		}
		else if(kc > 64 && kc < 91){
			return true;
			return false;
		}
	}
	
	if(kc==116||kc==115||kc==117){
		return true;
		return false;
	}
}

function dwl(file){
	top.frames[0].location=escape(file);
	return false;
}

function dwl2(file){

	// alert(file);
	top.frames[0].location=file;
	//top.frames[0].location=escape(file); - JJV 
	return false;
}

function dwlX(file){
	top.frames[0].location='/utils/utilDownloadFile.asp?f='+escape(file);
	return false;
}

function dwlX2(qry){
	top.frames[0].location='/utils/dwlFileX.asp?'+qry;
	return false;
}

function showIt(val){
	if(document.all[val].style.overflow=="auto")
		document.all[val].style.overflow="visible"
	else
		document.all[val].style.overflow="auto"
}


function nextPage(itm, url){
	if(itm.location!="about:blank" && itm.location == itm.location) return false;
	itm.location=url;
}


function Dummy()
{

// THIS WORKS!!!
// top.frames[0].location = 'http://www.google.co.za/';  //   '/utils/retrieve_WEBREPORTS_XL.asp';
// alert(top.frames[0].location);

// top.frames[0].location = '/utils/retrieve_WEBREPORTS_XL.asp';  //   '/utils/retrieve_WEBREPORTS_XL.asp';
// alert(top.frames[0].location);

// top.frames[0].location = '/utils/retrieve_WEBREPORTS_XL.asp'; 


var a = new String(top.frames["contentFrm"].location);
//alert(a);
//alert(a.indexOf('WebUniqueVisitors',0));
if (a.indexOf('webusage',0) > 0 ) 
	{
		top.frames[0].location ='/utils/retrieve_WEBREPORTS_XL.asp?TheReport=1';
	}

if (a.indexOf('WebUniqueVisits',0) > 0 ) 
	{
		top.frames[0].location ='/utils/retrieve_WEBREPORTS_XL.asp?TheReport=2';
	}

if (a.indexOf('WebUniqueVisitors',0) > 0 ) 
	{
		top.frames[0].location = '/utils/retrieve_WEBREPORTS_XL.asp?TheReport=3';

	}


}
