var glbCookieString,glbIpNum,glbPresentReferer,glbVisitCount,glbTheProperty,glbTheValue,glbIsRefered,glbIsAssociate,glbPageRequest,glbLanguage
 var con_EXPDATE,glbCookieString
 glbCookieString //="friendPID=1234&VisitCount=17&PresentReferel=my home Town&lastReferel=Mr Migu&IP=1234567&IPhost=Netscape"
 con_EXPDATE = 365;
 var friendPID,VisitCount,PresentReferel,lastReferel,IP,IPhost
 var val_friendPID,val_VisitCount,val_PresentReferel,val_lastReferel,val_IP,val_IPhost
	friendPID  		= "friendPID" 
	VisitCount 		= "VisitCount"
	PresentReferel  = "PresentReferel"
	lastReferel		= "lastReferel"
	IPhost			= "IPhost"
function setVars(){
	var temp, arrTemp
	temp = location.search
	if(temp.indexOf(friendPID)!=-1){
		arrTemp = temp.split("=")
		temp = arrTemp[1]
	}
	else if(arrAssociate[friendPID] == "noFriendPid") {
		temp="noFriendPid"
	}
	else{
		temp=arrAssociate[friendPID]
	}
	val_friendPID 		= temp
	val_VisitCount 		= "1"
	val_PresentReferel 	= escape(document.referrer)
	val_lastReferel 	= escape(document.referrer)
	val_IPhost 			= escape(location.hostname)
	glbCookieString = friendPID +"="+ val_friendPID +"&"+ VisitCount +"="+ val_VisitCount +"&"+ PresentReferel +"="+ val_PresentReferel +"&"+ lastReferel +"="+ val_lastReferel +"&"+ IPhost +"="+ val_IPhost
}
function setVars2(){
	var temp, arrTemp
	temp = location.search
	if(temp.indexOf(friendPID)!=-1){
		arrTemp = temp.split("=")
		temp = arrTemp[1]
	}
	else{
		temp="noFriendPid"	
	}
	var lastCount = parseInt(arrAssociate[VisitCount])
	val_friendPID 		= temp
	val_VisitCount 		= lastCount + 1
	val_PresentReferel 	= escape(document.referrer)
	val_lastReferel 	= arrAssociate[lastReferel]
	val_IPhost 			= escape(location.hostname)
	glbCookieString = friendPID +"="+ val_friendPID +"&"+ VisitCount +"="+ val_VisitCount +"&"+ PresentReferel +"="+ val_PresentReferel +"&"+ lastReferel +"="+ val_lastReferel +"&"+ IPhost +"="+ val_IPhost
}
 var valFriendPID,valVisitCount,valPresentReferel,vallastReferel,valIP,valIPhost
 var arrAssociate = new Array();
 var NameOfCookie = "TavTeken"
 var startCookie,firstChar, lastChar, temp, arrTemp
 var theEntireCookie = document.cookie
function readCookie(NameOf){
		if ( theEntireCookie.indexOf(NameOfCookie+'=') == -1){ 
		return 0;
		}
		temp = unescape(theEntireCookie);
		firstChar = temp.indexOf(NameOfCookie);
		lastChar = temp.indexOf(';',firstChar);
		lastChar =(-1) ? temp.length : lastChar
		temp =  temp.substring(firstChar+NameOfCookie.length+1,lastChar );	
		var brokenCookie = temp.split('&');
		var arrTemp, str
		for( var i = 0; i<brokenCookie.length; i++ ){
			arrTemp = brokenCookie[i].split("=")
			str = arrTemp[0]
			arrAssociate[ str ] = arrTemp[1]			
		}
}
function makeCookie(cookieName) {
		var datenow = new Date();
		var finishedCookie, expdate
		expdate = datenow.setTime(datenow.getTime() + (1 * 24 * 60 * 60 * 1000 * con_EXPDATE) );
		expdate=datenow.toGMTString();
		expdate = ';expires='+ expdate 
		var finishedCookie = cookieName + '=' + escape(glbCookieString) + expdate + ':';
		document.cookie = finishedCookie;
	}