// JScript File
   function resetControls(){
        $("div.open_popup_img").hide();
   }

   function popupHide(animate){
    if(animate == true){
		$("div#ctrWinPopUp").css({"display":"none"});
		$("div#ctrOverlay").animate({opacity: 0},400,function(){
			$("div#ctrOverlay").hide();
			 resetControls();
		});
	}else{
	        $("div#ctrWinPopUp").hide();
            $("div#ctrOverlay").hide();
             resetControls();
	       }

   }

   function popupShow(animate, activeId){
   		$("div#"+activeId).show();

		if ($.browser.opera) {
              $("div#ctrWinPopUp").height(593);
		}

        var w = $("div#ctrWinPopUp").width();
  		var h = $("div#ctrWinPopUp").height();
        var l = Math.floor(($(window).width()/2 - w/2)+$(document).scrollLeft());
        var t = Math.floor(($(window).height()/2 - h/2)+$(document).scrollTop());



      $("div#ctrOverlay").width($(document).width());
      $("div#ctrOverlay").height($(document).height());
       $("div#ctrWinPopUp").css({
		left: l,
		top: t
	})



      if(animate == true){
        $("div#ctrOverlay").css({"opacity": 0,"display":"block"});
    	$("div#ctrOverlay").animate({opacity: 0.8},400,function(){
    		$("div#ctrWinPopUp").show();
    	});

      }else{
           $("div#ctrWinPopUp").show();
           $("div#ctrOverlay").css({"opacity": "0.8" ,"display":"block"});
        }
   }


   $(document).ready(function(){

		if ($.browser.opera) {
    		$.support.opacity = true;
		}
      /*$(".anchorPopUp").click(function(){
        popupShow(true, $(this).attr("assignedId"));
      });*/

      $(".anchorPClose").click(function(){
        popupHide(true);
      });

   });
