var cnt = 0;
var version = '';


jQuery().ready(function(){
	
   // var bool = '';
	var oclock = jQuery("#time").text();
	times = oclock.split(":");
	var hour = times[0];
	var minut = times[1];
	
	setInterval(function(){
		jQuery("#time").html(hour+":"+minut);
		minut++;
		if (minut == 60)
		{
			minut = 0;
			hour++
		}
		if (minut < 10)
			minut = "0" + minut;	
	},1000*60);
	

	
        version = jQuery.browser.version;
	
	    if(jQuery.browser.version == "7.0")
		{
			jQuery("#inpt").css({top:"0px",height:"12px",left:"5px"});
			jQuery("#inp_login").css({top:"0px",height:"12px",left:"0px"});
			jQuery("#inp_passw").css({top:"0px",height:"12px",left:"0px"});			
		}
		jQuery(".center_a").click(function(){
			if (isIE){
	        	document.getElementById('menu_curr_weat').style.zIndex  = "-1";
				}
		});
		jQuery(".selectArea>.optionsDivInvisible").mouseover(function(){
			if (isIE){			
	         	document.getElementById('menu_curr_weat').style.zIndex  = "-1";
				}
		});
		jQuery(".selectArea").mouseover(function(){
			if (isIE){			
	         	document.getElementById('menu_curr_weat').style.zIndex  = "-1";
				}
		});
		
		jQuery(".selectArea").mouseout(function(){
			if (isIE){
				document.getElementById('menu_curr_weat').style.zIndex  = "1";
				}
		});

		jQuery("#realty").click(function(){
			window.location.href = "http://realty.74mail.ru/realty_add.php";
		});
		jQuery(".site").click(function(){
			site = jQuery(this).attr('id');
			open("http://doska.74mail.ru/redirect_site.php?site="+site,"site");
		});
		
		jQuery(".inp_field").focus(function () {
			jQuery(this).val("");
		});
		jQuery(".inp_field").blur(function () {
		/**
			if (jQuery(this).attr("id") == 'inp_login')
				jQuery(this).val("login");
			else if(jQuery(this).attr("id") == 'inp_passw')
				jQuery(this).val("passw");
			else if(jQuery(this).attr("id") == 'inpt')
				jQuery(this).val("Поиск");
				**/
		});
		
		
	

});
	var msg = "Здесь будет Ваша реклама"
		for (i=0;i<190;i++)
				msg += " ";
		function scrollMsg(){
		document.getElementById("reklama").value = msg;
		msg = msg.substring(1, msg.length) + msg.substring(0, 1);
		setTimeout("scrollMsg()", 100)
		}
		
function refer(){
			window.location = "http://forum.74mail.ru//index.php?showtopic=10610";
		}
function zInd(){
				document.getElementById('menu_curr_weat').style.zIndex  = "1";
			}
					
function Load(){
self.moveTo(screen.availWidth / 2 - 350, screen.availHeight/2 - 250);
self.resizeTo(800,600);
self.focus();

}
if (self.top.frames.length != 0){
self.top.location = 'http://74mail.ru/index.php';
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
}

function sbmt(){
		document.getElementById('Submit').click();
}
function search(){
		document.getElementById('Submit2').click();
}

function leng()
{
    // bool = jQuery("#cc").text();
	  bool = 1;
	//if (!isIE){
		var p = document.body.clientWidth - (380+275+57);
		var sr = document.body.clientWidth - (380+275+57+120);
		var vers = navigator.appVersion;
		var re7 = /(\w+)MSIE 7(\w+)/;
		var re8 = /(\w+)MSIE 8(\w+)/;
		 //pos_cen();
		if (document.body.clientWidth < 1024){
		   
		   document.getElementById("menu_curr_weat").style.width = "1024px";
		   document.getElementById("bl2").style.width = "980px";
		   document.getElementById("weat").style.right = "8px";
		   document.getElementById("Cur2").style.left = "8px";
		   document.getElementById("search").style.width = "315px";
		   document.getElementById("menu_curr_weat").style.width = "985px";
		   document.getElementById("f_searchBC").style.width = "200px";
		   if(!isIE)
				document.getElementById("bann").style.width = "1024px";
		   if(isIE){ 
		  	//document.getElementById('banner_test').style.top = '0px';
			//document.getElementById('banner_test').style.left = '0px';
			//document.getElementById('bann').style.float = 'none';
			// alert(vers);
		    // if (re7.test(vers) || re8.test(vers))
			//	document.getElementById('bann').style.width = '1024px';
			
		   }
		   if(document.woman != null)
		   {
			   document.woman.width = "280px";
			   document.getElementById("woman").style.width = "280px";
			   document.woman.height = "119px";
			   document.getElementById("woman").style.height = "119px";
		   }
		   if (document.man != null)
		   {
			   document.man.width = "280px";
			   document.getElementById("man").style.width = "280px";
			   document.man.height = "119px";
			   document.getElementById("man").style.height = "119px";
		   }
		   
		 }
		  else{
		   // document.getElementById("bann").style.width = "100%";
			document.getElementById("menu_curr_weat").style.width = "100%";
			document.getElementById("bl2").style.width = "100%";
			document.getElementById("weat").style.right = "15px";
			document.getElementById("Cur2").style.left = "15px";
			document.getElementById("search").style.width = p+"px";
			document.getElementById("menu_curr_weat").style.width = "100%";
			sr -= 20;
			document.getElementById("f_searchBC").style.width = sr+"px";
			if(document.woman != null || document.man != null)
			{
				if (bool == 1)
				{
					var hm;
					document.man.width = "100%";
					document.getElementById("man").style.width = "100%";
					hm = (198*document.man.offsetWidth)/466;
					document.man.height = hm+"px";
					document.getElementById("man").style.height = hm+"px";
				}
				if (bool == 0)
				{
					var hw;
					document.woman.width = "100%";
					document.getElementById("woman").style.width = "100%";
					hw = (198*document.woman.offsetWidth)/466;
					document.woman.height = hw+"px";
					document.getElementById("woman").style.height = "120px"; 
				}
			}
			 if(isIE){
				//document.getElementById('banner_test').style.top = '0px';
				//document.getElementById('banner_test').style.left = '0px';
			//	document.getElementById('bann').style.float = 'left';
				//if (re7.test(vers) || re8.test(vers))
				//	document.getElementById('bann').style.width = '100%';
					
			  }
			
		  }
	//}
		


}
function center(){
	leng();
	if (window.location.hostname == "team.74mail.ru")
			scrollMsg()
}

