var t1 ;

function acil_menu(id){

durdur();

document.getElementById("acik_menu").value = id;
var acik_olan = Number(document.getElementById("acik_menu").value) ;

var i = 1 ;
while(i<=3){
if(i == acik_olan) document.getElementById("popup"+i).style.display="block";
else {

document.getElementById("popup"+i).style.display="none";
}
i++;
}


}

function kapan_menu(id){

var acik_olan = Number(document.getElementById("acik_menu").value) ;

document.getElementById("popup"+id).style.display="none";

document.getElementById("acik_menu").value = 0;

}


function popup(id, status){

if(status == 1){

acil_menu(id);

}else{

t1=setTimeout("kapan_menu("+id+")",200) ;


}


}


function durdur(){

clearTimeout(t1);

}











function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}









(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);


$(function(){
	$('#pop_up a')
		.css( {backgroundPosition: "-20px 50px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-20px 100px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(40px 50px)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "-20px 50px"})
			}})
		})
	
});




