var annoYPID=null,annoLat=null,annoLong=null;function UCI(b,c){var a=document.getElementById(c);if(a.disabled)return;a.src=b.attributes["i"].value}function URI(c){var a=document.getElementById(c);if(a.disabled)return;var b=a.attributes["originalImg"].value;a.src=b}function UR(i,b,n,s,o){var a=document.getElementsByName(b+"Map")[0];if(a){var t=a.attributes["hp"].value,h=a.attributes["ct"].value,u=a.attributes["ii"].value,v=a.attributes["it"].value,r=a.attributes["ai"].value,k=a.attributes["key"].value,l=a.attributes["hc"].value,p=a.attributes["rtxt"]?a.attributes["rtxt"].value.replace(/%userrating%/gi,o.attributes["v"].value):null,f=document.getElementById(b),j=k.replace(/ /g,"_");if(!f.disabled){if(document.cookie.indexOf(k+"=")<0){var d,g=0,c=document.getElementById("rrur_"+b);if(c.expires=="")try{c.load(h);d=c.getAttribute("r"+l);if(d)g=d.indexOf(" "+j+" ")+1;else d=""}catch(m){}var q=document.getElementById("rrir_"+b);q.src=t+"?ct="+h+"&ii="+u+"&it="+v+"&ai="+r+"&r="+n+"&c="+s+"&u="+g+"&ItemId="+b+"&AYpid="+annoYPID+"&ALat="+annoLat+"&ALong="+annoLong;if(c.expires==""&&g<1)try{c.setAttribute("r"+l,d+" "+j+" ");c.save(h)}catch(m){}if(f){f.attributes["originalImg"].value=i;f.src=i}}var e=document.getElementById("divUCnt"+b);if(e)e.style.display="none";e=document.getElementById("rrdivthanks"+b);if(e)e.style.display="inline";Disable(b,p,null);return false}}}function Disable(d,e,f){var a=document.getElementById(d);if(a){a.disabled=true;a.style.cursor="default";var c=document.getElementsByName(d+"Map")[0];if(c)for(i=0;i<c.childNodes.length;i++){var b=c.childNodes[i];if(b.nodeName=="AREA"){if(e!=null)b.setAttribute("alt",e.replace(/%userrating%/gi,f));b.removeAttribute("href")}}}}function UGR(b){var d=document.getElementsByName(b+"Map")[0];if(d){var l=d.attributes["key"].value,k=d.attributes["rtxt"]?d.attributes["rtxt"].value:null,c=document.cookie,g=l+"=",a=c.indexOf("; "+g);if(a==-1){a=c.indexOf(g);if(a==-1)return}else a+=2;var h=c.indexOf(";",a);if(h==-1)h=c.length;var j=unescape(c.substring(a+g.length,h)),f=document.getElementById(b);if(f&&j){var i=document.getElementById("divUCnt"+b);if(i)i.style.display="none";var e=GetMapArea(b,j);if(e){f.attributes["originalImg"].value=e.attributes["i"].value;f.src=e.attributes["i"].value;Disable(b,k,e.attributes["v"].value)}}}}function GetMapArea(c,d){var a=document.getElementsByName(c+"Map")[0];if(a){var e=0;for(i=0;i<a.childNodes.length;i++){var b=a.childNodes[i];if(b.nodeName=="AREA"&&e++==d)return b}}}var imageId;function Request(){}Request.prototype={xmlRequest:null,callback:function(a){if(a.xmlRequest!=null)if(a.xmlRequest.readyState==4)processResponse(a.xmlRequest.responseText)},execute:function(h,b,d,f){var c="rrcallBack=true&rrcontrold=",a=this;if(window.ActiveXObject)try{a.xmlRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(g){}else if(typeof XMLHttpRequest!="undefined")try{a.xmlRequest=new XMLHttpRequest}catch(g){}if(a.xmlRequest!=null){var e=a;a.xmlRequest.onreadystatechange=function(){e.callback(e)};a.xmlRequest.open("POST",h,true);a.xmlRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(b!="")a.xmlRequest.send(c+d+"&rrrating="+b+"&rrops="+f);else a.xmlRequest.send(c+d+"&rrops="+f)}}};function MSXMLVer(){var d="Msxml2.DOMDocument.3.0",c="Msxml2.DOMDocument.4.0",b=null,a=b;try{a=new ActiveXObject(c);a.async=false;a=b;return c}catch(e){try{a=new ActiveXObject(d);a.async=false;a=b;return d}catch(e){a=b;return b}}return b}function CheckDOM(){if(window.ActiveXObject)return MSXMLVer();else if(document.implementation&&document.implementation.createDocument)return "DOMParser";else return null}function GetImage(a){var e,c=false;if(CheckDOM()==null)c=true;for(var b=0;b<a.attributes.length;b++){if(a.attributes[b].nodeName.toLowerCase()=="image")e=a.attributes[b].nodeValue;if(a.attributes[b].nodeName.toLowerCase()=="href"&&!c)a.attributes.removeNamedItem("href");else if(a.attributes[b].nodeName.toLowerCase()=="onclick"&&c){var d=document.createAttribute("onclick");if(d!=null){d.value="";a.attributes.setNamedItem(d)}}}return e}function ChangeImg(b,c){var a;a=document.getElementById(c);a.src=GetImage(b)}function RestoreImg(c){var b,a;a=document.getElementById(c);b=a.attributes.getNamedItem("originalImg").value;a.src=b}function processResponse(m){var k="originalImg",e=null,n,a,q=false,f,b,d,c,g;if(window.ActiveXObject){a=new ActiveXObject(MSXMLVer());a.async=false;a.loadXML(m);f=a.selectSingleNode("/MSNRR/Ops");b=a.selectSingleNode("/MSNRR/Status");d=a.selectSingleNode("/MSNRR/Control");c=a.selectSingleNode("/MSNRR/Value");g=a.selectSingleNode("/MSNRR/Rating")}else if(document.implementation&&document.implementation.createDocument){var o=new DOMParser;a=o.parseFromString(m,"text/xml");f=a.getElementsByTagName("Ops").item(0);b=a.getElementsByTagName("Status").item(0);d=a.getElementsByTagName("Control").item(0);c=a.getElementsByTagName("Value").item(0);g=a.getElementsByTagName("Rating").item(0)}if(f!=e)if(f.firstChild.nodeValue=="POST"){if(b!=e){if(b.firstChild.nodeValue==0){if(c.firstChild.nodeValue.length>0)window.location=c.firstChild.nodeValue;return}else n=c.firstChild.nodeValue;var p=document.getElementById("divThanks"+d.firstChild.nodeValue);p.innerHTML=n;imageId=e;HideControl("divUCnt"+d.firstChild.nodeValue)}}else if(b!=e){if(b.firstChild.nodeValue==1){var h=d.firstChild.nodeValue,i=document.getElementById(h),j;i.setAttribute(k,c.firstChild.nodeValue);j=i.attributes.getNamedItem(k).value;i.src=j;var l=document.getElementById("rrhid"+h);if(l!=e)l.value=g.firstChild.nodeValue}HideControl("divUCnt"+h)}}function SetRating(d,b,h,f){var c="originalImg",e,a,l,k,j,m;imageId=b;a=document.getElementById(b);if(typeof d=="object")a.setAttribute(c,GetImage(d));else a.setAttribute(c,d);e=a.attributes.getNamedItem(c).value;a.src=e;if(h=="true"){var i=new Request;i.execute(window.location,f,b,"POST")}else{var g=document.getElementById("rrhid"+b);g.value=f}return false}function GetUserRating(a){var b=new Request;b.execute(window.location,"",a,"GET")}function HideControl(b){var a=document.getElementById(b);if(a!=null)a.style.display="none"}function ShowControl(b){var a=document.getElementById(b);if(a!=null)a.style.display="block"}