var shade={isCreated:false,shadeCount:0,createLayer:function(){if(!this.isCreated){$(top.document.body).append('<div id="shadedLayer" style="display: none"></div>');
var shadedLayer=$("#shadedLayer");
shadedLayer.css({"z-index":"10000",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"black"});
this.isCreated=true
}$("#shadedLayer").click(function(){if($.browser.msie){$(".modalDetail").css("display","none")
}else{$(".modalDetail").fadeOut(1000)
}shade.hide()
})
},show:function(){this.createLayer();
this.shadeCount++;
var overlay=$("#shadedLayer");
$(overlay).css("opacity","0.5");
$(overlay).css("height",$(document.body).height()+"px");
if($.browser.msie){$(overlay).css("display","block")
}else{$(overlay).fadeIn(1000)
}$(window).bind("resize",function(){shade.setsize($(window).width(),$("body").height())
})
},setsize:function(w,h){$("#shadedLayer").css({width:w,height:h})
},hide:function(){if(this.shadeCount==1){if($.browser.msie){$("#shadedLayer").css("display","none")
}else{$("#shadedLayer").fadeOut(1000)
}}this.shadeCount--
}};
var genShade={isCreated:false,shadeCount:0,placeholder:top.document.body,addTo:function(placeholder){this.placeholder=placeholder!=undefined?placeholder:top.document.body
},createLayer:function(){if(!this.isCreated){$(this.placeholder).append('<div id="genShadedLayer"></div>');
var shadedLayer=$("#genShadedLayer");
shadedLayer.css({"z-index":"100000",position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px","background-color":"transparent",opacity:"0"});
this.getShadeOffset();
shadedLayer.css({top:"-"+this.shadeOffset.top+"px",left:"-"+this.shadeOffset.left+"px","background-color":"#000000"});
this.isCreated=true
}},getShadeOffset:function(){var obj=document.getElementById("genShadedLayer");
var curleft=0;
var curtop=0;
if(obj.offsetParent){do{curleft+=obj.offsetLeft;
curtop+=obj.offsetTop
}while(obj=obj.offsetParent)
}this.shadeOffset={left:curleft,top:curtop}
},show:function(){this.createLayer();
this.shadeCount++;
var overlay=$("#genShadedLayer");
$(overlay).css("width",$(document).width()+"px");
$(overlay).css("height",$(document).height()+"px");
$(overlay).css("opacity","0.5");
if($.browser.msie){$(overlay).css("display","block")
}else{$(overlay).fadeIn(1000)
}$(window).bind("resize",function(){$("#genShadedLayer").css({width:$(document).width(),height:$(document).height()})
})
},hide:function(){if(this.shadeCount==1){if($.browser.msie){$("#genShadedLayer").css("display","none")
}else{$("#genShadedLayer").fadeOut(1000)
}}this.shadeCount--
}};
