if(readCookie('oldvisitor')==null){
	document.write(
'<div id="popin">'+
	'<div id="popin_close"><span onclick="popinClose()" title="Close"></span></div>'+
	'<div id="popin_body" onclick="popup()">'+
	'<img src="/images/exclamation.png" width="100" height="100" style="float:left;margin-top:-40px" />'+
	'<p class="head"><u>Breaking News</u>: 99% of All Forex Software Lose Money 99% of the Time!</p>'+
	'<p><span class="sub">Do you know how to protect yourself from them? Learn <u>3 Simple Rules</u> that will save you money!</span> '+
	'<span class="action">Click here...</span></p>'+
	'</div>'+
'</div>'+
'<div id="popup">'+
	'<div id="popup_close"><span onclick="popupClose()">Close</span></div>'+
	'<div id="popup_body">'+
	'<iframe id="popup_form" src="" frameborder="0" width="460" height="480"></iframe>'+
	'</div>'+
'</div>'+
'<div id="black_overlay"></div>');

	setTimeout("popinUp()",3000);
}
		
var popinX = -0.3;
var popinPos = -120;
var popinStop = false;
function popupClose(){
	document.getElementById('black_overlay').style.display = "none";
	document.getElementById('popup').style.display = "none";
}
function popup(){
	document.getElementById("popup_form").src = "/3rules/index.html";
	popinClose();
	var pos;
	if (window.innerHeight){
		pos = window.pageYOffset
	}else if (document.documentElement && document.documentElement.scrollTop){
		pos = document.documentElement.scrollTop
	}else if (document.body){
		pos = document.body.scrollTop
	}
	
	var x=document.documentElement.clientWidth/2-240;
	var y=pos+100;

	document.getElementById('popup').style.top=y+'px';
	document.getElementById('popup').style.left=x+'px';
	
	if(blank=document.getElementById('black_overlay'))blank.style.display='block';
	var popup=document.getElementById('popup');
	popup.style.display='block';
}
function popinClose(){
	document.getElementById("popin").style.display="none";
	createCookie('oldvisitor',1,1);
}
function popinUp(){
	document.getElementById("popin").style.display = "block";
	if(popinPos < -24){
		popinPos+=2;
		document.getElementById("popin").style.bottom = popinPos + "px";
	}else if(popinX <= 2.5){
		popinX+=0.1;
		//var y = -10+14*Math.sin(2*popinX)/Math.exp(popinX/2);
		var y = -10+12*Math.sin(5*popinX)/Math.exp(popinX);
		document.getElementById("popin").style.bottom = y + "px";
	}else{
		popinStop = true;
	}
	if(!popinStop)setTimeout("popinUp()",10);
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function eraseCookie(name) {
	createCookie(name,"",-1);
}