﻿

function RUShure(){return confirm('آیا مطمئن هستید');}

function GoToPrevPage(){ window.history.back();}

/////////////////////////////////////

var baseTopE = 0;
function MoveLeftItem() {
    var odiv = document.getElementById('divLeftItem');
    var curtop = parseInt(odiv.style.top);
    if (!baseTopE) {
        baseTopE = curtop;
    }
    var xscrol = $(window).scrollTop();
    var newx = curtop + ((xscrol + baseTopE) - curtop) / 2;
    if (newx > 0) {
        odiv.style.top = newx + 'px';
    }
}
$(function() {
    setInterval(MoveLeftItem, 50);
});

var t=true;
$(function() {
    $(".divItem").hover(function() {
        $(".divItem").each(function(){this.f=function(){};});
        this.f=function(){
            $(this).addClass("divItemOver");
            $(".divItemText", this).slideDown("slow");
            $(".divItem").not(this).fadeTo("fast", 0.6);
        };
        this.t=setTimeout(function(){ $(".divItem").each(function(){this.f();}); },200);
    },
    function() {
        clearTimeout(this.t);
        $(this).removeClass("divItemOver");
        $(".divItemText", this).slideUp("slow");
        $(".divItem").not(this).fadeTo("fast", 1);
    });
});



//add to all links image 
//$(function() {
//    $("a").not(".mainMenu a").append("<img src='http://hge.ir/images/external.png'/>");
//});


///////////////////   corner()   ////////////////////////
$(function() {
    $(".Footer").corner();
    $(".Main").corner("bottom");
    $(".divItemText").corner("top");
    $(".h1, .h2, .h3 ,.h4").corner("top");
    //$("#hflash").corner("top");
    $(".loginsubmit").corner();    
    $(".desc").corner();
});
//////////////////////////////////////////////////////////


/////////////////    nemoone Karha    //////////////////
$(function() {
    //$(".nemooneKarha .n3").appendTo("body");
    
    
    $(".nemooneKarha .n1").hover(function() {
        $("<div class=nemonnekarPopUp></div>").appendTo("body");
        $(".nemonnekarPopUp").html('');      
        $(".nemonnekarPopUp").html( $(".n3", $(this).parent()).html()).hide().show("slow");
        var o=$(this).offset();
        $(".nemonnekarPopUp").css('left',o.left+'px');
        $(".nemonnekarPopUp").css('top',(o.top+200)+'px');
    },
    function() {
        $(".n3", $(this).parent()).hide("fast");
         $(".nemonnekarPopUp").hide("fast");
         $(".nemonnekarPopUp").remove();
    });
    
    $(".n3").corner();
});

 ///////////////////////////////////////////////////////


/////////////     توضیحات روی عکس    ////////////////////////
 $(function() {   
    $('.imgDesc').hover(function(){$('.all',$(this)).show('slow');},function(){$('.all',$(this)).hide('fast');});
    $('.imgDesc .desc').fadeTo('fast',0.50);
    $('.imgDesc .all').hide();
 });
 ///////////////////////////////////////////////////////////