(function(a){a.fn.closeDOMWindow=function(b){if(!b){b={}}var c=function(d){if(b.anchoredClassName){var f=a("."+b.anchoredClassName);f.fadeOut("fast",function(){if(a.fn.draggable){f.draggable("destory").trigger("unload").remove()}else{f.trigger("unload").remove()}});if(b.functionCallOnClose){b.functionCallAfterClose()}}else{var e=a("#DOMWindowOverlay");var g=a("#DOMWindow");e.fadeOut("fast",function(){e.trigger("unload").unbind().remove()});g.fadeOut("fast",function(){if(a.fn.draggable){g.draggable("destroy").trigger("unload").remove()}else{g.trigger("unload").remove()}});a(window).unbind("scroll.DOMWindow");a(window).unbind("resize.DOMWindow");if(a.fn.openDOMWindow.isIE6){a("#DOMWindowIE6FixIframe").remove()}if(b.functionCallOnClose){b.functionCallAfterClose()}}};if(b.eventType){return this.each(function(d){a(this).bind(b.eventType,function(){c(this);return false})})}else{c()}};a.closeDOMWindow=function(b){a.fn.closeDOMWindow(b)};a.fn.openDOMWindow=function(j){var b=a.fn.openDOMWindow;b.defaultsSettings={anchoredClassName:"",anchoredSelector:"",borderColor:"#ccc",borderSize:"4",draggable:0,eventType:null,fixedWindowY:100,functionCallOnOpen:null,functionCallOnClose:null,height:500,loader:0,loaderHeight:0,loaderImagePath:"",loaderWidth:0,modal:0,overlay:1,overlayColor:"#000",overlayOpacity:"85",positionLeft:0,positionTop:0,positionType:"centered",width:500,windowBGColor:"#fff",windowBGImage:null,windowHTTPType:"get",windowPadding:10,windowSource:"inline",windowSourceID:"",windowSourceURL:"",windowSourceAttrURL:"href"};var l=a.extend({},a.fn.openDOMWindow.defaultsSettings,j||{});b.viewPortHeight=function(){return self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight};b.viewPortWidth=function(){return self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth};b.scrollOffsetHeight=function(){return self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop};b.scrollOffsetWidth=function(){return self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft};b.isIE6=typeof document.body.style.maxHeight==="undefined";var f=function(){var m=a("#DOMWindowOverlay");if(b.isIE6){var n=document.documentElement.offsetHeight+document.documentElement.scrollTop-4;var o=document.documentElement.offsetWidth-21;m.css({height:n+"px",width:o+"px"})}else{m.css({height:"100%",width:"100%",position:"fixed"})}};var d=function(){var m=document.documentElement.offsetHeight+document.documentElement.scrollTop-4;var n=document.documentElement.offsetWidth-21;a("#DOMWindowIE6FixIframe").css({height:m+"px",width:n+"px"})};var g=function(){var m=a("#DOMWindow");if(l.height+50>b.viewPortHeight()){m.css("left",Math.round(b.viewPortWidth()/2)+b.scrollOffsetWidth()-Math.round((m.outerWidth())/2))}else{m.css("left",Math.round(b.viewPortWidth()/2)+b.scrollOffsetWidth()-Math.round((m.outerWidth())/2));m.css("top",Math.round(b.viewPortHeight()/2)+b.scrollOffsetHeight()-Math.round((m.outerHeight())/2))}};var i=function(){var m=a("#DOMWindowLoader");if(b.isIE6){m.css({left:Math.round(b.viewPortWidth()/2)+b.scrollOffsetWidth()-Math.round((m.innerWidth())/2),position:"absolute"});m.css({top:Math.round(b.viewPortHeight()/2)+b.scrollOffsetHeight()-Math.round((m.innerHeight())/2),position:"absolute"})}else{m.css({left:"50%",top:"50%",position:"fixed"})}};var h=function(){var m=a("#DOMWindow");m.css("left",l.positionLeft+b.scrollOffsetWidth());m.css("top",+l.positionTop+b.scrollOffsetHeight())};var e=function(m){if(arguments[0]){a("."+m+" #DOMWindowLoader").remove();a("."+m+" #DOMWindowContent").fadeIn("fast",function(){if(l.functionCallOnOpen){l.functionCallOnOpen()}});a("."+m+".closeDOMWindow").click(function(){a.closeDOMWindow();return false})}else{a("#DOMWindowLoader").remove();a("#DOMWindow").fadeIn("fast",function(){if(l.functionCallOnOpen){l.functionCallOnOpen()}});a("#DOMWindow .closeDOMWindow").click(function(){a.closeDOMWindow();return false})}};var c=function(n){var m={};n.replace(/b([^&=]*)=([^&=]*)b/g,function(o,p,q){if(typeof m[p]!="undefined"){m[p]+=","+q}else{m[p]=q}});return m};var k=function(m){l.windowSourceID=a(m).attr("href")||l.windowSourceID;l.windowSourceURL=a(m).attr(l.windowSourceAttrURL)||l.windowSourceURL;l.windowBGImage=l.windowBGImage?"background-image:url("+l.windowBGImage+")":"";var r,p;if(l.positionType=="anchored"){var q=a(l.anchoredSelector).offset();var n=q.left+l.positionLeft;var t=q.top+l.positionTop;a("body").append('<div class="'+l.anchoredClassName+'" style="'+l.windowBGImage+";background-repeat:no-repeat;padding:"+l.windowPadding+"px;overflow:auto;position:absolute;top:"+t+"px;left:"+n+"px;height:"+l.height+"px;width:"+l.width+"px;background-color:"+l.windowBGColor+";border:"+l.borderSize+"px solid "+l.borderColor+';z-index:10001"><div id="DOMWindowContent" style="display:none"></div></div>');if(l.loader&&l.loaderImagePath!==""){a("."+l.anchoredClassName).append('<div id="DOMWindowLoader" style="width:'+l.loaderWidth+"px;height:"+l.loaderHeight+'px;"><img src="'+l.loaderImagePath+'" /></div>')}if(a.fn.draggable){if(l.draggable){a("."+l.anchoredClassName).draggable({cursor:"move"})}}switch(l.windowSource){case"inline":a("."+l.anchoredClassName+" #DOMWindowContent").append(a(l.windowSourceID).children());a("."+l.anchoredClassName).unload(function(){a("."+l.windowSourceID).append(a("."+l.anchoredClassName+" #DOMWindowContent").children())});e(l.anchoredClassName);break;case"iframe":a("."+l.anchoredClassName+" #DOMWindowContent").append('<iframe frameborder="0" hspace="0" wspace="0" src="'+l.windowSourceURL+'" name="DOMWindowIframe'+Math.round(Math.random()*1000)+'" style="width:100%;height:100%;border:none;background-color:#fff;" class="'+l.anchoredClassName+'Iframe" ></iframe>');a("."+l.anchoredClassName+"Iframe").load(e(l.anchoredClassName));break;case"ajax":if(l.windowHTTPType=="post"){if(l.windowSourceURL.indexOf("?")!==-1){r=l.windowSourceURL.substr(0,l.windowSourceURL.indexOf("?"));p=c(l.windowSourceURL)}else{r=l.windowSourceURL;p={}}a("."+l.anchoredClassName+" #DOMWindowContent").load(r,p,function(){e(l.anchoredClassName)})}else{if(l.windowSourceURL.indexOf("?")==-1){l.windowSourceURL+="?"}a("."+l.anchoredClassName+" #DOMWindowContent").load(l.windowSourceURL+"&random="+(new Date().getTime()),function(){e(l.anchoredClassName)})}break}}else{if(l.overlay){a("body").append('<div id="DOMWindowOverlay" style="z-index:10000;display:none;position:absolute;top:0;left:0;background-color:'+l.overlayColor+";filter:alpha(opacity="+l.overlayOpacity+");-moz-opacity: 0."+l.overlayOpacity+";opacity: 0."+l.overlayOpacity+';"></div>');if(b.isIE6){a("body").append('<iframe id="DOMWindowIE6FixIframe"  src="blank.html"  style="width:100%;height:100%;z-index:9999;position:absolute;top:0;left:0;filter:alpha(opacity=0);"></iframe>');d()}f();var o=a("#DOMWindowOverlay");o.fadeIn("fast");if(!l.modal){o.click(function(){a.closeDOMWindow()})}}if(l.loader&&l.loaderImagePath!==""){a("body").append('<div id="DOMWindowLoader" style="z-index:10002;width:'+l.loaderWidth+"px;height:"+l.loaderHeight+'px;"><img src="'+l.loaderImagePath+'" /></div>');i()}a("body").append('<div id="DOMWindow" style="background-repeat:no-repeat;'+l.windowBGImage+";overflow:auto;padding:"+l.windowPadding+"px;display:none;height:"+l.height+"px;width:"+l.width+"px;background-color:"+l.windowBGColor+";border:"+l.borderSize+"px solid "+l.borderColor+'; position:absolute;z-index:10001"></div>');var s=a("#DOMWindow");switch(l.positionType){case"centered":g();if(l.height+50>b.viewPortHeight()){s.css("top",(l.fixedWindowY+b.scrollOffsetHeight())+"px")}break;case"absolute":s.css({top:(l.positionTop+b.scrollOffsetHeight())+"px",left:(l.positionLeft+b.scrollOffsetWidth())+"px"});if(a.fn.draggable){if(l.draggable){s.draggable({cursor:"move"})}}break;case"fixed":h();break;case"anchoredSingleWindow":var q=a(l.anchoredSelector).position();var n=q.left+l.positionLeft;var t=q.top+l.positionTop;s.css({top:t+"px",left:n+"px"});break}a(window).bind("scroll.DOMWindow",function(){if(l.overlay){f()}if(b.isIE6){d()}if(l.positionType=="centered"){g()}if(l.positionType=="fixed"){h()}});a(window).bind("resize.DOMWindow",function(){if(b.isIE6){d()}if(l.overlay){f()}if(l.positionType=="centered"){g()}});switch(l.windowSource){case"inline":s.append(a(l.windowSourceID).children());s.unload(function(){a(l.windowSourceID).append(s.children())});e();break;case"iframe":s.append('<iframe frameborder="0" hspace="0" wspace="0" src="'+l.windowSourceURL+'" name="DOMWindowIframe'+Math.round(Math.random()*1000)+'" style="width:100%;height:100%;border:none;background-color:#fff;" id="DOMWindowIframe" ></iframe>');a("#DOMWindowIframe").load(e());break;case"ajax":if(l.windowHTTPType=="post"){if(l.windowSourceURL.indexOf("?")!==-1){r=l.windowSourceURL.substr(0,l.windowSourceURL.indexOf("?"));p=c(l.windowSourceURL)}else{r=l.windowSourceURL;p={}}s.load(r,p,function(){e()})}else{if(l.windowSourceURL.indexOf("?")==-1){l.windowSourceURL+="?"}s.load(l.windowSourceURL+"&random="+(new Date().getTime()),function(){e()})}break}}};if(l.eventType){return this.each(function(m){a(this).bind(l.eventType,function(){k(this);return false})})}else{k()}};a.openDOMWindow=function(b){a.fn.openDOMWindow(b)}})(jQuery);function Yetii(){this.defaults={id:null,active:1,interval:null,wait:null,persist:null,tabclass:"tab",activeclass:"active",callback:null,leavecallback:null};this.activebackup=null;for(var a in arguments[0]){this.defaults[a]=arguments[0][a]}this.getTabs=function(){var g=[];var f=document.getElementById(this.defaults.id).getElementsByTagName("*");var e=new RegExp("(^|\\s)"+this.defaults.tabclass.replace(/\-/g,"\\-")+"(\\s|$)");for(var d=0;d<f.length;d++){if(e.test(f[d].className)){g.push(f[d])}}return g};this.links=document.getElementById(this.defaults.id+"-nav").getElementsByTagName("a");this.listitems=document.getElementById(this.defaults.id+"-nav").getElementsByTagName("li");this.show=function(d){for(var e=0;e<this.tabs.length;e++){this.tabs[e].style.display=((e+1)==d)?"block":"none";if((e+1)==d){this.addClass(this.links[e],this.defaults.activeclass);this.addClass(this.listitems[e],this.defaults.activeclass+"li")}else{this.removeClass(this.links[e],this.defaults.activeclass);this.removeClass(this.listitems[e],this.defaults.activeclass+"li")}}if(this.defaults.leavecallback&&(d!=this.activebackup)){this.defaults.leavecallback(this.defaults.active)}this.activebackup=d;this.defaults.active=d;if(this.defaults.callback){this.defaults.callback(d)}};this.rotate=function(e){this.show(this.defaults.active);this.defaults.active++;if(this.defaults.active>this.tabs.length){this.defaults.active=1}var d=this;if(this.defaults.wait){clearTimeout(this.timer2)}this.timer1=setTimeout(function(){d.rotate(e)},e*1000)};this.next=function(){var d=(this.defaults.active+1>this.tabs.length)?1:this.defaults.active+1;this.show(d);this.defaults.active=d};this.previous=function(){var d=((this.defaults.active-1)==0)?this.tabs.length:this.defaults.active-1;this.show(d);this.defaults.active=d};this.previous=function(){this.defaults.active--;if(!this.defaults.active){this.defaults.active=this.tabs.length}this.show(this.defaults.active)};this.gup=function(g){g=g.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var f="[\\?&]"+g+"=([^&#]*)";var e=new RegExp(f);var d=e.exec(window.location.href);if(d==null){return null}else{return d[1]}};this.parseurl=function(d){var f=this.gup(d);if(f==null){return null}if(parseInt(f)){return parseInt(f)}if(document.getElementById(f)){for(var e=0;e<this.tabs.length;e++){if(this.tabs[e].id==f){return(e+1)}}}return null};this.createCookie=function(g,f,e){if(e){var d=new Date();d.setTime(d.getTime()+(e*24*60*60*1000));var h="; expires="+d.toGMTString()}else{var h=""}document.cookie=g+"="+f+h+"; path=/"};this.readCookie=function(g){var f=g+"=";var d=document.cookie.split(";");for(var h=0;h<d.length;h++){var e=d[h];while(e.charAt(0)==" "){e=e.substring(1,e.length)}if(e.indexOf(f)==0){return e.substring(f.length,e.length)}}return null};this.contains=function(d,f,e){return d.indexOf(f,e)!=-1};this.hasClass=function(e,d){return this.contains(e.className,d," ")};this.addClass=function(e,d){if(!this.hasClass(e,d)){e.className=(e.className+" "+d).replace(/\s{2,}/g," ").replace(/^\s+|\s+$/g,"")}};this.removeClass=function(e,d){e.className=e.className.replace(new RegExp("(^|\\s)"+d+"(?:\\s|$)"),"$1");e.className.replace(/\s{2,}/g," ").replace(/^\s+|\s+$/g,"")};this.tabs=this.getTabs();this.defaults.active=(this.parseurl(this.defaults.id))?this.parseurl(this.defaults.id):this.defaults.active;if(this.defaults.persist&&this.readCookie(this.defaults.id)){this.defaults.active=this.readCookie(this.defaults.id)}this.activebackup=this.defaults.active;this.show(this.defaults.active);var c=this;for(var b=0;b<this.links.length;b++){this.links[b].customindex=b+1;this.links[b].onclick=function(){if(c.timer1){clearTimeout(c.timer1)}if(c.timer2){clearTimeout(c.timer2)}c.show(this.customindex);if(c.defaults.persist){c.createCookie(c.defaults.id,this.customindex,0)}if(c.defaults.wait){c.timer2=setTimeout(function(){c.rotate(c.defaults.interval)},c.defaults.wait*1000)}return false}}if(this.defaults.interval){this.rotate(this.defaults.interval)}}(function(a){a.fn.extend({customStyle:function(b){if(!a.browser.msie||(a.browser.msie&&a.browser.version>6)){return this.each(function(){var c=a(this).find(":selected");a(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">'+c.text()+"</span></span>").css({position:"absolute",opacity:0,fontSize:a(this).next().css("font-size")});var g=a(this).next();var f=parseInt(a(this).width())-parseInt(g.css("padding-left"))-parseInt(g.css("padding-right"));var e=g.find(":first-child");g.css({display:"inline-block"});e.css({width:f,display:"inline-block"});var d=parseInt(g.height())+parseInt(g.css("padding-top"))+parseInt(g.css("padding-bottom"));a(this).change(function(){e.text(a(this).find(":selected").text()).parent().addClass("changed")})})}}})})(jQuery);
