var date_fin_promo = "01/08/10";

function ComparerDates(LeParam1,LeParam2){
	// Compare 2 dates au format mm/jj/aaaa
	// Renvoye 0 si &eacute;galit&eacute;, 1 si la premi&egrave;re est sup&eacute;rieure, sinon 2
	LeParam1 = Date.parse(LeParam1);
	LeParam2 = Date.parse(LeParam2);
	if (LeParam1 == LeParam2) { return 0; }
	if (LeParam1 > LeParam2) { return 1; } else { return "stop"; }
}

var promo = new Date();
var jour = promo.getDate()
var mois = promo.getMonth()+1;
var annee = promo.getFullYear();

pub = ComparerDates(date_fin_promo,mois+"/"+jour+"/"+annee);

 if(!document.all && document.getElementById) { ejs_hauteur = window.innerHeight-230; }
 else { ejs_hauteur = document.body.clientHeight-230; }
 
 document.write('<style type="text/css">\n');
 document.write('#ejs_slide_box ');
 document.write('	{');
 document.write('	position:absolute;');
 document.write('	-moz-border-radius: 20px;');
 document.write('	width:315px;');
 document.write('	height:197px;');
 document.write('	top:'+ejs_hauteur+'px;');
 document.write('	left:-305px;');
 document.write('	background-color:#ffffff;');
 document.write('	border-color:#0774B7;');
 document.write('	border-width:3px;');
 document.write('	border-style:solid;');
 document.write('	}\n');
 
 document.write('#ejs_slide_bouton ');
 document.write('	{');
 document.write('	position:absolute;');
 document.write('        color:#ffffff;');
 document.write('	-moz-border-radius: 20px;');
 document.write('	top:30px;');
 document.write('	left:315px;');
 document.write('	background-color:#0774B7;');
 document.write('	font-family:arial;');
 document.write('	font-weight:bold;');
 document.write('	font-size:15px;');
 document.write('	}\n');
 
 document.write('#ejs_slide_image ');
 document.write('	{');
 document.write('	position:relative;');
 document.write('	-moz-border-radius: 20px;');
 document.write('	top:7px;');
 document.write('	left:7px;');
 document.write('	}\n');
 
 document.write('.ejs_slide_blanc\n');
 document.write('	{\n');
 document.write('	color:#ffffff;');
 document.write('	font-family:arial;');
 document.write('	font-weight:bold;');
 document.write('	font-size:15px;');
 document.write('	text-decoration:none;');
 document.write('	}');
 document.write('</style>');
 
 var slide_tempo;
 slide_url_image = 'img/scoaladevara.jpg';
 slide_url_click = 'http://www.smartkidsclub.ro/scoaladevara.html';
 slide_x = -305;
 slide_ismoving = false;
 slide_first = true;
 
 function slide_start()
 	{
 	if(slide_x == -305 && !slide_ismoving)
 		slide_deballe();
 	else if(!slide_ismoving)
 		slide_remballe();
 	}
 
 function slide_deballe()
 	{
 	slide_ismoving = true;
 	if(slide_x < 10)
 		{
 		slide_x += 5;
 		slide_move();
 		setTimeout("slide_deballe()", 10);
 		}
 	else
 		{
 		slide_ismoving = false;
 		if(slide_first)
 			slide_tempo = setTimeout("slide_start()", 5000);
 		slide_first = false;
 		}	
 	}
 
 function slide_remballe()
 	{
 	clearTimeout(slide_tempo);
 	slide_ismoving = true;
 	if(slide_x > -305)
 		{
 		slide_x -= 5;
 		slide_move();
 		setTimeout("slide_remballe()", 10);
 		}
 	else
 		slide_ismoving = false;
 	}
 
 function slide_move()
 	{
 	if(document.getElementById)
 		{
 		document.getElementById("ejs_slide_box").style.left=slide_x+'px';
 		}
 	}
 
 function slide_close()
 	{
 	if(document.getElementById)
 		{
 		document.getElementById("ejs_slide_box").innerHTML = '';
 		document.getElementById("ejs_slide_box").style.top = -100;
 		document.getElementById("ejs_slide_box").style.left = -100;
 		document.getElementById("ejs_slide_box").style.width = 1;
 		document.getElementById("ejs_slide_box").style.height = 1;
 		}
}

 if(pub != "stop"){ 
	 window.onload = slide_start;
	 
	 document.write('<div id="ejs_slide_box">');
	 document.write('<div id="ejs_slide_image">');
	 document.write('<a href="'+slide_url_click+'"><img src="'+slide_url_image+'" border="0" alt="Contact SMART KIDS CLUB" /></a>');
//	 document.write('<img src="'+slide_url_image+'" border="0" alt="" />');
	 document.write('</div>');
	 document.write('<div id="ejs_slide_bouton"><a href="#" onclick="slide_start();this.blur();return(false)" class="ejs_slide_blanc">&lt;<br />&gt;</a><br /><a href="#" onclick="slide_close();return(false);" class="ejs_slide_blanc">x</a></div>');
	 document.write('</div>');
 }
