
var TimerInterval = 30;    // Seconds   provide -1 if do not want to check
var sContextProps = '';

var sCheckURL = "http://59.160.81.51/Media/dlls/TLMediaU.dll";
var sChatURL = "http://59.160.81.51/Media/visitorchat/default.asp"; 
var sTimeURL = "http://59.160.81.51/Media/visitorchat/TimeCal.asp";
var sTrackURL = "http://59.160.81.51/Webtrak" ;


DBSvr = "http://59.160.81.51/" ;
DBName = "tlwebtrak" ;

if ( top.frames.length == 0 || top.frames[0].name  != "CustPage" ) 
{	
	StartChecking();
	if ( TimerInterval != -1 ) { 
		vIntervalIDExists = false;
		IntervalID = window.setInterval("CheckOnTime()", TimerInterval*1000);
	}	
}

function Is() {
   	var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.version=parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns4 = (this.ns && (this.major >= 4));
    this.ns47 = (this.ns && (this.version == 4.7));
    this.ns61=(this.ns && (agent.indexOf("netscape6/6.1") != -1));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie4  = (this.ie && (this.major = 4));
	this.ie5 = (this.ie && (agent.indexOf("msie 5.") != -1));
	this.ie6= (this.ie && (agent.indexOf("msie 6.") != -1));
	this.windows = (agent.indexOf("win") != -1);
	this.AOL=(agent.indexOf("aol") != -1);
	this.mac = (agent.indexOf("mac") != -1);
	this.winXP=(agent.indexOf("XP") != -1);
}

function openDoesNotSupport()
{
	//for browser not belonging to these categories
	var centerWidth  = (screen.width/2)-(400/2);
	var centerHeight = (screen.height/2)-(300/2);
		
	var openNoPage = window.open('/talisma/html/DoesnotSupport.htm','NoSupport','width=400,height=300,top='+centerHeight+',left='+centerWidth+',directories=no,location=no,menubar=no,resizable,status=no,toolbar=no,history=no,scrollbars');
	openNoPage.focus();
}

var is = new Is();

function CheckBrowser()
{
	if(is.AOL)
	{
		openDoesNotSupport();	
        return ;
	}
		
	if(is.windows) //check for windows 95 , 98 and NT
	{
 		if(!is.winXP)
		{
			if(is.ie5||is.ie6||is.ns47||is.ns61)
				return StartChatSession("false");
		 	else 
			{
				openDoesNotSupport();	
		        return ;
			}
		}
		else
		{
			if(is.ie6)
				return StartChatSession("false");
    		else
    		{
	 			openDoesNotSupport();	
        		return ;
    		}
 		}
 	}
 	else
	{
  		if(is.mac)
 		{
			if(is.ns47||is.ns61)
				return StartChatSession("false");
		 	else
			{
				openDoesNotSupport();	
		        return ;
		 	}
		}	
	  	else //if OS is neither mac nor Win then chat will not be initiated.
	 	{
			openDoesNotSupport();	
        	return ;
	    }
	}
}

