function createNewFolder(){document.location.href="/waynphotos.html?wci=albumsedit&folder=0"}function focusOnName(){try{if(document.userform&&document.userform.folder_name){document.userform.folder_name.focus()}}catch(a){}}function showPrivacySetting(b){var a=document.getElementById("privacySetting");if(a){if("inline"==a.style.display){a.style.display="none";b.innerHTML="Show privacy settings"}else{a.style.display="inline";b.innerHTML="Hide privacy settings"}}}function saveFolder(){var b;try{b=$("saveButton");if(b){b.onclick=null}if(""==$("folder_name").value||""==$("folder_name").value.strip()){alert("Folder name cannot be empty!");document.userform.folder_name.focus();return false}getPhotoKeys();document.userform.submit()}catch(a){}finally{if(b){b.onclick=saveFolder}}}function deleteFolder(a,d){var c;var b;b="Are you sure you want to delete this album?\n";if(d>0){b=b+"(Your photos won't be deleted)"}if(confirm(b)){c="/waynphotos.html?wci=albums&wce=delete&folder="+a;document.location.href=c}}function editFolder(a){document.location.href="/waynphotos.html?wci=albumsedit&folder="+a}function selectPhoto(a,b){if(!a){return}if(0==a.getAttribute("selected")){a.style.borderColor="orange";a.style.height=80;a.setAttribute("selected",1)}else{a.style.borderColor="#2070b3";a.style.height=75;a.setAttribute("selected",0)}}function folderList(){var a=$("order").value;var b=$("folder_id").value;document.location.href="/waynphotos.html?wci=album&folder="+b+"&order="+a}function addPhoto(a){if(!a){a=window.event}var b=a.target?a.target:a.srcElement;try{if(b&&"IMG"==b.tagName){addImage(b)}}catch(c){}}function removePhoto(a){var c=document.getElementById("photosInFolder");if(!a){a=window.event}var b=a.target?a.target:a.srcElement;if(b&&"IMG"==b.tagName){c.removeChild(b.parentNode)}}function addImage(h){var a=document.getElementById("photosInFolder");var d=a.childNodes.length;var f;var g;try{for(g=0;g<d;g++){f=a.childNodes[g];if("DIV"==f.tagName){len2=f.childNodes.length;for(j=0;j<len2;j++){if("IMG"==f.childNodes[j].tagName&&f.childNodes[j].id==h.id){setMessage("This picture is already in your folder.");return}}}}var b=document.createElement("DIV");b.style.styleFloat="left";b.style.cssFloat="left";b.style.width="80px";b.style.textAlign="center";b.style.margin="3px";var o=document.createElement("DIV");o.style.borderBottomWidth="1px";o.style.borderBottomStyle="dashed";o.style.borderBottomColor="#b7deef";var s=document.createElement("DIV");s.style.styleFloat="left";s.style.cssFloat="left";var m=document.createElement("DIV");m.style.styleFloat="right";m.style.cssFloat="right";m.style.marginTop="2px";var q=document.createElement("DIV");q.style.clear="both";var c="album_cover_"+h.id;var r=/PHOTO_/;if(Prototype.Browser.IE){var k=document.createElement('<input type="radio" id="'+c+'" name="radio_cover" value="'+h.id.replace(r,"")+'">')}else{var k=document.createElement("INPUT");k.type="radio";k.id=c;k.value=h.id.replace(r,"");k.name="radio_cover"}s.appendChild(k);var p=document.createElement("LABEL");p.className="textBlackSmall";p.htmlFor=c;p.innerHTML="Album cover";m.appendChild(p);o.appendChild(s);o.appendChild(m);o.appendChild(q);var e=document.createElement("IMG");e.src=h.src;e.title=h.title;e.id=h.id;e.onclick=removePhoto;b.appendChild(e);b.appendChild(o);f=a.insertBefore(b,null)}catch(n){}return f}function getPhotoKeys(){var e=$("photosInFolder");if(e){var a=e.childNodes.length;var f;var c;document.userform.photo_keys.value="0";var d=/PHOTO_/;try{for(c=0;c<a;c++){if("DIV"==e.childNodes[c].tagName){len2=e.childNodes[c].childNodes.length;for(j=0;j<len2;j++){if("IMG"==e.childNodes[c].childNodes[j].tagName){f=e.childNodes[c].childNodes[j].id.toString();f=f.replace(d,"");document.userform.photo_keys.value+=","+parseInt(f,10).toString()}}}}}catch(b){}}}var messageIntervalID;var opacityLevel;function fadeMessage(){var a=document.getElementById("message");opacityLevel--;if(a){a.style.opacity=opacityLevel/100;a.style.filter="alpha(opacity="+opacityLevel+")";if(0==opacityLevel){clearInterval(messageIntervalID);a.innerHTML="";a.style.opacity=0;a.style.filter="alpha(opacity=0)"}}}function setMessage(b){var a=document.getElementById("message");if(a){clearInterval(messageIntervalID);a.innerHTML=b;opacityLevel=100;messageIntervalID=setInterval("fadeMessage()",50)}}function changeOrder(a,b){var c="/waynphotos.html?wci=albums";if(a>0){c+="&member_key="+a}c+="&page=1&orderby="+b;document.location=c;return false}function getPreviewThumbs(a,c){var b="/waynphotos.html?wci=photo&wce=GetPreviewThumbsXML&photo_key="+a+"&package_number="+c+"&pagetype=album";callAjax(b,function(d){$("previewThumbs").innerHTML=d})};
