    //loading popup with jQuery magic!
    var popupStatus = 0;
    
    function showLoadingPopup() {
        centerPopup();
        $jQ("#backgroundPopup").fadeToggle("slow");
        $jQ("#popupContact").fadeIn("slow");
        return true;
    }
    
    function loadPopup(){
	//loads popup only if it is disabled
	if(popupStatus==0){
	    $jQ("#backgroundPopup").css({
	    "opacity": "0.7",
	    "filter" : "alpha(opacity=70)"
	    });
	    $jQ("#backgroundPopup").fadeIn("slow");
	    $jQ("#popupContact").fadeIn("slow");
            //$jQ("#popupContact").scrollTop(300);
            //$jQ("div.product_header").scrollTop(300);
            $jQ('html, body').animate({scrollTop:0}, 'slow');
	    popupStatus = 1;
            
	}
    }

    //centering popup
    function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $jQ("#popupContact").height();
	var popupWidth = $jQ("#popupContact").width();
	//centering
	$jQ("#popupContact").css({
	"position": "absolute",
	"top": windowHeight/2-popupHeight/2,
	"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	$jQ("#backgroundPopup").css({
	"height": windowHeight
	});
    }
    
    function togglePopup(){
        $jQ("#backgroundPopup").fadeToggle("slow");
        $jQ("#chooseOffer").fadeToggle("slow");
    }
    
    function loadPackagePopup(){
	//loads popup only if it is disabled
	if(popupStatus==0){
	    $jQ("#backgroundPopup").css({
	    "opacity": "0.7",
	    "filter" : "alpha(opacity=70)"
	    });
	    $jQ("#backgroundPopup").fadeToggle("slow");
	    $jQ("#chooseOffer").fadeToggle("slow");
            //$jQ("#popupContact").scrollTop(300);
            //$jQ("div.product_header").scrollTop(300);
            $jQ('html, body').animate({scrollTop:0}, 'slow');
	    popupStatus = 1;
	}
        else {
            togglePopup();
        }
    }
    
    //centering popup
    function centerPackagePopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $jQ("#chooseOffer").height();
	var popupWidth = $jQ("#chooseOffer").width();
        // track choose offer page
        pageTracker._trackPageview(document.location.href+'chooseOffer');
	//centering
	$jQ("#chooseOffer").css({
	"position": "absolute",
	"top": windowHeight/2-popupHeight/2,
	"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	$jQ("#backgroundPopup").css({
	"height": windowHeight
	});
    }
