$(document).ready(function(){
var v =	function xxx(){
			$("div#headerimage").append('<div id="display_tips" style="width:300px;height:auto;min-height:45px;padding:8px;background-color:white;position:relative;top:89px;left:224px;z-index:2;border:solid 2px black;font-family:Trebuchet MS;font-size:14px;text-align:center;float:left;"></div>');
			$('div#display_tips,img[alt="sss"]').hide().fadeIn(400);
				
			if (navigator.appName.indexOf("Microsoft") == -1 && navigator.appName.indexOf("Opera") == -1) {
				$("div#display_tips").corner();
			}
			$("div#headerimage").append('<img src="http://www.ceasulcuc.ro/site_images/dialog.gif" alt="sss" style="position:relative;top:97px;left:-142px;z-index:3;" />');
			var randomnumber=Math.floor(Math.random()*100001);
			var thisUrl = document.location.href;
			if(thisUrl.indexOf("http://www.") != -1)
			{
				$("div#display_tips").load("http://www.ceasulcuc.ro/active_pages/PHP/tipsOut.php?" + randomnumber );
			}
			else if(thisUrl.indexOf("http://www.") == -1)
			{
				$("div#display_tips").load("http://ceasulcuc.ro/active_pages/PHP/tipsOut.php?" + randomnumber);
			}
			
	}
	
	var t = function gigi(){
		if ($('div#display_tips').length != 0) {
			$('div#display_tips,img[alt="sss"]').fadeOut(600,function(){
				$('div#display_tips,img[alt="sss"]').remove();
			});
		}
		setTimeout(v, 4000);
	}
	v();
	setInterval(t,12000);
	
//-------------------------	
	//pune textul "e-mail" in newsletteru din dreapta
	if($('input[name="email"]').val()=='')
	{
		$('input[name="email"]').val('e-mail').css({'color':'#8A8A8A'});
	}
	//la focus dispare textul "e-mail"
	$('input[name="email"]').focus(function(){
		if ($(this).val() == 'e-mail') {
			$(this).val('').css({
				'color': '#4D4D4D'
			});
		}	
	});
	//la eventul blur
	$('input[name="email"]').blur(function(){
		if($(this).val()=='')
		{
			$(this).val('e-mail').css({'color':'#8A8A8A'});
		}
	});
	
	//pune textul "e-mail" in newsletteru din footer
	if($('input[name="footer_email"]').val()=='')
	{
		$('input[name="footer_email"]').val('e-mail').css({'color':'#8A8A8A'});
	}
	//la focus dispare textul "e-mail"
	$('input[name="footer_email"]').focus(function(){
		if ($(this).val() == 'e-mail') {
			$(this).val('').css({
				'color': '#4D4D4D'
			});
		}	
	});
	//la eventul blur
	$('input[name="footer_email"]').blur(function(){
		if($(this).val()=='')
		{
			$(this).val('e-mail').css({'color':'#8A8A8A'});
		}
	});
//-------------------------		
	
});
