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