function gi_setCookie(name, value, expire_days) {
	var ex_date = new Date();
	ex_date.setDate(ex_date.getDate()+expire_days);
	document.cookie = name+"="+escape(value)+
		((ex_date==null) ? "" : ";expires="+ex_date.toGMTString());
}

function gi_getCookie(name) {
	if(document.cookie.length > 0) {			
		start = document.cookie.indexOf(name+"=");
		if(start != -1) {
			start = start+(name.length+1);
			var end = document.cookie.indexOf(";", start);
			if(end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(start,end));
		}
	}
	return "";
}

$(document).ready(function() {	
	var bindBehaviors = function(scope) {		
		$('.auto-select').focus(function() {
			this.select();
		});

		if(gi_getCookie("lgs") != 1) {
			var win1 = window.open("http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=931497-0000&PA=1918065&HTML=http://www.lovegisele.com", 'p1', 'menubar=yes, toolbar=yes, scrollbars=yes, resizable=yes, width=1024, height=768, top=10, left=10');
			win1.blur();
			window.focus();			
			gi_setCookie("cwv", 1, 1);		
		}		
	}
	$("#pxl").hide();
	
	bindBehaviors();
});