if(typeof NATHAGHIS=="undefined"||!NATHAGHIS){var NATHAGHIS={}}if(typeof NATHAGHIS.classes=="undefined"||!NATHAGHIS.classes){NATHAGHIS.classes={}}NATHAGHIS.classes.Loader=function(a){this.configs={require:["container","datasource","datatable","editor","imageloader","logger","utilities","paginator","selector","json"],base:"/scripts/ext/yui/",allowRollup:true,loadOptional:true,onSuccess:function(){if(null==NATHAGHIS.YUI.LOGGER.configs){NATHAGHIS.YUI.LOGGER=new NATHAGHIS.classes.Logger();NATHAGHIS.YUI.LOGGER.init()}NATHAGHIS.YUI.loadded=true;NATHAGHIS.YUI.addFunctionToLoad(null);NATHAGHIS.YUI.LOGGER.logInfo("Libraries loaded")},onFailure:function(b){alert("Failed to load librairies.");YAHOO.log("Failed to load librairies.")}};if(null!=a){if(null!=a.require){this.configs.require=a.require}if(null!=a.base){this.configs.base=a.base}if(null!=a.allowRollup){this.configs.allowRollup=a.allowRollup}if(null!=a.loadOptional){this.configs.loadOptional=a.loadOptional}if(null!=a.filter){this.configs.filter=a.filter}if(null!=a.onSuccess){this.configs.onSuccess=a.onSuccess}if(null!=a.onFailure){this.configs.onFailure=a.onFailure}}this.yuiLoader=null;this.externalModules=new Array()};NATHAGHIS.classes.Loader.prototype.appendRequire=function(a){this.configs.require.push(a)};NATHAGHIS.classes.Loader.prototype.setRequire=function(a){this.configs.require=a};NATHAGHIS.classes.Loader.prototype.setBase=function(a){this.configs.base=a};NATHAGHIS.classes.Loader.prototype.setOnSuccess=function(a){this.configs.onSuccess=a};NATHAGHIS.classes.Loader.prototype.setOnFailure=function(a){this.configs.onFailure=a};NATHAGHIS.classes.Loader.prototype.load=function(){this.yuiLoader=new YAHOO.util.YUILoader(this.configs);this.yuiLoader.insert()};NATHAGHIS.classes.Loader.prototype.addModule=function(a){this.yuiLoader=new YAHOO.util.YUILoader(this.configs);this.yuiLoader.addModule(a);this.yuiLoader.require(a.name);this.yuiLoader.insert()};if(typeof NATHAGHIS=="undefined"||!NATHAGHIS){var NATHAGHIS={}}if(typeof NATHAGHIS.animation=="undefined"||!NATHAGHIS.animation){NATHAGHIS.animation={mutex:0}}if(typeof NATHAGHIS.YUI=="undefined"||!NATHAGHIS.YUI){NATHAGHIS.YUI={toLoad:new Array(),loadded:false}}if(typeof NATHAGHIS.YUI.EFFECTS=="undefined"||!NATHAGHIS.YUI.EFFECTS){NATHAGHIS.YUI.EFFECTS={PhotoPanel:null,ToolTips:new Array()}}if(typeof NATHAGHIS.YUI.LOGGER=="undefined"||!NATHAGHIS.YUI.LOGGER){NATHAGHIS.YUI.LOGGER={}}if(typeof NATHAGHIS.classes=="undefined"||!NATHAGHIS.classes){NATHAGHIS.classes={}}NATHAGHIS.YUI.addFunctionToLoad=function(b){if(NATHAGHIS.YUI.loadded){if(null!=b){b()}else{while(NATHAGHIS.YUI.toLoad.length>0){try{NATHAGHIS.YUI.toLoad[0]()}catch(a){NATHAGHIS.YUI.LOGGER.logException(a)}NATHAGHIS.YUI.toLoad.shift()}}}else{NATHAGHIS.YUI.toLoad.push(b)}};NATHAGHIS.YUI.addFunctionToLoadOnDomReady=function(a){var b=function(){YAHOO.util.Event.onDOMReady(a)};NATHAGHIS.YUI.addFunctionToLoad(b)};NATHAGHIS.YUI.addModule=function(a,g,c,d,b){var f=new NATHAGHIS.classes.Loader({});var e={name:a,varName:g};if(null!=c){c="js"}e.type=c;if(null!=d){e.fullpath=d}if(null!=b){e.requires=b}f.addModule(e)};if("undefined"!=typeof(NATHAGHIS_loaderConfigs)){NATHAGHIS.YUI.loader=new NATHAGHIS.classes.Loader(NATHAGHIS_loaderConfigs)}else{NATHAGHIS.YUI.loader=new NATHAGHIS.classes.Loader()}NATHAGHIS.YUI.loader.load();NATHAGHIS.classes.Carousel=function(){this.photos=null;this.indexPhoto=0;this.image_panel=null;this.title=null;this.body=null;this.image=null;this.init()};NATHAGHIS.classes.Carousel.prototype.init=function(){this.image_panel=new YAHOO.widget.Panel("show_image",{fixedcenter:true,close:false,draggable:false,zindex:500,modal:true,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.3},visible:false});this.title=document.createElement("DIV");this.title.style.textAlign="left";icon=document.createElement("DIV");icon.setAttribute("style","float:right; margin: -15px -15px 0px 0px;");icon.setAttribute("onclick","javascript:NATHAGHIS.YUI.EFFECTS.PhotoPanel.hide();");icon.setAttribute("class","ics0_35_false");this.title.appendChild(icon);spanTitle=document.createElement("SPAN");spanTitle.appendChild(document.createTextNode(""));this.title.appendChild(spanTitle);this.image=document.createElement("img");this.body=document.createElement("DIV");this.body.setAttribute("id","photo_div");this.body.appendChild(this.image)};NATHAGHIS.classes.Carousel.prototype.setPhotos=function(a){this.photos=a};NATHAGHIS.classes.Carousel.prototype.setImageForIndex=function(a){if("undefined"==typeof(this.photos)){return}if(1==this.photos.length){this.setImage(this.photos[0].url,this.photos[0].width,this.photos[0].height,this.photos[0].title)}else{if(0<=a&&a<this.photos.length){this.setImage(this.photos[a].url,this.photos[a].width,this.photos[a].height,this.photos[a].title);this._createNavigationBarForIndex(a);this.indexPhoto=a}}};NATHAGHIS.classes.Carousel.prototype.setImage=function(c,b,a,d){this._setImage(c,b,a);this.title.childNodes[1].innerHTML=d};NATHAGHIS.classes.Carousel.prototype._createNavigationBarForIndex=function(e){var h=this.title.childNodes[2];if("undefined"!=typeof(h)){this.title.removeChild(h)}h=document.createElement("DIV");this.title.appendChild(h);this.title.setAttribute("class","icsS_background");h.setAttribute("style","float :right;");var c=document.createElement("UL");c.setAttribute("style","list-style-image:none;list-style-position:outside;list-style-type:none;display: inline-block;margin: 0;padding: 0;");for(i=0;i<this.photos.length;i++){var f=document.createElement("LI");f.setAttribute("style","display: inline-block; margin: 5px 2px;");if(i==e){f.setAttribute("class","icsS_radio_on")}else{f.setAttribute("class","icsS_radio_off")}f.setAttribute("onclick","javascript:NATHAGHIS.YUI.EFFECTS.PhotoPanel.setImageForIndex("+i+");");c.appendChild(f)}var g=e-1;if(g<0){g=this.photos.length-1}var b=e+1;if(b>=this.photos.length){b=0}var a=document.createElement("DIV");a.setAttribute("class","icsS_previous");a.style.display="inline-block";a.setAttribute("onclick","javascript:NATHAGHIS.YUI.EFFECTS.PhotoPanel.setImageForIndex("+g+");");var d=document.createElement("DIV");d.setAttribute("class","icsS_next");d.style.display="inline-block";d.setAttribute("onclick","javascript:NATHAGHIS.YUI.EFFECTS.PhotoPanel.setImageForIndex("+b+");");h.appendChild(c);h.appendChild(a);h.appendChild(d)};NATHAGHIS.classes.Carousel.prototype._setImage=function(d,c,b){var e;var a;if(screen.height-200<b){multiply=(screen.height-200)/b;a=b*multiply;e=c*multiply}else{a=b;e=c}this.image_panel.cfg.setProperty("width",e+"px");this.image.setAttribute("src",d);this.image.setAttribute("style","width:"+e+"px;height:"+a+"px;")};NATHAGHIS.classes.Carousel.prototype.render=function(){this.image_panel.setHeader(this.title);this.image_panel.setBody(this.body);this.image_panel.render(document.body);this.image_panel.show()};NATHAGHIS.classes.Carousel.prototype.hide=function(){this.image_panel.hide();delete this.image_panel;delete this.title;delete this.image;delete this.body};NATHAGHIS.classes.Logger=function(a){if(null!=a){this.configs=a}else{this.configs={logLevel:3,LogReader:{draggable:true,footerEnabled:true,height:"30em",logReaderEnabled:true,newestOnTop:true}}}if(true==this.configs.debug){this.configs.LogReader.thresholdMax=20000;this.configs.LogReader.verboseOutput=true;YAHOO.widget.Logger.maxStackEntries=20000}this.logReader=null;this.loggerContainerDiv=document.createElement("DIV")};NATHAGHIS.classes.Logger.prototype.init=function(){this.loggerContainerDiv.setAttribute("class","yui-skin-sam");var a=document.createElement("DIV");if(this.loggerContainerDiv.hasChildNodes()){this.loggerContainerDiv.childNodes[0]=a}else{this.loggerContainerDiv.appendChild(a)}this.logReader=new YAHOO.widget.LogReader(a,this.configs.LogReader);this.logReader.setTitle("NATHAGHIS Javascript Log Console");if(true==this.configs.debug){YAHOO.util.Event.onDOMReady(function(){if(null!=document.body){document.body.appendChild(NATHAGHIS.YUI.LOGGER.loggerContainerDiv)}else{YAHOO.util.Event.on(window,"load",function(){if(null!=document.body){document.body.appendChild(NATHAGHIS.YUI.LOGGER.loggerContainerDiv)}})}})}};NATHAGHIS.classes.Logger.prototype.log=function(b,a){if(2<this.configs.logLevel){YAHOO.log(b,a)}};NATHAGHIS.classes.Logger.prototype.logInfo=function(b,a){if(2<this.configs.logLevel){YAHOO.log(b,"INFO",a)}};NATHAGHIS.classes.Logger.prototype.logWarn=function(b,a){if(1<this.configs.logLevel){YAHOO.log(b,"WARN",a)}};NATHAGHIS.classes.Logger.prototype.logError=function(b,a){if(1<this.configs.logLevel){YAHOO.log(b,"ERROR",a)}};NATHAGHIS.classes.Logger.prototype.logTime=function(b,a){if(1<this.configs.logLevel){YAHOO.log(b,"TIME",a)}};NATHAGHIS.classes.Logger.prototype.logException=function(b,a){if(0<this.configs.logLevel){YAHOO.log("Error name: "+b.name,"ERROR",a)}if(1<this.configs.logLevel){YAHOO.log("Error message: "+b.message,"ERROR",a)}};NATHAGHIS.classes.Logger.prototype.show=function(){this.logReader.show()};NATHAGHIS.classes.Logger.prototype.hide=function(){this.logReader.hide()};NATHAGHIS.classes.SimpleTimer=function(b,c,a){this.callBack=b;if(!c){this.time=10000}else{this.time=c}if(!a){this.maxIterations=a}else{this.maxIteration=0}};NATHAGHIS.classes.SimpleTimer.prototype.run=function(){var a=this;(function(b,c){var d=0,e=setInterval(function(){if(c!=0&&++d>c){return clearInterval(e)}a.callBack()},b)})(this.time,0)};