/*
	Copyright (c) 2004-2008, The Dojo Foundation
	All Rights Reserved.

	Licensed under the Academic Free License version 2.1 or above OR the
	modified BSD license. For more information on Dojo licensing, see:

		http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing
*/


if(!dojo._hasResource["site.popover"]){
dojo._hasResource["site.popover"]=true;
dojo.provide("site.popover");
dojo.addOnLoad(function(){
var _1=document.getElementById("popover_modal_mask");
if(typeof _1!="undefined"&&_1!=null){
_1.id="po_modal_mask";
_1.className="modal_mask";
_1.style.width="100%";
_1.style.zIndex=1000;
if(window.location.pathname=="/product/spp.tmpl"){
_1.className="spp_modal_mask modal_mask";
}
}
if(typeof _2!=undefined){
var _2=document.createElement("generic_popover_wrapper");
_2.id="generic_popover_wrapper";
_2.style.width="970px";
_2.style.margin="0 auto";
_2.style.position="relative";
_2.style.left="0px";
_2.style.top="0px";
_2.style.display="block";
_2.style.zIndex=1001;
jQuery(_2).insertAfter("#po_modal_mask");
setTimeout("set_modal_height()",1000);
}
});
function set_modal_height(){
if(!genericPopover.autoSetModalHeight){
return true;
}
var d=document.documentElement;
var b=document.body;
var _5=(dojo.isSafari)?b:d;
document.getElementById("po_modal_mask").style.height=Math.max(_5.scrollHeight,_5.offsetHeight)+"px";
return true;
};
var genericPopover={show:function(_6,_7,_8,_9,_a,_b){
var _c=document.getElementById(_6);
_c.id="popoverPlaceHolderTmp";
var _d=1;
while(document.getElementById(_6)!=""&&_d<100){
jQuery("#"+_6).remove();
_d++;
}
_c.id=_6;
jQuery("#"+_6).appendTo("#generic_popover_wrapper");
if(_7){
set_modal_height();
_c.style.zIndex=1001;
document.getElementById("po_modal_mask").style.display="block";
if(_a){
dojo.query("#po_modal_mask").onclick(function(e){
genericPopover.hide(_6,1);
});
}
}
var _f=jQuery("#generic_popover_wrapper").offset();
_c.style.marginTop=(_9-_f.top)+"px";
if(typeof _b!="undefined"){
jQuery(_c).addClass(_b);
}
jQuery("#"+_6).fadeIn(_8);
},_fadeIn:function(_10,_11){
var _11=(_11)?_11:1000;
var _12=document.getElementById(_10);
var _13=jQuery(_12).children();
jQuery.each(_13,function(){
if(this.style.display!="none"){
dojo.style(this,"filter","");
dojo.style(this,"opacity","0");
}
});
dojo.style(_12,"display","block");
jQuery.each(_13,function(){
if(this.style.display!="none"){
dojo.fadeIn({node:this,duration:_11}).play();
}
});
},hide:function(_14,_15){
var _16=document.getElementById(_14);
_16.id="popoverPlaceHolderTmp";
var _17=1;
while(document.getElementById(_14)!=""&&_17<100){
jQuery("#"+_14).remove();
_17++;
}
_16.id=_14;
jQuery("#"+_14).fadeOut(500);
if(_15){
document.getElementById("po_modal_mask").style.display="none";
}
genericPopover.autoSetModalHeight=true;
},eventY:function(_18){
var _19;
if(_18){
if(_18.pageY){
_19=_18.pageY;
}else{
if(_18.clientY){
_19=_18.clientY+document.body.scrollTop+document.documentElement.scrollTop;
}
}
}
return _19;
},autoSetModalHeight:"true"};
}
