
$(document).ready(function(){	

	if (document.all && !window.opera) {
    if (typeof document.body.style.maxHeight == 'undefined') {
		var imgs = document.getElementsByTagName("img");
		for (i = 0; i < imgs.length; i++)
		{
			if (imgs[i].src.indexOf(".png") != -1)
			{
                imgs[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgs[i].src + "',sizingMethod='crop')";
                imgs[i].src="/img_onesecret/0.gif";
			}
		}
	}
    }

	$("div.news_left div.button a, a.a_close, a.img_tovar_big").focus(function(){
        $(this).blur();
    }); 

    $("#enter .pass_text").focus( function() { 
		$(this).hide();
		$("#enter .pass").show().focus();
	} );
	
	$("#menu li:first").addClass("first");
	
	$("#best tr.uzor:last").hide();	
	
	$("div.news_left div.button a").click( function() { 
		Rtop = (getClientCenterY() - 195);
		$("#pop").css({ top: Rtop }).show();
		$("#pop_shadow").show();
		return false;
	} );
	
	$("a.a_close, #pop_shadow").click( function() { 		
		$("#pop, #pop_shadow").hide();		
		return false;
	} );
	
		
	$("a.img_tovar_big").click( function() {     
        if (!$("#pop2").length) {    
            var img = $(this).attr("href");
            $("#carrier").after('<div id="pop_shadow2" class="pop_shadow" onclick="this.style.display=\'none\'; document.getElementById(\'pop2\').style.display=\'none\';"></div><div id="pop2" class="pop"><div class="img"></div><div class="bg_img"><div><p><img src="'+img+'" alt="" /></p></div></div><a href="#" class="a_close"><img src="/img_onesecret/ico_close.gif" width="17" height="17" alt="Закрыть" title="Закрыть" class="close" onclick="document.getElementById(\'pop2\').style.display=\'none\'; document.getElementById(\'pop_shadow2\').style.display=\'none\'; return false;" /></a></div>');            
        }
        Rtop = (getClientCenterY() - 195);
        $("#pop2").css({ top: Rtop }).show();
        $("#pop2, #pop_shadow2").show();    
        
        return false;
    } );
	
	$(".blur").focus( function() { 
        $(this).val("");        
    } );
	
	
	

    
});



function getBodyScrollTop()   
{   
    return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);   
}   
   
function getClientHeight()  
{  
 return document.compatMode=='CSS1Compat' && document.documentElement.clientHeight;
}  

function getClientCenterY()
{
	return parseInt(getClientHeight()/2)+getBodyScrollTop();
}







