if(typeof Prototype=="undefined"){alert("Prototype is required but is missing")}var dimmerDensity=65;var popupLocked=false;var popupVisible=false;var errorMessage=null;var debugMode=false;var instantMessage=null;var pageLoaded=false;var GET_DATA=new Array();var preloaderArr=new Array();var windowHeight;var windowWidth;var windowScrollX;var windowScrollY;var popupWidth;var popupHeight;var posx=0;var posy=0;var posx1=0;var posy1=0;var mouseTarget="";var h="";var charscount=0;var forcedShow=false;window.onload=function(){pageLoaded=true;systemInit();if(typeof loader=="function"){loader()}if(typeof initInfoBar=="function"){initInfoBar()}if(typeof uploadStatus=="function"){uploadStatus()}if(typeof loadPhoto=="function"){loadPhoto()}if(typeof initHS=="function"){h=new initHS()}};function systemInit(){rs();initDimmer();initPopup();initIFrame();initialiseGetData();callOnLoad();if(errorMessage){populatePopup(errorMessage);showCenteredPopup();popupLocked=true;setTimeout("popupLocked=false; hidePopup();",2500)}if(instantMessage){populatePopup(instantMessage);showDimmer(true);showCenteredPopup();popupLocked=true}}function callOnLoad(){document.onmousemove=function(B){if(!pageLoaded&&!forcedShow){return true}rs();var A;if(!B){B=window.event}if(B.target){A=B.target}else{if(B.srcElement){A=B.srcElement}}if(A.nodeType==3){A=A.parentNode}mouseTarget=A;if(B.pageX||B.pageY){posx=B.pageX;posy=B.pageY;posx1=B.pageX-windowScrollX;posy1=B.pageY-windowScrollY}else{if(B.clientX||B.clientY){posx=B.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=B.clientY+document.body.scrollTop+document.documentElement.scrollTop;posx1=B.clientX;posy1=B.clientY}}if($("dg")!=null&&debugMode==true){$("dg").innerHTML="<table><tr><td><strong>body W:</strong></td><td>"+document.body.clientWidth+"px;</td><td><strong>Scroll X:</strong></td><td>"+windowScrollX+"</td><td><strong>Window W:</strong></td><td>"+windowWidth+"</td><td><strong>mouse X:</strong></td><td>"+posx+"</td><td><strong>screen X:</strong></td><td>"+posx1+"</td><td><strong>popup locked:</strong></td><td>"+popupLocked+";</td><td><strong>popup left:</strong></td><td>"+$("popup").style.left+"</td><td><strong>popup W:</strong></td><td>"+popupWidth+"px</td></tr><td><strong>body H:</strong></td><td>"+document.body.clientHeight+"px; </td><td><strong>Scroll Y:</strong></td><td>"+windowScrollY+"</td><td><strong>Window H:</strong></td><td>"+windowHeight+"</td><td><strong>mouse Y:</strong></td><td>"+posy+"</td><td><strong>screen Y:</strong></td><td>"+posy1+"</td><td> <strong>popup visible:</strong></td><td>"+popupVisible+";</td><td><strong>popup top:</strong></td><td>"+$("popup").style.top+"</td><td><strong>popup H:</strong></td><td>"+popupHeight+"px</td></tr></table>"}if((typeof modelProfileVisible!="undefined"&&modelProfileVisible==true)||(typeof otherProfileVisible!="undefined"&&otherProfileVisible==true)){setOnScreen()}};window.onscroll=function(A){if(!pageLoaded&&!forcedShow){return false}rs();if((typeof modelProfileVisible!="undefined"&&modelProfileVisible==true)||(typeof otherProfileVisible!="undefined"&&otherProfileVisible==true)){hidePopup()}if($("dg")!=null){$("dg").style.left="0px";$("dg").style.top=windowScrollY+"px"}if($("helper")){$("helper").style.left="50px";$("helper").style.top=windowScrollY+"px"}};document.onkeydown=function(B){if(!pageLoaded&&!forcedShow){return true}var A;if(!B){B=window.event}if(B.target){A=B.target}else{if(B.srcElement){A=B.srcElement}}if(A.nodeType==3){A=A.parentNode}if(B.ctrlKey&&B.altKey&&B.keyCode==68){hideDimmer(true)}if($("galleryPicture")!=null&&A.tagName!="TEXTAREA"&&A.tagName!="INPUT"&&A.tagName!="SELECT"){if(B.keyCode==39){getNext()}else{if(B.keyCode==37){getPrev()}}}}}function initDimmer(){var A=document.createElement("div");A.id="dimmer";A.style.position="absolute";A.style.background="black";A.style.display="none";A.style.zIndex=100;A.style.opacity=dimmerDensity/100;A.style.filter="alpha(opacity="+dimmerDensity+")";document.body.appendChild(A)}function showDimmer(A){if(!pageLoaded&&!forcedShow){return false}rs();if(typeof A!="undefined"&&A==true){$("dimmer").onclick=function(B){}}else{$("dimmer").onclick=function(B){hideDimmer(true)}}$("dimmer").style.left="0px";$("dimmer").style.top="0px";$("dimmer").style.width=document.body.clientWidth+"px";$("dimmer").style.height=document.body.clientHeight+"px";$("dimmer").style.display="block";positionIFrame(0,0);showIFrame(document.body.clientWidth,document.body.clientHeight)}function hideDimmer(A){if(!pageLoaded&&!forcedShow){return false}$("dimmer").style.display="none";if(typeof A!="undefined"&&A==true){hidePopup()}hideIFrame()}function initIFrame(){var A=document.createElement("iframe");A.id="iframe";A.style.zIndex=99;A.style.position="absolute";A.style.display="none";A.frameBorder=0;A.style.left=0;A.style.top=0;A.style.background="transparent";A.style.filter="alpha(opacity=0)";document.body.appendChild(A)}function positionIFrame(A,B){if(!pageLoaded&&!forcedShow){return false}$("iframe").style.left=A+"px";$("iframe").style.top=B+"px"}function showIFrame(A,B){if(!pageLoaded&&!forcedShow){return false}if(!document.all){return false}$("iframe").style.width=A+"px";$("iframe").style.height=B+"px";if(!window.opera){$("iframe").style.display="block"}}function hideIFrame(){if(!pageLoaded&&!forcedShow){return false}$("iframe").style.display="none"}function initPopup(){var A=document.createElement("table");A.id="popup";A.style.position="absolute";A.style.left=0;A.style.top=0;A.style.borderCollapse="collapse";A.style.visibility="hidden";A.style.zIndex=101;var C=document.createElement("tbody");var F=document.createElement("tr");var E=document.createElement("td");E.style.padding="0";E.style.background="url("+IWEBPATH+"images/frame/frame_top_left.png)";E.style.behavior="url(/iepngfix.htc)";E.width="20";E.height="20";var D=document.createElement("td");D.style.padding="0";D.style.background="url("+IWEBPATH+"images/frame/frame_bgnd_top.png)";D.style.behavior="url(/iepngfix.htc)";D.height="20";D.innerHTML="&nbsp;";var B=document.createElement("td");B.style.padding="0";B.style.background="url("+IWEBPATH+"images/frame/frame_top_right.png)";B.style.behavior="url(/iepngfix.htc)";B.width="20";B.height="20";B.innerHTML="&nbsp;";F.appendChild(E);F.appendChild(D);F.appendChild(B);C.appendChild(F);var F=document.createElement("tr");var E=document.createElement("td");E.style.padding="0";E.style.background="url("+IWEBPATH+"images/frame/frame_bgnd_left.png)";E.style.behavior="url(/iepngfix.htc)";var D=document.createElement("td");D.id="tblContentTd";D.style.width=0;D.style.height=0;D.style.padding="0";D.style.background="black";D.style.background="url("+IWEBPATH+"images/frame/frame_bgnd.png)";D.style.behavior="url(/iepngfix.htc)";D.innerHTML='<div style="position:relative" id="tblContent"><img src="'+IWEBPATH+'images/preloader.gif" /></div>';D.style.color="white";var B=document.createElement("td");B.style.padding="0";B.style.background="url("+IWEBPATH+"images/frame/frame_bgnd_right.png)";B.style.behavior="url(/iepngfix.htc)";B.innerHTML="&nbsp;";F.appendChild(E);F.appendChild(D);F.appendChild(B);C.appendChild(F);var F=document.createElement("tr");var E=document.createElement("td");E.style.padding="0";E.style.background="url("+IWEBPATH+"images/frame/frame_bottom_left.png)";E.style.behavior="url(/iepngfix.htc)";var D=document.createElement("td");D.style.padding="0";D.style.background="url("+IWEBPATH+"images/frame/frame_bgnd_bottom.png)";D.style.behavior="url(/iepngfix.htc)";D.height="20";D.innerHTML="&nbsp;";var B=document.createElement("td");B.style.padding="0";B.style.background="url("+IWEBPATH+"images/frame/frame_bottom_right.png)";B.style.behavior="url(/iepngfix.htc)";B.innerHTML="&nbsp;";F.appendChild(E);F.appendChild(D);F.appendChild(B);C.appendChild(F);A.appendChild(C);document.body.appendChild(A)}function movePopup(A,B){if((!pageLoaded&&!forcedShow)||popupLocked){return false}$("popup").style.left=A+"px";$("popup").style.top=B+"px";if($("iframe").style.display=="block"){positionIFrame(A,B)}}function fillPopup(B,A){populatePopup(B,A)}function populatePopup(B,A){if((!pageLoaded&&!forcedShow)||popupLocked){return false}$("tblContent").innerHTML=B;popupWidth=parseInt($("tblContentTd").clientWidth);popupHeight=parseInt($("tblContentTd").clientHeight);if(typeof A!="undefined"&&A==true){showPopup()}}function resizePopup(){if((!pageLoaded&&!forcedShow)||popupLocked){return false}$("tblContent").style.width=popupWidth+"px";$("tblContent").style.height=popupHeight+"px"}function showPopup(){if((!pageLoaded&&!forcedShow)||popupLocked){return false}$("popup").style.visibility="visible";popupVisible=true;if($("iframe").style.display!="block"){positionIFrame(parseInt($("popup").style.left),parseInt($("popup").style.top));showIFrame($("popup").clientWidth,$("popup").clientHeight)}}function reCenterPopup(){popupWidth=parseInt($("tblContentTd").clientWidth);popupHeight=parseInt($("tblContentTd").clientHeight);$("popup").style.left=windowScrollX+(windowWidth/2-popupWidth/2)+"px";$("popup").style.top=windowScrollY+(windowHeight/2-popupHeight/2)+"px"}function setOnScreen(){var B=0;var A=0;if(posy1+popupHeight+60>windowHeight){A=posy-popupHeight-50}else{A=posy+20}if(windowWidth<(posx1+popupWidth+60)){B=posx-popupWidth-40}else{B=posx+20}if(B<0){B=0}if(A<0){A=0}movePopup(B,A)}function showCenteredPopup(A){if((!pageLoaded&&!forcedShow)||popupLocked){return false}rs();$("popup").style.left=windowScrollX+(windowWidth/2-popupWidth/2)+"px";$("popup").style.top=windowScrollY+(windowHeight/2-popupHeight/2)+"px";showPopup();if(typeof A!="undefined"&&A==true){showDimmer()}}function hidePopup(){if((!pageLoaded&&!forcedShow)||popupLocked){return false}popupVisible=false;$("tblContent").innerHTML="";$("popup").style.visibility="hidden";hideIFrame()}function rs(){if(!document.all){windowWidth=window.innerWidth-20;windowHeight=window.innerHeight;windowScrollX=window.pageXOffset;windowScrollY=window.pageYOffset}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){windowWidth=document.documentElement.clientWidth-20;windowHeight=document.documentElement.clientHeight;windowScrollX=document.documentElement.scrollLeft;windowScrollY=document.documentElement.scrollTop}else{windowWidth=document.body.clientWidth-20;windowHeight=document.body.clientHeight;windowScrollX=document.body.scrollLeft;windowScrollY=document.body.scrollTop}}}function checkAll(B,A){if(typeof document.forms[B]!="undefined"){var C=document.forms[B];for(i=0;i<C.elements.length;i++){if(C.elements[i].type=="checkbox"){C.elements[i].checked=A}}}else{alert("Invalid form element provided!")}}function emoticon(B,C){B=" "+B+" ";if(C.createTextRange&&C.caretPos){var A=C.caretPos;A.text=A.text.charAt(A.text.length-1)==" "?A.text+B+" ":A.text+B;C.focus()}else{C.value+=B;C.focus()}}function initialiseGetData(){var A=new String(window.location);var E=A.search(/\?/);if(E!=-1){A=A.substr(E+1);var D=A.split(/&/g);for(var C=0;C<D.length;C++){var B=D[C].split(/=/);GET_DATA[unescape(B[0])]=unescape(B[1])}}}function $_GET(A){if(typeof GET_DATA[A]!="undefined"){return GET_DATA[A]}return""}function showHideCommentForm(A){var B=document.getElementById("newCommentLayer");if(B.style.display=="none"){B.style.display="block"}else{if(A==1){return }B.style.display="none"}}function countMsgCharacters(B,A){msg=B.value;len=msg.length;if(len>A){B.value=msg.substr(0,charscount)}else{charscount=len}document.getElementById("remainingChars").value=A-charscount}function checkStates(A){if(A.value==1){$("state").disabled=false}else{$("state").disabled=true}}function findParent(B,A){var C=false;if((B.parentNode!=null)&&B.parentNode.className!=A){C=findParent(B.parentNode,A)}else{if((B.parentNode!=null)&&B.parentNode.className==A){C=true}}return C}preloader("upload","/images/uploadbar.gif");preloader("progress","/images/preloader.gif");function preloader(B,A){preloaderArr[B]=new Image();preloaderArr[B].src=A}function getImage(A){if(typeof preloaderArr[A]!="undefined"){return preloaderArr[A].src}}function showHideCasting(B,A){if(document.getElementById(A).style.display=="none"){B.innerHTML='<img src="/images/str_on.gif">';document.getElementById(A).style.display="block"}else{B.innerHTML='<img src="/images/str.gif">';document.getElementById(A).style.display="none"}}function appendToLog(D){return false;var C=new Date();var A=C.getHours();var B=C.getMinutes();var E=C.getSeconds();$("dg2").innerHTML+=A+":"+B+":"+E+" - "+D+"<br />";$("dg2").style.visibility="visible";$("dg2").style.height="150px"};