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(l,g){var m,h,k,j=l.length;b.innerHTML="";for(m=0;m<j;m++){h=l[m].firstChild.nodeValue;k=g[m].firstChild.nodeValue;b.innerHTML+='<div class="innerSubmenuDiv"><a href="'+k+'">'+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,j){if(!j){j=window.event}var d=0,a=0;if(j){if(typeof(j.pageX)=="number"){d=j.pageX;a=j.pageY}else{if(typeof(j.clientX)=="number"){d=j.clientX;a=j.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(c,a){if(a){scrollTimerId=setInterval("moveScrollRight('"+c+"')",100)}else{clearInterval(scrollTimerId)}}function moveScrollLeftAuto(c,a){if(a){scrollTimerId=setInterval("moveScrollLeft('"+c+"')",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 l=e.responseXML;if(!l.getElementsByTagName("ID").length){alert("Authorization failed. Try again.");return false}var m=new Array();m.Username="NickName[0]";m.Email="Email[0]";m.Password="Password[0],Password_confirm[0]";m.Realname="Realname[0]";m.DateOfBirth="DateOfBirth[0]";m.Sex="Sex[0]";m.Country="Country[0]";m.City="City[0]";m.ZIP="zip[0]";m.Headline="Headline[0]";m.DescriptionMe="DescriptionMe[0]";m.tags="Tags";for(var k in m){if(!l.getElementsByTagName(k).length){continue}var g=l.getElementsByTagName(k)[0];var p=g.firstChild.data;if(k=="DateOfBirth"){var o=p.split("-");p=parseInt(o[2],10)+"/"+parseInt(o[1],10)+"/"+parseInt(o[0],10)}var j=m[k].split(",");for(var h in j){fieldTo=j[h];if(f[fieldTo]){eFieldTo=f[fieldTo];switch(eFieldTo.type){case"text":case"textarea":case"password":case"select-one":eFieldTo.value=p;break;default:if(typeof eFieldTo=="object"){for(n=0;n<eFieldTo.length;n++){if(eFieldTo[n].value==p){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}};