/*
	jQuery Modal Dialog plugin v2.0.0.
	Written by All Web Promotion / a.w.s 2008.
*/

(function(A){A.modal=function(C){var F={overlayId:"dialog-overlay",overlayCss:{},overlayFadeIn:null,overlayOpacity:50,overlayClose:true,containerId:"dialog-container",containerFadeIn:300,containerHorizontal:"center",containerVertical:"center",closeIds:".close",onClose:null};this.settings=A.extend({},F,C);this.open=false;var B=this.settings.overlayOpacity/100;this.isie6=function(){return(A.browser.msie&&/MSIE 6\.0/i.test(window.navigator.userAgent)&&!/MSIE 7\.0/i.test(window.navigator.userAgent))};this.overlay=A("<div>").attr("id",this.settings.overlayId).css(A.extend({},{opacity:B,height:"100%",width:"100%",position:"fixed",left:"0",top:"0",zIndex:"3000",backgroundColor:"#000",overflow:"auto"},this.settings.overlayCss)).hide().appendTo("body");if(this.isie6()){A("body","html").css({height:"100%",width:"100%"});A("html").css("overflow","hidden");var E=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+"px";var D=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+"px";A(this.overlay).css({position:"absolute",height:E,width:D});this.iframe=A('<iframe src="javascript:false;">').css({opacity:"0",position:"absolute",height:E,width:D,zIndex:"1000",width:"100%",top:"0",left:"0"}).hide().appendTo("body")}this.initWindow=function(G){this.container=A(G).css({position:"fixed",zIndex:"3100"}).hide().appendTo("body")};this.show=function(){var G=this;if(!this.open){if(this.iframe){this.iframe.show()}this.open=true;if(this.settings.overlayFadeIn){this.overlay.fadeIn(this.settings.overlayFadeIn)}else{this.overlay.show()}if(this.settings.overlayClose){this.overlay.click(function(H){G.close();return false})}}this.showWindow();return this};this.showWindow=function(){var G=this;if(this.settings.containerHorizontal=="center"){this.container.css({left:"50%",marginLeft:(0-(this.container.width()/2))+"px"})}if(this.settings.containerVertical=="center"){this.container.css({top:"48%",marginTop:(0-(this.container.height()/2))+"px"})}if(this.isie6()){this.container.css({position:"absolute"})}if(A.browser.msie&&(A.browser.version<8)){this.container.fadeIn(this.settings.containerFadeIn)}else{this.container.slideDown(this.settings.containerFadeIn)}A(this.settings.closeIds).click(function(H){G.close();return false})};this.closeWindow=function(){if(this.container){A(this.settings.closeIds).unbind("click");this.container.remove();this.container=null}};this.close=function(){A("#"+this.settings.overlayId).unbind("click");this.closeWindow();if(A.isFunction(this.settings.onClose)){this.settings.onClose()}if(this.overlay){this.overlay.unbind("click");this.overlay.remove()}if(this.iframe){this.iframe.remove()}if(this.isie6()&&(this.container||this.overlay)){A("body","html").css({height:"auto",width:"auto"});A("html").css("overflow","")}this.overlay=null;this.container=null;this.iframe=null;this.open=false;return this};this.makePx=function(H){var G="px";if(!(H.substring(H.length,G.length)==G)){H=H+G}return H};this.getId=function(G){return{kind:"id",id:G}};this.makeId=function(H){var G="#";if(!(H.substr(0,G.length)==G)){H=G+H}return H};this.makeClass=function(H){var G=".";if(!(H.substr(0,G.length)==G)){H=G+H}return H};return this};A.fn.setIdentifier=function(C){var B="";var D="";return A(this)}})(jQuery);
