/**
|*	Copyright (c) 2010-2011 Ideal Web Technologies
|*	This file is only to be used with the consent of Ideal Web Technologies 
|*	and may not be redistributed in whole or significant part!  By using
|*	this file, you agree to the Ideal Web Technologies' Terms of Service
|*	at www.idealwebtech.com/documents/tos.html
**/
function var_dump(obj,maxDepth,maxStringLength,curDepth){if(!maxDepth){maxDepth=-1;}if(!maxStringLength){maxStringLength=-1;}if(!curDepth){curDepth=0;}if(obj===null){return"(null)\n";}else
{var output=typeof obj;if(output=='object'){if(obj.length){output='array';}output="("+output+")";curDepth++;if(maxDepth!=-1&&curDepth>maxDepth){return output+"\n";}var tab='';for(i=0;i<curDepth;i++){tab+="\t";}output+=" :\n";for(var i in obj){output+=tab+"["+i+"] : ";try{output+=var_dump(obj[i],maxDepth,maxStringLength,curDepth);}catch(e){output+="(error) "+e+"\n";}}}else if(output=='function'||output=='undefined'){output="("+output+")\n";}else
{if(output=='string'){if(obj==''){output='empty string';}else if(maxStringLength!=-1&&obj.length>maxStringLength){obj=obj.substr(0,maxStringLength)+" ...";}}output="("+output+") "+obj+"\n";}return output;}};function alert_r(obj,maxDepth,maxStringLength){alert(var_dump(obj,maxDepth,maxStringLength));};if(!Array.prototype.forEach){Array.prototype.forEach=function(callbackfn,thisArg){var T,O=Object(this),len=O.length>>>0,k=0;if(!callbackfn||!callbackfn.call){throw new TypeError();}if(thisArg){T=thisArg;}while(k<len){var Pk=String(k),kPresent=O.hasOwnProperty(Pk),kValue;if(kPresent){kValue=O[Pk];callbackfn.call(T,kValue,k,O);}k++;}};}String.prototype.replaceAll=function(find,replace){return this.split(find).join(replace);};(function(window,undefined){var document=window.document;var iwt_popupOverlay=function(id,html,settings){if(window.iwt.getById('iwt_popup_backdrop')){this.backdrop=window.iwt.getById('iwt_popup_backdrop');}else
{this.backdrop=document.createElement('div');this.backdrop.id='iwt_popup_backdrop';window.iwt.addEvent(this.backdrop,"click",function(e){if(window.iwt.openPopupOverlay){window.iwt.openPopupOverlay.close();}});document.body.appendChild(this.backdrop);}if(window.iwt.getById(id+'_popup')){document.body.removeChild(window.iwt.getById(id+'_popup'));}this.popup=document.createElement('div');this.popup.id=id+'_popup';this.popup.className='iwt_popup_wrapper';this.popup.innerHTML='<div id="'+id+'_inner" class="iwt_popup_inner">'+html+'</div>';if(settings){if(settings.height){this.popup.firstChild.style.maxHeight=settings.height+'px';}if(settings.width){this.popup.firstChild.style.width=settings.width+'px';}}window.iwt.each(window.iwt.getByClassName('close_popup',this.popup),function(i){window.iwt.addEvent(i,"click",function(e){if(window.iwt.openPopupOverlay){window.iwt.openPopupOverlay.close();}});});document.body.appendChild(this.popup);this.popup.style.marginLeft=-(this.popup.offsetWidth/2)+'px';this.popup.style.marginTop=-(this.popup.offsetHeight/2)+'px';return this;};iwt_popupOverlay.prototype.show=function(){if(window.iwt.openPopupOverlay){window.iwt.openPopupOverlay.close();}window.iwt.showElement(this.backdrop);window.iwt.showElement(this.popup);window.iwt.openPopupOverlay=this;return this;};iwt_popupOverlay.prototype.close=function(){window.iwt.hideElement(this.backdrop);window.iwt.hideElement(this.popup);window.iwt.openPopupOverlay=null;return this;};var iwt=function(){this.version='1.0.0 Alpha';this.longVersion='10000.a';this.initalized=false;this.initalizedTime=null;this.soundElement=null;this.images={loadingBar:'iwt/shared/images/loading_bar.gif'};this.popup=iwt_popupOverlay;if(window.iwt&&window.iwt.longVersion>=this.longVersion){return window.iwt;}return this;};iwt.prototype.init=function(){if(!this.initalized){this.initalizedTime=this.timenow();this.setWindowSize();this.addEvent(window,"resize",function(){window.iwt.setWindowSize();});this.initalized=true;}};iwt.prototype.loadJS=function(filename){var script=document.createElement('script');script.type='text/javascript';script.src=filename;document.getElementsByTagName('head')[0].appendChild(script);};iwt.prototype.loadCSS=function(filename){var link=document.createElement('link');link.rel='stylesheet';link.type='text/css';link.href=filename;document.getElementsByTagName('head')[0].appendChild(link);};iwt.prototype.playSound=function(filename){this.removeSound();this.soundElement=document.createElement("embed");this.soundElement.setAttribute("src",filename);this.soundElement.setAttribute("hidden",true);this.soundElement.setAttribute("autostart",true);document.body.appendChild(this.soundElement);};iwt.prototype.removeSound=function(){if(this.soundElement){document.body.removeChild(this.soundElement);this.soundElement=null;}};iwt.prototype.timenow=function(){return Math.floor(new Date().getTime()/1000);};iwt.prototype.ajaxGET=function(url,callback){return YAHOO.util.Connect.asyncRequest('GET',url,callback);};iwt.prototype.ajaxPOST=function(url,callback,postData){return YAHOO.util.Connect.asyncRequest('POST',url,callback,postData+'&securitytoken='+SECURITYTOKEN);};iwt.prototype.ajaxPOSTform=function(form,callback){YAHOO.util.Connect.setForm(form);return YAHOO.util.Connect.asyncRequest('POST',form.action,callback,'&securitytoken='+SECURITYTOKEN);};iwt.prototype.ajaxAbort=function(ajaxObj,callback){return YAHOO.util.Connect.abort(ajaxObj,callback);};iwt.prototype.each=function(obj,func){for(var i in obj){func(obj[i],i,obj);}};iwt.prototype.forEach=function(obj,func){this.each(obj,func);};iwt.prototype.in_array=function(needle,haystack){if(typeof haystack!=="object"||typeof haystack.length!=="number"){return false;}for(var i=0;i<haystack.length;i++){if(haystack[i]==needle){return true;}}return false;};iwt.prototype.rand=function(min,max,decimals){var decimals_multiplier=1;for(var i=0;i<decimals;i++){decimals_multiplier*=10;}if(!min){min=0;}if(!max){max=min+100;}var value=((max-min)*decimals_multiplier)+1;value*=Math.random();value+=min*decimals_multiplier;return Math.floor(value)/decimals_multiplier;};iwt.prototype.setCookie=function(name,value,secs,settings){var path=' path=/;';var domain='',expires='',secure='';if(secs!=null&&secs!=0){var date=new Date();date.setTime(date.getTime()+(secs*1000));expires=" expires="+date.toUTCString()+";";}if(typeof settings==="object"){if(settings.path){path=" path="+settings.path+";";}if(settings.domain){domain=" domain="+settings.domain+";";}if(settings.secure&&secs!=-1){secure=" secure=true;";}}document.cookie=name+"="+escape(value)+";"+expires+path+domain+secure;return navigator.cookieEnabled;};iwt.prototype.unsetCookie=function(name,settings){return this.setCookie(name,'',-1,settings);};iwt.prototype.getCookie=function(name){var cookie_value=null;if(document.cookie.length>0){var value_start=document.cookie.indexOf("; "+name+"=");if(value_start==-1&&document.cookie.substring(0,name.length+1)==(name+"=")){value_start=-2;}if(value_start!=-1){value_start+=name.length+3;var value_end=document.cookie.indexOf(";",value_start);if(value_end==-1){value_end=document.cookie.length;}cookie_value=unescape(document.cookie.substring(value_start,value_end));}}return cookie_value;};iwt.prototype.$=function(){if(arguments.length==1){return document.getElementById(arguments[0]);}var elements=new Array();for(var i=0;i<arguments.length;i++){var element=this.getById(arguments[i]);if(element){elements.push(element);}}return elements;};iwt.prototype.getById=function(name){return document.getElementById(name);};iwt.prototype.getByName=function(name,scope){if(!scope){scope=document;}return scope.getElementsByName(name);};iwt.prototype.getByTagName=function(tagName,scope){if(!scope){scope=document;}return scope.getElementsByTagName(tagName);};iwt.prototype.getByTag=function(tagName,scope){return this.getByTagName(tagName,scope);};iwt.prototype.getByClassName=function(className,scope){if(!scope){scope=document;}if(typeof scope.getElementsByClassName==='function'){return scope.getElementsByClassName(className);}var elements=this.getAll(scope);var returnElements=new Array();for(var i=0;i<elements.length;i++){if(this.hasClass(elements[i],className)){returnElements.push(elements[i]);}}return returnElements;};iwt.prototype.getByClass=function(className,scope){return this.getByClassName(className,scope);};iwt.prototype.getAll=function(scope){return this.getByTagName('*',scope);};iwt.prototype.str2HTML=function(str){var div=document.createElement('div');div.innerHTML=str;return div.childNodes;};iwt.prototype.getNodeValue=function(obj){return obj.firstChild.nodeValue;};iwt.prototype.fetchElement=function(element){if(typeof element==="string"){return this.getById(element);}else if(typeof element==="object"&&element.style){return element;}else{return null;}};iwt.prototype.showElement=function(element){element=this.fetchElement(element);if(element){element.style.display='';}return element;};iwt.prototype.hideElement=function(element){element=this.fetchElement(element);if(element){element.style.display='none';}return element;};iwt.prototype.toggleElement=function(element){element=this.fetchElement(element);if(element){if(element.style.display==''){return this.hideElement(element);}else
{return this.showElement(element);}}return null;};iwt.prototype.hasClass=function(element,className){element=this.fetchElement(element);if(element){classes=element.className.split(' ');for(var i=0;i<classes.length;i++){if(classes[i]==className){return true;}}}return false;};iwt.prototype.addClass=function(element,className){element=this.fetchElement(element);if(element){element.className+=' '+className;}return element;};iwt.prototype.removeClass=function(element,className){element=this.fetchElement(element);if(element){classes=element.className.split(' ');for(var i=0;i<classes.length;i++){if(classes[i]==className){classes[i]='';}}element.className=classes.join(' ');}return element;};iwt.prototype.toggleClass=function(element,className){element=this.fetchElement(element);if(element){if(this.hasClass(element,className)){return this.removeClass(element,className);}else
{return this.addClass(element,className);}}return null;};iwt.prototype.setOpacity=function(element,opacity){element=this.fetchElement(element);if(element){element.style.opacity=opacity;element.style.filter='alpha(opacity='+opacity*100+')';}return element;};iwt.prototype.elementPosition=function(element){element=this.fetchElement(element);if(element){if(typeof this.windowHeight==="undefined"||typeof this.windowWidth==="undefined"){this.setWindowSize();}var top=element.offsetTop;var left=element.offsetLeft;var bottom=this.windowHeight-element.offsetHeight;var right=this.windowWidth-element.offsetWidth;while(element=element.offsetParent){top+=element.offsetTop;left+=element.offsetLeft;}return{top:top,left:left,bottom:bottom-top,right:right-left};}return null;};iwt.prototype.flashTitle=function(titleOne,titleTwo,millisec){titleOne=titleOne.replace('"','\"');titleTwo=titleTwo.replace('"','\"');return setInterval('document.title = ((document.title == "'+titleOne+'") ? "'+titleTwo+'" : "'+titleOne+'");',millisec);};iwt.prototype.setWindowSize=function(){if(document.getElementsByTagName('html')&&document.getElementsByTagName('html')[0].clientWidth){this.windowWidth=document.getElementsByTagName('html')[0].clientWidth;this.windowHeight=document.getElementsByTagName('html')[0].clientHeight;}else if(window.innerWidth){this.windowWidth=window.innerWidth;this.windowHeight=window.innerHeight;}else if(document.documentElement&&document.documentElement.clientWidth){this.windowWidth=document.documentElement.clientWidth;this.windowHeight=document.documentElement.clientHeight;}else if(document.body&&document.body.clientWidth){this.windowWidth=document.body.clientWidth;this.windowHeight=document.body.clientHeight;}else
{this.windowHeight=this.windowWidth=-1;}return;};iwt.prototype.newWindow=function(url,properties){var specs='';var name="_blank";if(typeof properties==='object'){if(properties.name){var name=properties.name;}for(var i in properties){if(i!='name'){specs+=(specs?',':'')+i+"="+properties[i];}}}var popup=window.open(url,name,specs);if(window.focus){popup.focus();}return popup;};iwt.prototype.addEvent=function(element,type,func){YAHOO.util.Event.on(element,type,func);};iwt.prototype.preventDefault=function(e){if(!e)var e=window.event;if(e.preventDefault){e.preventDefault();}else
{e.returnValue=false;}};iwt.prototype.stopPropagation=function(e){if(!e)var e=window.event;if(e.stopPropagation){e.stopPropagation();e.preventDefault();}else
{e.cancelBubble=true;e.returnValue=false;}};window.iwt=new iwt();window.iwt.addEvent(window,"load",function(){window.iwt.init();});})(window);
