function setCheckboxes(A,D){var C=document.forms[A].getElementsByTagName("input");var B=C.length;for(i=0;i<B;i++){C[i].checked=D;if(C[i].type=="submit"){C[i].disabled=!D;}}}function UpdateSubmit(A){var C=document.forms[A].getElementsByTagName("input");var B=C.length;var D=false;for(i=0;i<B;i++){if(C[i].type=="checkbox"&&C[i].checked==true){D=true;}if(C[i].type=="submit"){C[i].disabled=true;}}for(i=0;i<B;i++){if(C[i].type=="submit"){if(D==true){C[i].disabled=false;}else{C[i].disabled=true;}}}}function setCheckbox(A){var E=document.forms[A].getElementsByTagName("input");var B=E.length;var D=true;for(var C=0;C<B;C++){if(E[C].checked){D=false;}}for(var C=0;C<B;C++){if(E[C].type=="submit"){E[C].disabled=D;}}}var win="width=500,height=600,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";function get_gallery(A){window.open("photos_gallery.php?ID="+A,"gallery",win);}function launchTellFriend(){var A=document.getElementsByTagName("base")[0].href;var B="width=300,height=300,left=200,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";return !window.open(A+"tellfriend.php","tellfriend",B);}function launchTellFriendProfile(A){var B=document.getElementsByTagName("base")[0].href;var C="width=300,height=300,left=200,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";return !window.open(B+"tellfriend.php?ID="+A,"tellfriendprofile",C);}function BxShowBlock(B){var A;A=document.getElementById(B);if(A.style.display=="none"){A.style.display="block";}else{A.style.display="none";}return false;}function ShowShowHide(B,A,C){if(C){C.style.display="none";}if(B){B.style.display="inline";}if(A){A.style.display="inline";}}function ShowHideHide(A,B,C){if(B){B.style.display="none";}if(C){C.style.display="none";}if(A){A.style.display="inline";}}function charCounter(D,B,C){D=document.getElementById(D);C=document.getElementById(C);var A=D.value.length;if(A>=B){D.value=D.value.substring(0,B);}C.innerHTML=B-D.value.length;}function show(A,B){document.images[A].src=B;}function ss(A){window.status=A;return true;}function ce(){window.status="";}function emoticon(C,B){B=" "+B+" ";if(C.createTextRange&&C.caretPos){var A=C.caretPos;A.text=A.text.charAt(A.text.length-1)==" "?B+" ":B;C.focus();}else{C.value+=B;C.focus();}}function launchAddToIM(B){var A="width=600,height=160,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";window.open("explanation.php?explain=imadd&ID="+B,"add_to_im",A);return false;}function docOpen(A){newWindow=window.open("","","toolbar=no,resizable=yes,scrollbars=yes,width=400,height=300");newWindow.document.open("text/html");newWindow.document.write(unescape(A));newWindow.document.close();}function get_data(B,C,F){if(B){var B=document.getElementById(B);B.innerHTML="loading ... ";}var E=createXmlHttpObj();if(!E){return false;}var A=F+"xml/menu.php"+C+"&_t="+Math.random();E.open("GET",A);E.onreadystatechange=function(){if(E.readyState==4&&E.status==200){var G=E.responseXML;delete E;E=null;names=G.getElementsByTagName("name");links=G.getElementsByTagName("link");D(names,links);}};E.send(null);function D(K,G){var L,H,J,I=K.length;B.innerHTML="";for(L=0;L<I;L++){H=K[L].firstChild.nodeValue;J=G[L].firstChild.nodeValue;B.innerHTML+='<div class="innerSubmenuDiv"><a href="'+J+'">'+H+"</a></div>";}}}function createNamedElement(C,A){var B;try{B=document.createElement("<"+C+' name="'+A+'">');}catch(D){}if(!B||!B.name){B=document.createElement(C);B.name=A;}return B;}function display_node(B,C){var D=document.getElementById(B);var A=B.split("_")[1];if("none"==D.style.display){D.style.display="block";if(""==D.innerHTML){get_data(B,"?action=menu&ID="+A,C);}}else{D.style.display="none";}}function stripSlashes(A){return A.replace(/\\/g,"");}function createXmlHttpObj(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else{if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}else{alert("Please upgrade your browser");return false;}}}function getHtmlData(elemID,url){var elem=document.getElementById(elemID);if(!elem||!url){return false;}var url=url+"&r="+Math.random();var oXMLHttpReq=createXmlHttpObj();if(!oXMLHttpReq){return false;}elem.innerHTML='<div class="loading"><img src="'+urlIconLoading+'"></div>';oXMLHttpReq.open("GET",url);oXMLHttpReq.onreadystatechange=function(){if(oXMLHttpReq.readyState==4&&oXMLHttpReq.status==200){sNewText=oXMLHttpReq.responseText;elem.innerHTML=sNewText;aScrMatches=sNewText.match(/<script[^>]*javascript[^>]*>([^<]*)<\/script>/ig);if(aScrMatches){for(ind=0;ind<aScrMatches.length;ind++){sScr=aScrMatches[ind];iOffset=sScr.match(/<script[^>]*javascript[^>]*>/i)[0].length;sScript=sScr.substring(iOffset,sScr.length-9);eval(sScript);}}}};oXMLHttpReq.send(null);}function showFloatDesc(A){descDiv=document.getElementById("FloatDesc");if(descDiv){descDiv.innerHTML=A;descDiv.style.display="block";}}function hideFloatDesc(){descDiv=document.getElementById("FloatDesc");if(descDiv){descDiv.style.display="none";}}function moveFloatDesc(A){descDiv=document.getElementById("FloatDesc");if(descDiv){showPos=getPositionData(descDiv,A);descDiv.style.left=showPos.posX+"px";descDiv.style.top=showPos.posY+"px";}}function getPositionData(C,I){if(!I){I=window.event;}var D=0,A=0;if(I){if(typeof(I.pageX)=="number"){D=I.pageX;A=I.pageY;}else{if(typeof(I.clientX)=="number"){D=I.clientX;A=I.clientY;if(document.body&&(document.body.scrollTop||document.body.scrollLeft)&&!(window.opera||window.debug||navigator.vendor=="KDE")){D+=document.body.scrollLeft;A+=document.body.scrollTop;}else{if(document.documentElement&&(document.documentElement.scrollTop||document.documentElement.scrollLeft)&&!(window.opera||window.debug||navigator.vendor=="KDE")){D+=document.documentElement.scrollLeft;A+=document.documentElement.scrollTop;}}}}}var H=0,G=0;if(document.body&&(document.body.scrollTop||document.body.scrollLeft)&&!(window.debug||navigator.vendor=="KDE")){H=document.body.scrollLeft;G=document.body.scrollTop;}else{if(document.documentElement&&(document.documentElement.scrollTop||document.documentElement.scrollLeft)&&!(window.debug||navigator.vendor=="KDE")){H=document.documentElement.scrollLeft;G=document.documentElement.scrollTop;}}var E=0,B=0;if(window.innerWidth&&window.innerHeight){E=window.innerWidth;B=window.innerHeight;}else{if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight){E=document.documentElement.clientWidth;B=document.documentElement.clientHeight;}else{if(document.body&&document.body.clientWidth&&document.body.clientHeight){E=document.body.clientWidth;B=document.body.clientHeight;}}}D+=15;A+=20;if(C.offsetWidth&&C.offsetHeight){if(D-H+C.offsetWidth+5>E){D-=(C.offsetWidth+25);}if(A-G+C.offsetHeight+5>B){A-=(C.offsetHeight+20);}}var F=new Array;F.posX=D;F.posY=A;F.scrollX=H;F.scrollY=G;F.winSizeX=E;F.winSizeY=B;return F;}function addBookmark(C,A){if(C==undefined){C=document.title;}if(A==undefined){A=top.location.href;}if(window.sidebar){window.sidebar.addPanel(C,A,"");}else{if(window.opera&&window.print){var B=document.createElement("a");B.setAttribute("href",A);B.setAttribute("title",C);B.setAttribute("rel","sidebar");B.click();}else{if(document.all){window.external.AddFavorite(A,C);}else{if(navigator.appName=="Netscape"){alert('To bookmark this site press "Ctrl+D".');}else{alert("Your browser doesn't support this feature");}}}}}function AddFilesFields(B){if($("#browse_file_div").children('[class="file_field"]').length>=5){alert("5 files maximum");return;}var A=$('<div style="margin-top:10px;" class="file_field"><input name="userfile[]" type="file" style="" />&nbsp;&nbsp;&nbsp;<a href="#">'+B+"</a></div>");$("#browse_file_div").append(A);A.children("a").click(function(){$(this).parent().remove();return false;});}function changeBigPicTo(B,A){var C;C=document.getElementById("AdvBigImg");C.style.backgroundImage="url("+B+")";C=document.getElementById("AdvBigImgFullSize");C.href=A;}function moveScrollRightAuto(B,A){if(A){scrollTimerId=setInterval("moveScrollRight('"+B+"')",100);}else{clearInterval(scrollTimerId);}}function moveScrollLeftAuto(B,A){if(A){scrollTimerId=setInterval("moveScrollLeft('"+B+"')",100);}else{clearInterval(scrollTimerId);}}function moveScrollRight(A){var B=5;var D=document.getElementById(A);var C=D.style.left?parseInt(D.style.left):0;minLeft=D.parentNode.clientWidth-parseInt(D.clientWidth);if((C-B)>minLeft){D.style.left=C-B+"px";}else{D.style.left=minLeft+"px";moveScrollRightAuto(A,false);}}function moveScrollLeft(A){var B=5;var D=document.getElementById(A);var C=parseInt(D.style.left?D.style.left:0);if(C+B<0){D.style.left=C+B+"px";}else{D.style.left="0px";moveScrollLeftAuto(false);}}function addEvent(C,A,B){if(!C||!A||!B){return false;}if(C.addEventListener){C.addEventListener(A,B,false);}else{if(C.attachEvent){C.attachEvent("on"+A,B);}}}function checkAll(B,C,A){_form=document.forms[B];if(!_form){return false;}for(ind=0;ind<_form.length;ind++){_elem=_form[ind];if(_elem.type!="checkbox"){continue;}if(_elem.name.substr(0,C.length)!=C){continue;}_elem.checked=A;}}function emailCheck(A){if(A.search(/^[a-z0-9_\-]+(\.[_a-z0-9\-]+)*@([_a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)$/i)==-1){return false;}else{return true;}}function getBoonexId(B,F){if(!B||!F){return false;}var A=B.ID;var C=B.Password;if(!A||!C){return false;}var E=createXmlHttpObj();if(!E){return false;}if(!A.value.length){alert("Please enter BoonEx ID");A.focus();return false;}if(!C.value.length){alert("Please enter Password");C.focus();return false;}B.Submit.disabled=true;B.Submit.value="Wait...";var D="get_boonex_id.php?ID="+encodeURIComponent(A.value)+"&Password="+encodeURIComponent(C.value)+"&r="+Math.random();E.open("GET",D);E.onreadystatechange=function(){if(E.readyState==4&&E.status==200){var K=E.responseXML;if(!K.getElementsByTagName("ID").length){alert("Authorization failed. Try again.");return false;}var L=new Array();L.Username="NickName[0]";L.Email="Email[0]";L.Password="Password[0],Password_confirm[0]";L.Realname="Realname[0]";L.DateOfBirth="DateOfBirth[0]";L.Sex="Sex[0]";L.Country="Country[0]";L.City="City[0]";L.ZIP="zip[0]";L.Headline="Headline[0]";L.DescriptionMe="DescriptionMe[0]";L.tags="Tags";for(var J in L){if(!K.getElementsByTagName(J).length){continue;}var G=K.getElementsByTagName(J)[0];var N=G.firstChild.data;if(J=="DateOfBirth"){var M=N.split("-");N=parseInt(M[2],10)+"/"+parseInt(M[1],10)+"/"+parseInt(M[0],10);}var I=L[J].split(",");for(var H in I){fieldTo=I[H];if(F[fieldTo]){eFieldTo=F[fieldTo];switch(eFieldTo.type){case"text":case"textarea":case"password":case"select-one":eFieldTo.value=N;break;default:if(typeof eFieldTo=="object"){for(n=0;n<eFieldTo.length;n++){if(eFieldTo[n].value==N){eFieldTo[n].checked=true;}}}}}}}}};E.send(null);B.Submit.disabled=false;B.Submit.value="Import";}function loadDynamicBlock(A,C){if($==undefined){return false;}var B=$("#page_block_"+A);$(".boxContent",B).html('<div style="text-align: center;"><img src="'+urlIconLoading+'" alt="Loading..." /></div>');B.load(C+"&pageBlock="+A);return true;}function showItemEditForm(A){var B=document.getElementById(A);B.style.width=document.body.clientWidth+30+"px";B.style.height=(window.innerHeight?(window.innerHeight+30):screen.height)+"px";B.style.left=getHorizScroll1()-30+"px";B.style.top=getVertScroll1()-30+"px";B.style.display="block";}function getHorizScroll1(){if(navigator.appName=="Microsoft Internet Explorer"){return document.documentElement.scrollLeft;}else{return window.pageXOffset;}}function getVertScroll1(){if(navigator.appName=="Microsoft Internet Explorer"){return document.documentElement.scrollTop;}else{return window.pageYOffset;}}