if(typeof BIA=="undefined"){var BIA={}}BIA.namespace=function(){var b=arguments,g=null,e,c,f;for(e=0;e<b.length;++e){f=b[e].split(".");g=BIA;for(c=(f[0]=="BIA")?1:0;c<f.length;++c){g[f[c]]=g[f[c]]||{};g=g[f[c]]}}return g};BIA.namespace("autoScroll");BIA.namespace("keyNav");BIA.namespace("forms");BIA.namespace("util");BIA.forms.CheckableField=function(b,c,a){if(b&&c){this.formName=b;this.fieldName=c;this.checkParams=a;this.fieldId=b+BIA.util.capitalize(this.fieldName);this.field=document.getElementById(this.fieldId);this.blockId=this.fieldId+"Block";this.block=document.getElementById(this.blockId);this.statusText=YAHOO.util.Dom.getElementsByClassName("statusText","p",this.block)[0];YAHOO.util.Event.addListener(this.field,"blur",this.check,this,true);YAHOO.util.Event.addListener(this.field,"focus",this.clearStatus,this,true)}};BIA.forms.CheckableField.prototype={check:function(){if(this.checkParams&&this.checkParams.checkAjaxAction!=undefined){this.checkAjax()}},getValue:function(){return this.field.value},setValue:function(a){this.field.value=a},checkAjax:function(){this.setStatus("loading");url="/actions/"+this.checkParams.checkAjaxAction+"?"+encodeURIComponent(this.fieldName)+"="+encodeURIComponent(this.field.value);callback={success:this.checkAjaxSuccess,failure:this.checkAjaxFailure,scope:this};YAHOO.util.Connect.asyncRequest("GET",url,callback)},checkAjaxSuccess:function(a){if(a.responseText&&a.responseText!="ok"){this.setStatus("error",a.responseText)}else{this.setStatus("ok","&nbsp;")}},checkAjaxFailure:function(a){this.setStatus("error","Error checking value")},clearStatus:function(){this.setStatus("")},setStatus:function(c,d){var a=["loading","ok","error"];for(var b=0;b<a.length;b++){if(c==a[b]){YAHOO.util.Dom.addClass(this.block,a[b])}else{YAHOO.util.Dom.removeClass(this.block,a[b])}}if(this.statusText&&d!=undefined){this.statusText.innerHTML=d}}};BIA.forms.CheckableDateField=function(b,c,a){this.formName=b;this.fieldName=c;this.checkParams=a;this.fieldId=b+BIA.util.capitalize(c);this.blockId=this.fieldId+"Block";this.block=document.getElementById(this.blockId);this.statusText=YAHOO.util.Dom.getElementsByClassName("statusText","p",this.block)[0];YAHOO.util.Event.addListener(this.fieldId+"Day","blur",this.check,this,true);YAHOO.util.Event.addListener(this.fieldId+"Month","blur",this.check,this,true);YAHOO.util.Event.addListener(this.fieldId+"Year","blur",this.check,this,true);YAHOO.util.Event.addListener(this.fieldId+"Day","focus",this.clearStatus,this,true);YAHOO.util.Event.addListener(this.fieldId+"Month","focus",this.clearStatus,this,true);YAHOO.util.Event.addListener(this.fieldId+"Year","focus",this.clearStatus,this,true)};BIA.forms.CheckableDateField.prototype=new BIA.forms.CheckableField();BIA.forms.CheckableDateField.prototype.check=function(){dayField=document.getElementById(this.fieldId+"Day");monthField=document.getElementById(this.fieldId+"Month");yearField=document.getElementById(this.fieldId+"Year");day=dayField.value;month=monthField.options[monthField.selectedIndex].value;year=yearField.value;if(day&&month&&year){if(this.checkParams.checkAjaxAction!=undefined){this.checkAjax(year,month,day)}}return true};BIA.forms.CheckableDateField.prototype.checkAjax=function(b,c,a){this.setStatus("loading");url="/actions/"+this.checkParams.checkAjaxAction+"?"+encodeURIComponent(this.fieldName+"Year")+"="+encodeURIComponent(b)+"&"+encodeURIComponent(this.fieldName+"Month")+"="+encodeURIComponent(c)+"&"+encodeURIComponent(this.fieldName+"Day")+"="+encodeURIComponent(a);callback={success:this.checkAjaxSuccess,failure:this.checkAjaxFailure,scope:this};YAHOO.util.Connect.asyncRequest("GET",url,callback)};BIA.forms.voteButtons=function(b,e,a,c,d){var f=document.getElementById(b);if(!f){return false}this.plus=document.createElement("a");this.plus.href="#";if(d){this.plus.className=e+"Disabled"}else{if(c>0){this.plus.className=e+"On"}else{this.plus.className=e}}f.parentNode.appendChild(this.plus);this.min=document.createElement("a");this.min.href="#";if(d){this.min.className=a+"Disabled"}else{if(c<0){this.min.className=a+"On"}else{this.min.className=a}}f.parentNode.appendChild(this.min);this.hiddenField=document.createElement("input");this.hiddenField.type="hidden";this.hiddenField.name=b;this.hiddenField.value=c;f.parentNode.appendChild(this.hiddenField);this.plusName=e;this.minName=a;YAHOO.util.Event.addListener(this.plus,"click",this.handleClick,this,true);YAHOO.util.Event.addListener(this.min,"click",this.handleClick,this,true);YAHOO.util.Event.addListener(this.plus,"keydown",this.handleClick,this,true);YAHOO.util.Event.addListener(this.min,"keydown",this.handleClick,this,true)};BIA.forms.voteButtons.prototype.handleClick=function(b){if(b.keyCode&&b.keyCode!=32){return true}YAHOO.util.Event.preventDefault(b);if(this.plus==YAHOO.util.Event.getTarget(b)){if(this.plus.className!=this.plusName+"Disabled"){if(this.plus.className==this.plusName+"On"){this.plus.className=this.plusName;this.hiddenField.value="0"}else{this.plus.className=this.plusName+"On";this.min.className=this.minName;this.hiddenField.value="1"}}}else{if(this.min.className!=this.minName+"Disabled"){if(this.min.className==this.minName+"On"){this.min.className=this.minName;this.hiddenField.value="0"}else{this.min.className=this.minName+"On";this.plus.className=this.plusName;this.hiddenField.value="-1"}}}var a=YAHOO.util.Dom.getAncestorByTagName(this.hiddenField,"form");YAHOO.util.Dom.addClass(a,"changed")};BIA.forms.map=function(a){if(!GBrowserIsCompatible()){return false}this.name=a;this.countryField=new BIA.forms.CheckableField("user","country");this.cityField=new BIA.forms.CheckableField("user","city");this.stateField=document.getElementById("userState");this.positionLatField=document.getElementById("userPositionLat");this.positionLongField=document.getElementById("userPositionLng");this.cityFindButton=document.getElementById("userCityFindButton");this.mapDiv=document.getElementById("map");this.map=new GMap2(this.mapDiv,{mapTypes:[G_HYBRID_MAP],draggableCursor:"crosshair",draggingCursor:"crosshair"});this.map.setCenter(new GLatLng(37,-95),3);this.map.addControl(new GSmallMapControl());YAHOO.util.Event.addListener(document,"unload",GUnload);GEvent.bind(this.map,"click",this,this.mapClick);YAHOO.util.Event.addListener(this.countryField.field,"change",this.loadCountry,this,true);YAHOO.util.Event.addListener(this.cityField.field,"keypress",this.cityKeyPress,this,true);YAHOO.util.Event.addListener(this.cityFindButton,"click",this.loadCity,this,true)};BIA.forms.map.prototype.loadCountry=function(b){var a=this.countryField.getValue();callback={success:this.loadPositionSuccess,failure:this.loadPositionFailure,scope:this};YAHOO.util.Connect.asyncRequest("GET","/actions/user.getCountry?countryID="+a,callback);this.countryField.setStatus("loading");this.cityField.setValue("");this.cityField.setStatus("");this.stateField.value="";this.positionLatField.value="";this.positionLongField.value=""};BIA.forms.map.prototype.cityKeyPress=function(a){if(a&&a.keyCode&&a.keyCode==13){YAHOO.util.Event.preventDefault(a);this.loadCity()}};BIA.forms.map.prototype.loadCity=function(){var b=this.cityField.getValue();var a=this.countryField.getValue();if(b){this.cityField.setStatus("loading")}callback={success:this.loadPositionSuccess,failure:this.loadPositionFailure,scope:this};YAHOO.util.Connect.asyncRequest("GET","/actions/user.getCountry?countryID="+a+"&city="+b,callback)};BIA.forms.map.prototype.loadPositionSuccess=function(c){var d=c.responseXML.getElementsByTagName("country")[0];var b=parseInt(d.getAttribute("code"));var f=parseFloat(d.getAttribute("lat"));var h=parseFloat(d.getAttribute("long"));var j=parseInt(d.getAttribute("zoom"));var a="";var e="";this.countryField.setStatus("ok");if(j<1){j=5}var g=c.responseXML.getElementsByTagName("state");if(g.length){a=g[0].getAttribute("name")}g=c.responseXML.getElementsByTagName("city");if(g.length){e=g[0].getAttribute("name");f=parseFloat(g[0].getAttribute("lat"));h=parseFloat(g[0].getAttribute("long"));j=11}if(this.cityField.getValue()&&!e){this.cityField.setStatus("error","Unknown city");return}if(f&&h){point=new GLatLng(f,h);this.map.setCenter(point,j)}if(e){this.positionLatField.value=point.lat();this.positionLongField.value=point.lng();this.setMarker(true);this.stateField.value=a;this.cityField.setValue(e+(a?", "+a:""));this.cityField.setStatus("ok","")}};BIA.forms.map.prototype.loadPositionFailure=function(a){alert("error loading position")};BIA.forms.map.prototype.mapClick=function(c,a){if(a){var b=this.map.getZoom();if(b>10){this.positionLatField.value=a.lat();this.positionLongField.value=a.lng();this.setMarker(false)}else{if(b<20){this.map.setZoom(b+2);this.map.setCenter(a)}}}};BIA.forms.map.prototype.setMarker=function(b){if(this.positionLatField.value&&this.positionLongField.value){point=new GLatLng(this.positionLatField.value,this.positionLongField.value);var a=new GIcon();a.image="http://www.urguide.tv/gfx/gmaps-icon.png";a.shadow="http://www.urguide.tv/gfx/gmaps-shade.png";a.iconSize=new GSize(34,28);a.shadowSize=new GSize(34,28);a.iconAnchor=new GPoint(12,28);a.infoWindowAnchor=new GPoint(5,1);marker=new GMarker(point,a);this.map.clearOverlays();this.map.addOverlay(marker);if(b){this.map.setCenter(point)}}};BIA.forms.DDList=function(c,b,d){if(!YAHOO.util.DDTarget){throw new Error("DDList failed. Dependency YAHOO.util.dragdrop not found")}if(!YAHOO.example.DDList){throw new Error("DDList failed. Dependency YAHOO.example.DDList not found")}this.target=document.getElementById(c);if(!this.target){throw new Error("DDList failed. Target '"+c+"' not found.")}YAHOO.util.Dom.addClass(this.target,"dd");this.form=YAHOO.util.Dom.getAncestorByTagName(this.target,"form");this.formField=document.createElement("input");this.formField.type="hidden";this.formField.name=b?b:c;this.form.insertBefore(this.formField,this.form.firstChild);this.sGroup=d?d:c;this.DDTarget=new YAHOO.util.DDTarget(c,this.sGroup);this.backup=[];for(var a=0;a<this.target.childNodes.length;a++){if(this.target.childNodes[a].id){new YAHOO.example.DDList(this.target.childNodes[a].id,this.sGroup,{},this.formField);this.backup[this.backup.length]=this.target.childNodes[a]}}this.updateFormField();YAHOO.util.Event.addListener(this.form,"reset",this.reset,this,true)};BIA.forms.DDList.prototype.reset=function(a){for(i=this.target.childNodes.length-1;i>=0;i--){this.target.removeChild(this.target.childNodes[i])}for(i=0;i<this.backup.length;i++){this.target.appendChild(this.backup[i])}this.updateFormField()};BIA.forms.DDList.prototype.addElement=function(a){if(!a.id){return false}for(var b=0;b<this.target.childNodes.length;b++){if(this.target.childNodes[b].id==a.id){return false}}this.target.appendChild(a);new YAHOO.example.DDList(a,this.sGroup,{},this.formField);YAHOO.util.Dom.addClass(this.form,"changed");this.updateFormField()};BIA.forms.DDList.prototype.deleteElement=function(d){var c=YAHOO.util.Dom.get(d);var a=c.parentNode;var b=c.tagName;a.removeChild(c);YAHOO.util.Dom.addClass(this.form,"changed");this.updateFormField()};BIA.forms.DDList.prototype.updateFormField=function(){this.formField.value="";for(var a=0;a<this.target.childNodes.length;a++){if(this.target.childNodes[a].id){this.formField.value+=this.target.childNodes[a].id+";"}}};BIA.forms.CommentRating=function(a){this.id=a;this.rateURL="/actions/item.comment.rate/"+a;this.button=document.getElementById("commentRateButton"+a);this.rating=document.getElementById("commentRating"+a);YAHOO.util.Event.addListener(this.button,"click",this.rate,this,true)};BIA.forms.CommentRating.prototype.rate=function(b){YAHOO.util.Event.preventDefault(b);try{document.body.style.cursor="progress"}catch(b){}callback={success:this.rateSuccess,failure:this.rateFailure,scope:this};var a=new Date().getTime();YAHOO.util.Connect.asyncRequest("GET",this.rateURL+"?ajax=1&nocache="+a,callback)};BIA.forms.CommentRating.prototype.rateSuccess=function(c){try{document.body.style.cursor="auto"}catch(b){}var a=this.button.getElementsByTagName("img")[0];a.src="/gfx/icon_done.gif";if(isNaN(c.responseText)){alert(c.responseText)}else{this.rating.innerHTML="<span>+"+c.responseText+"</span>"}};BIA.forms.CommentRating.prototype.rateFailure=function(b){try{document.body.style.cursor="auto"}catch(a){}alert("Error rating this comment")};BIA.forms.formSubmit=function(c,a){if(!a){a=YAHOO.util.Event.getTarget(c)}var f=typeof window.pageYOffset!="undefined"?window.pageYOffset:document.documentElement.scrollTop;for(i=0;i<a.elements.length;i++){if(a.elements[i].tagName.toLowerCase()=="input"&&a.elements[i].name=="goto"){if(!a.elements[i].value){a.elements[i].value=document.location.pathname}if(a.elements[i].value.indexOf("#")==-1){a.elements[i].value+="#scroll"+f}}if(a.elements[i].tagName.toLowerCase()=="input"&&a.elements[i].type=="password"&&a.elements[i].value){var b=a.elements[i];var d=document.createElement("input");d.name=b.name+"Hash";d.type="hidden";d.value=SHA1(b.value);a.appendChild(d);b.value=""}}YAHOO.util.Dom.addClass(a,"disabled");return true};BIA.forms.init=function(b){var a=document.getElementsByTagName("form");for(i=0;i<a.length;i++){YAHOO.util.Event.addListener(a[i],"submit",BIA.forms.formSubmit)}};YAHOO.util.Event.addListener(window,"load",BIA.forms.init);BIA.forms.AjaxForm=function(a){this.form=document.getElementById(a);if(!this.form){return false}this.block=YAHOO.util.Dom.getAncestorByClassName(this.form,"block");if(!this.block){return false}this.windowID=this.block.id.substring(this.block.id.lastIndexOf("-")+1);for(var b=0;b<this.form.elements.length;b++){if(this.form.elements[b].name=="goto"){this.form.elements[b].value="/ajax"+document.location.pathname+"?windowID="+this.windowID;break}}YAHOO.util.Event.addListener(this.form,"submit",this.submit,this,true)};BIA.forms.AjaxForm.prototype.submit=function(d){YAHOO.util.Event.preventDefault(d);var c=this.form.getAttribute("method");var a=this.form.getAttribute("action");var b={success:this.handleSuccess,failure:this.handleFailure,scope:this};YAHOO.util.Connect.setForm(this.form);YAHOO.util.Connect.asyncRequest(c,a,b)};BIA.forms.AjaxForm.prototype.handleSuccess=function(o){if(!o.responseXML){if(o.responseText&&o.responseText.toLowerCase()!="ok"){BIA.util.setNotification(o.responseText)}YAHOO.util.Dom.removeClass(this.form,"changed");return true}var notificationXML=o.responseXML.getElementsByTagName("notification");if(notificationXML.length==1){o.notification=BIA.util.getNodeText(notificationXML[0])}var contentXML=o.responseXML.getElementsByTagName("content");if(contentXML.length==1){o.content=BIA.util.getNodeText(contentXML[0])}if(o.notification){BIA.util.setNotification(o.notification)}if(o.content){this.block.innerHTML=o.content;var scripts=this.block.getElementsByTagName("script");for(var n=0;n<scripts.length;n++){if(scripts[n].type=="text/javascript"){if(scripts[n].text){eval(scripts[n].text)}else{if(scripts[n].childNodes[0].nodeValue){eval(scripts[n].childNodes[0].nodeValue)}}}}}};BIA.forms.AjaxForm.prototype.handleFailure=function(a){throw new Error("Failure loading link content");console.log(a)};BIA.forms.AjaxLink=function(a,b){this.href="";this.block="";if(b){this.block=document.getElementById(b)}if(typeof(a)=="string"){this.href="/ajax"+a}else{if(a.tagName.toLowerCase()=="a"){this.href="/ajax"+((a.pathname.indexOf("/")!=0)?"/":"")+a.pathname;if(a.search){this.href+=a.search}if(!this.block){this.block=YAHOO.util.Dom.getAncestorByClassName(a,"block")}}}if(!this.block){this.block=document.getElementById("block-main")}if(!this.block){throw new Error("No target for AjaxLink")}};BIA.forms.AjaxLink.prototype=new BIA.forms.AjaxForm();BIA.forms.AjaxLink.prototype.click=function(d){if(d){YAHOO.util.Event.preventDefault(d)}var c={success:this.handleSuccess,failure:this.handleFailure,scope:this};var b=new Date().getTime();var a=this.href+(this.href.indexOf("?")!=-1?"&":"?")+"nocache="+b;YAHOO.util.Connect.asyncRequest("get",a,c)};BIA.forms.ajaxLinkClick=function(b,c){var a=new BIA.forms.AjaxLink(b,c);a.click();return false};BIA.forms.SWFUploadForm=function(c,b){this.id=BIA.forms.SWFUploadForm.count++;BIA.forms.SWFUploadForm.instances[this.id]=this;this.form=document.getElementById(c);if(!this.form){throw new Error("Invalid formID")}YAHOO.util.Dom.addClass(this.form,"uploadQueue");var a=this.form.getAttribute("action");a+=(a.lastIndexOf("?")=="-1"?"?":"&")+"passport="+escape(BIA.util.getCookie("passport"))+"&goto=nowhere";this.settings={upload_script:a,target:c,flash_path:"/flash/swfupload.swf",flash_target:"swfuploadTarget",allowed_filesize:8192,allowed_filetypes:"*.*",allowed_filetypes_description:"All files",browse_link_innerhtml:"Upload file",upload_link_innerhtml:"Upload queue",browse_link_class:"queueButton",upload_link_class:"uploadButton",flash_loaded_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].swfu.flashLoaded",upload_file_queued_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].fileQueued",upload_file_start_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].fileStart",upload_progress_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].progress",upload_file_complete_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].fileComplete",upload_file_cancel_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].fileCancel",upload_queue_complete_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].queueComplete",upload_queue_cancel_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].queueCancel",upload_error_callback:"BIA.forms.SWFUploadForm.instances["+this.id+"].error",auto_upload:true,create_ui:false,allow_multiple:false};for(key in b){this.settings[key]=b[key]}YAHOO.util.Event.onAvailable(c,this.handleOnAvailable,this,true)};BIA.forms.SWFUploadForm.count=0;BIA.forms.SWFUploadForm.instances=Array();BIA.forms.SWFUploadForm.prototype.handleOnAvailable=function(a){this.swfu=new SWFUpload(this.settings)};BIA.forms.SWFUploadForm.prototype.fileQueued=function(e,f){if(!this.settings.allow_multiple){BIA.util.hideElement("SWFUpload_"+this.id+"BrowseBtn");if(f>1){this.swfu.cancelFile(e.id);return}}var j=document.createElement("div");j.id="queue_"+e.id;j.className="uploadItem";var b=document.createElement("a");b.href="#";b.setAttribute("onclick","swfuploads["+this.id+'].swfu.cancelFile("'+e.id+'");');var c=document.createElement("img");c.src="/gfx/admin/icons/16/del.gif";c.className="ico16";b.appendChild(c);j.appendChild(b);var h=document.createElement("p");h.innerHTML=e.name;j.appendChild(h);var g=document.createElement("div");g.className="uploadBar";var d=document.createElement("div");d.id="progress_"+e.id;d.style.width="0%";g.appendChild(d);j.appendChild(g);this.form.appendChild(j)};BIA.forms.SWFUploadForm.prototype.fileStart=function(b,a,c){};BIA.forms.SWFUploadForm.prototype.progress=function(b,c){var a=Math.ceil(c*100/b.size);document.getElementById("progress_"+b.id).style.width=a+"%"};BIA.forms.SWFUploadForm.prototype.fileComplete=function(a){YAHOO.util.Dom.addClass(document.getElementById("queue_"+a.id),"uploadDone")};BIA.forms.SWFUploadForm.prototype.fileCancel=function(a,b){var c="";if((c=document.getElementById("queue_"+a.id))!==null){YAHOO.util.Dom.addClass(c,"uploadError");BIA.util.showElement("SWFUpload_"+this.id+"BrowseBtn")}};BIA.forms.SWFUploadForm.prototype.queueComplete=function(){if(this.settings.redirect_url){window.location=this.settings.redirect_url}this.block=YAHOO.util.Dom.getAncestorByClassName(this.form,"block");if(!this.block){throw new Error("Cannot refresh block content without a block")}this.windowID=this.block.id.substring(this.block.id.lastIndexOf("-")+1);BIA.forms.ajaxLinkClick(document.location.pathname+"?windowID="+this.windowID,this.block.id)};BIA.forms.SWFUploadForm.prototype.queueCancel=function(){};BIA.forms.SWFUploadForm.prototype.error=function(a,b,c){YAHOO.util.Dom.addClass(document.getElementById("queue_"+b.id),"uploadError")};BIA.forms.TabSet=function(d){this.id=d;var c=document.getElementById(this.id);if(!c){throw new Error("Invalid tab div")}this.tabs=c.getElementsByTagName("a");for(var b=0;b<this.tabs.length;b++){YAHOO.util.Event.addListener(this.tabs[b],"click",this.tabSelect,this,true);var a=this.tabs[b].getAttribute("href");if(a.lastIndexOf("=")){a=a.substring(a.lastIndexOf("=")+1)}if(YAHOO.util.Dom.getStyle(a,"display")!="none"){YAHOO.util.Dom.addClass(this.tabs[b],"active")}}this.field=document.getElementById(d+"Field")};BIA.forms.TabSet.prototype.tabSelect=function(b){YAHOO.util.Event.preventDefault(b);var d=YAHOO.util.Event.getTarget(b);d.blur();for(var c=0;c<this.tabs.length;c++){var a=this.tabs[c].getAttribute("href");if(a.lastIndexOf("=")){a=a.substring(a.lastIndexOf("=")+1)}if(this.tabs[c]==d){YAHOO.util.Dom.addClass(this.tabs[c],"active");BIA.util.showElement(a);if(this.field){this.field.value=a}}else{YAHOO.util.Dom.removeClass(this.tabs[c],"active");BIA.util.hideElement(a)}}};BIA.autoScroll.init=function(){try{hash=document.location.hash;if(hash.substring(1,7)=="scroll"){window.scrollTo(0,hash.substring(7))}}catch(a){}return true};YAHOO.util.Event.addListener(window,"load",BIA.autoScroll.init);BIA.keyNav.init=function(a){YAHOO.util.Event.addListener(document,"keyup",BIA.keyNav.keyPress)};BIA.keyNav.keyPress=function(a){var b=YAHOO.util.Event.getTarget(a);while(b=b.parentNode){if(b&&b.tagName){if(b.tagName.toLowerCase()=="form"){return true}}}if(!a.altKey&&!a.ctrlKey&&!a.shiftKey){if(link=document.getElementById("keyPress"+a.keyCode)){if(link.tagName&&link.href){document.location=link.href}}}return true};YAHOO.util.Event.addListener(window,"load",BIA.keyNav.init);function checkwidth(b){var a=0,c=0,e;if(b.width||b.complete){if(b.width){a=b.width;c=b.height}else{if(b.naturalWidth){a=b.naturalWidth;c=b.naturalHeight}else{if(b.complete){var g=new Image();g.src=b.src;a=g.width;c=g.height}}}if(a&&b.onreadystatechange){b.onreadystatechange=null}if(!b.parentNode){return false}var d=b.parentNode;var f=(d)?(d.offsetWidth-2):200;if(a>f){f-=2;if(b.parentNode.tagName.toLowerCase()!="a"){if(!b.naturalWidth){b.naturalWidth=a}if(!b.naturalHeight){b.naturalHeight=c}b.className+=" resized hand";b.onclick=openImage;e=b}else{b.className+=" resized";e=b.parentNode}}if(b.width>f){if(b.height){b.height=Math.round(f/b.width*b.height)}b.width=f}}}function openImage(){var b=(this.naturalWidth<screen.availWidth?this.naturalWidth:screen.availWidth);var c=(this.naturalHeight<screen.availHeight?this.naturalHeight:screen.availHeight);var a=window.open("/templates/html/viewimage.html?"+escape(this.src),"","toolbar=no,location=no,menubar=no,width="+b+",height="+c+",resizable=yes,status=no,scrollbars=no,left=0,top=0");try{a.focus()}catch(d){}}BIA.util.capitalize=function(a){return a.charAt(0).toUpperCase()+a.substr(1)};BIA.util.toggleElement=function(a,b){element=document.getElementById(a);style=b?b:"block";if(YAHOO.util.Dom.getStyle(element,"display")=="none"){YAHOO.util.Dom.setStyle(element,"display",style)}else{YAHOO.util.Dom.setStyle(element,"display","none")}};BIA.util.hideElement=function(a){element=document.getElementById(a);YAHOO.util.Dom.setStyle(element,"display","none")};BIA.util.showElement=function(a,b){element=document.getElementById(a);style=b?b:"block";YAHOO.util.Dom.setStyle(element,"display",style)};BIA.util.setNotification=function(a){document.getElementById("notificationMessage").innerHTML=a;document.getElementById("notification").style.display="block"};BIA.util.popup=function(b,c,d){if(!c){c=640}if(!d){d=400}var a=window.open(b,"BIAwindow","menubar=0,resizable=1,scrollbars=1,width="+c+",height="+d);try{a.focus()}catch(f){}return false};BIA.util.setCookie=function(c,e,d,g,a,h){var b=new Date();b.setTime(b.getTime());if(d){d=d*1000*60*60*24}var f=new Date(b.getTime()+(d));document.cookie=c+"="+escape(e)+((d)?";expires="+f.toGMTString():"")+((g)?";path="+g:"")+((a)?";domain="+a:"")+((h)?";secure":"")};BIA.util.getCookie=function(a){var d,c;try{if(document.cookie.length>0&&a!==""){d=document.cookie.indexOf(a+"=");if(d!==-1){d=d+a.length+1;c=document.cookie.indexOf(";",d);if(c===-1){c=document.cookie.length}return unescape(document.cookie.substring(d,c))}}}catch(b){}return""};BIA.util.getNodeText=function(b){var d="";var a=b.childNodes;for(var c=0;c<a.length;c++){if(a[c].nodeType==3||a[c].nodeType==4){d+=a[c].data}else{d+=getNodeText(a[c])}}return d};BIA.util.handleMousewheel=function(c){var b=YAHOO.util.Event.getTarget(c);if(b.tagName.toLowerCase()=="embed"||b.tagName.toLowerCase()=="object"){var d=0;if(c.wheelDelta){d=c.wheelDelta/120;if(window.opera){d=-d}}else{if(c.detail){d=-c.detail/3}}if(d){try{if(b.handleMousewheel(d)){YAHOO.util.Event.preventDefault(c)}}catch(a){}}}};YAHOO.util.Event.addListener(document,"mousewheel",BIA.util.handleMousewheel);YAHOO.util.Event.addListener(document,"DOMMouseScroll",BIA.util.handleMousewheel);function SHA1(d){function c(z,y){var j=(z<<y)|(z>>>(32-y));return j}function t(A){var z="";var j;var B;var y;for(j=0;j<=6;j+=2){B=(A>>>(j*4+4))&15;y=(A>>>(j*4))&15;z+=B.toString(16)+y.toString(16)}return z}function u(A){var z="";var y;var j;for(y=7;y>=0;y--){j=(A>>>(y*4))&15;z+=j.toString(16)}return z}function l(j){j=j.replace(/\r\n/g,"\n");var y="";for(var A=0;A<j.length;A++){var z=j.charCodeAt(A);if(z<128){y+=String.fromCharCode(z)}else{if((z>127)&&(z<2048)){y+=String.fromCharCode((z>>6)|192);y+=String.fromCharCode((z&63)|128)}else{y+=String.fromCharCode((z>>12)|224);y+=String.fromCharCode(((z>>6)&63)|128);y+=String.fromCharCode((z&63)|128)}}}return y}var f;var w,v;var b=new Array(80);var n=1732584193;var k=4023233417;var h=2562383102;var g=271733878;var e=3285377520;var s,r,q,p,o;var x;d=l(d);var a=d.length;var m=new Array();for(w=0;w<a-3;w+=4){v=d.charCodeAt(w)<<24|d.charCodeAt(w+1)<<16|d.charCodeAt(w+2)<<8|d.charCodeAt(w+3);m.push(v)}switch(a%4){case 0:w=2147483648;break;case 1:w=d.charCodeAt(a-1)<<24|8388608;break;case 2:w=d.charCodeAt(a-2)<<24|d.charCodeAt(a-1)<<16|32768;break;case 3:w=d.charCodeAt(a-3)<<24|d.charCodeAt(a-2)<<16|d.charCodeAt(a-1)<<8|128;break}m.push(w);while((m.length%16)!=14){m.push(0)}m.push(a>>>29);m.push((a<<3)&4294967295);for(f=0;f<m.length;f+=16){for(w=0;w<16;w++){b[w]=m[f+w]}for(w=16;w<=79;w++){b[w]=c(b[w-3]^b[w-8]^b[w-14]^b[w-16],1)}s=n;r=k;q=h;p=g;o=e;for(w=0;w<=19;w++){x=(c(s,5)+((r&q)|(~r&p))+o+b[w]+1518500249)&4294967295;o=p;p=q;q=c(r,30);r=s;s=x}for(w=20;w<=39;w++){x=(c(s,5)+(r^q^p)+o+b[w]+1859775393)&4294967295;o=p;p=q;q=c(r,30);r=s;s=x}for(w=40;w<=59;w++){x=(c(s,5)+((r&q)|(r&p)|(q&p))+o+b[w]+2400959708)&4294967295;o=p;p=q;q=c(r,30);r=s;s=x}for(w=60;w<=79;w++){x=(c(s,5)+(r^q^p)+o+b[w]+3395469782)&4294967295;o=p;p=q;q=c(r,30);r=s;s=x}n=(n+s)&4294967295;k=(k+r)&4294967295;h=(h+q)&4294967295;g=(g+p)&4294967295;e=(e+o)&4294967295}var x=u(n)+u(k)+u(h)+u(g)+u(e);return x.toLowerCase()};