var siteversion = '2.0.1'; var reload = '0'; var sendReq = getXmlHttpRequestObject(); var receiveReq = getXmlHttpRequestObject(); var addnew = 1; var journalcomment = '0'; var uploadpicsactive = '0'; var deletemode = '0'; var scrOfX = 0, scrOfY = 0; var createpage = '0'; var myWidth = 0, myHeight = 0; var imagetarget = 'imagebrowser'; var searchtimer; var fade = '0'; var host = window.location.hostname; var saveimg = '0'; var newuploads = 0; var photodiraction = ''; var photodiractionid = ''; var config = 'general'; var edittexts = '0'; var saved = '1'; var selcover = '0'; var doclose = 0; Position.includeScrollOffsets = true; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } var myHeightLimit = myHeight - 100; function keepfocus() { var focus = document.activeElement; focus.focus(); } function cleartoolbarstatus() { document.getElementById('toolbarstatus').innerHTML = ''; } function clearJstatus() { document.getElementById('jstatus').innerHTML = ''; } function setCookieRes() { var today = new Date(); var the_date = new Date("August 31, 2020"); var the_cookie_date = the_date.toGMTString(); var the_cookie = "res="+ myWidth +"x"+ myHeight; var the_cookie = the_cookie + ";expires=" + the_cookie_date; document.cookie=the_cookie } setCookieRes(); function saveJournal() { document.getElementById('jstatus').innerHTML = 'Saving...'; var text = document.getElementById('edit').contentWindow.document.body.innerHTML; var title = document.getElementById('journaltitle').value; if(document.getElementById('publish').checked == '1') { var publish = '1'; } else { var publish = '0'; } if(document.getElementById('delete').checked == '1') { var jdelete = '1'; } else { var jdelete = '0'; } sendReq.open("POST", '/inc/ajax/journal_edit.php?id=' + document.getElementById('journalid').value, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleSaveJournal; var param = 'text=' + encodeURIComponent(text); param += '&title=' + encodeURIComponent(title); param += '&publish=' + publish; param += '&delete=' + jdelete; sendReq.send(param); } function handleSaveJournal() { if(sendReq.readyState == 4) { if(document.getElementById('delete').checked == '1') { location.href='/journal/'; } document.getElementById('jstatus').innerHTML = 'Changes saved'; setTimeout('clearJstatus();',3000); } } function saveCloseCustomPage() { doclose = 1; saveCustomPage(); } function saveCustomPage() { document.getElementById('toolbarstatus').innerHTML = 'Saving...'; var text = document.getElementById('edit').contentWindow.document.body.innerHTML; sendReq.open("POST", '/inc/ajax/page_edit.php?id=' + document.getElementById('pageid').value, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleSaveCustomPage; var param = 'text=' + encodeURIComponent(text); sendReq.send(param); } function handleSaveCustomPage() { if(sendReq.readyState == 4) { document.getElementById('toolbarstatus').innerHTML = 'Changes saved'; setTimeout('cleartoolbarstatus();',3000); if(doclose == 1) { location.href=document.getElementById('pageurl').value; } } } function deleteJournal() { if(document.getElementById('delete').checked == true) { alert("Your journal will be permanently deleted if you click \"Save\"."); } } function deleteComment(id) { var agree=confirm("Are you sure you want to delete the comment?"); if(agree) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/delcomment.php?pic=' + document.getElementById('picid').value + '&id=' + id, true); receiveReq.onreadystatechange = handleDeleteComment; receiveReq.send(null); } } } function cDelComment() { var agree=confirm("Are you sure you want to delete the comment?"); if (agree) return true ; else return false ; } function deleteJComment(journal,id) { var agree=confirm("Are you sure you want to delete the comment?"); if(agree) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/deljcomment.php?journal=' + journal + '&id=' + id, true); receiveReq.onreadystatechange = handleDeleteJComment; receiveReq.send(null); journalcomment = journal; } } } function handleDeleteComment() { if (receiveReq.readyState == 4) { getComments(); } } function handleDeleteJComment() { if (receiveReq.readyState == 4) { getJComments(); } } function addJComment(journal) { if(document.getElementById('journal_name-' + journal) != null && document.getElementById('journal_name-' + journal).value == 'Your name') { document.getElementById('commentspan-' + journal).innerHTML = 'You must write your name'; } else { if(document.getElementById('journal_comment-' + journal).value != '' && document.getElementById('journal_comment-' + journal).value != 'Write a comment') { if(document.getElementById('journal_name-' + journal) != null) { var name = encodeURIComponent(document.getElementById('journal_name-' + journal).value); } else { var name = ''; } sendReq.open("POST", '/inc/ajax/addcommentj.php?id=' + journal, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleAddJComment; var param = 'message=' + encodeURIComponent(document.getElementById('journal_comment-' + journal).value); param += '&reply_to=' + document.getElementById('reply_to-' + journal).value; param += '&viewhandler=a'; param += '&name=' + name; sendReq.send(param); journalcomment = journal; } else { document.getElementById('commentspan-' + journal).innerHTML = 'You must write a comment'; } } } function handleAddJComment() { if (sendReq.readyState == 4) { document.getElementById('journal_comment-' + journalcomment).value = 'Write a comment'; if(document.getElementById('journal_name-' + journalcomment) != null) { document.getElementById('journal_name-' + journalcomment).value = 'Your name'; } document.getElementById('commentspan-' + journalcomment).innerHTML = ''; document.getElementById('reply_to-' + journalcomment).value = '0'; document.getElementById('replycomment-' + journalcomment).innerHTML = ''; getJComments(); } } function addComment() { if(document.getElementById('img_name') != null && document.getElementById('img_name').value == 'Your name') { document.getElementById('commentspan').innerHTML = 'You must write your name'; } else { if(document.getElementById('img_comment').value != '' && document.getElementById('img_comment').value != 'Write a comment') { if(document.getElementById('img_name') != null) { var name = encodeURIComponent(document.getElementById('img_name').value); } else { var name = ''; } sendReq.open("POST", '/inc/ajax/addcomment.php?id=' + document.getElementById('picid').value, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleAddComment; var param = 'message=' + encodeURIComponent(document.getElementById('img_comment').value); param += '&reply_to=' + document.getElementById('reply_to').value; param += '&viewhandler=a'; param += '&name=' + name; sendReq.send(param); } else { document.getElementById('commentspan').innerHTML = 'You must write a comment'; } } } function handleAddComment() { if (sendReq.readyState == 4) { document.getElementById('img_comment').value = 'Write a comment'; if(document.getElementById('img_name') != null) { document.getElementById('img_name').value = 'Your name'; } document.getElementById('commentspan').innerHTML = ''; document.getElementById('reply_to').value = '0'; document.getElementById('replycomment').innerHTML = ''; getComments(); } } function doReply(id,from) { document.getElementById('reply_to').value = id; name = document.getElementById('name-' + id).innerHTML; comment = document.getElementById('comment-' + id).innerHTML; document.getElementById('replycomment').innerHTML = 'Replying to a comment from ' + name + ': ' + comment; document.getElementById('img_comment').focus(); } function doJReply(journal,id,from) { document.getElementById('reply_to-' + journal).value = id; name = document.getElementById('name-' + id + '-' + journal).innerHTML; comment = document.getElementById('comment-' + id + '-' + journal).innerHTML; document.getElementById('replycomment-' + journal).innerHTML = 'Replying to a comment from ' + name + ': ' + comment; } function toggleEditTexts() { if(edittexts == '0') { edittexts = '1'; document.getElementById('edittexts').innerHTML = 'Stop editing texts'; } else { stopEditTexts(); edittexts = '0'; document.getElementById('edittexts').innerHTML = 'Edit texts'; } } function editDiv(id) { var destroydrag = 'dragable_' + id; var label = 'edit-' + id; var object = 'object-' + id; document.getElementById('objecttext-' + id).contentEditable='true'; } function enableURL(id) { var field = 'url-' + id; var box = 'visible-' + id; if(document.getElementById(box).checked == '1') { document.getElementById(field).style.display = 'block'; } else { // document.getElementById(field).style.display = 'none'; } } function nullAction() { void(0); } function cpAddPage() { } function checkShortname() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/checkshortname.php?shortname=' + document.getElementById('cp_edit_url').value + '&page=' + document.getElementById('cp_edit_id').value, true); receiveReq.onreadystatechange = handleCheckShortname; receiveReq.send(null); } } function handleCheckShortname() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("checkshortname"); var n_messages = topnavi_nodes.length; var put = ''; for (k = 0; k < n_messages; k++) { var shortname_node = topnavi_nodes[k].getElementsByTagName("shortname"); var status_node = topnavi_nodes[k].getElementsByTagName("status"); document.getElementById('cp_edit_url').value = shortname_node[0].firstChild.nodeValue; } } } function addFavorite() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/favorite.php?action=add&id=' + document.getElementById('picid').value, true); receiveReq.onreadystatechange = handleFavorites; receiveReq.send(null); } } function delFavorite() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/favorite.php?action=del&id=' + document.getElementById('picid').value, true); receiveReq.onreadystatechange = handleFavorites; receiveReq.send(null); } } function handleFavorites() { if (receiveReq.readyState == 4) { getFavorites(); } } var getnewsfrom = 0; function getOlderNews() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { getnewsfrom = getnewsfrom + 15; receiveReq.open("GET", '/inc/ajax/newsfeed.php?from=' + getnewsfrom, true); receiveReq.onreadystatechange = handleGetOlderNews; receiveReq.send(null); } } function handleGetOlderNews() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("newsfeed"); var n_messages = topnavi_nodes.length; var put = ''; for (k = 0; k < n_messages; k++) { var message_node = topnavi_nodes[k].getElementsByTagName("message"); put += message_node[0].firstChild.nodeValue; } put += '
'; document.getElementById('newsfeedtarget').innerHTML += put; } } function getNews() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/newsfeed.php', true); receiveReq.onreadystatechange = handleGetNews; receiveReq.send(null); } } function handleGetNews() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("newsfeed"); var n_messages = topnavi_nodes.length; var put = ''; for (k = 0; k < n_messages; k++) { var message_node = topnavi_nodes[k].getElementsByTagName("message"); put += message_node[0].firstChild.nodeValue; } put += '
'; document.getElementById('newsfeedtarget').innerHTML = put; } } function getFavorites() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/favorites.php?id=' + document.getElementById('picid').value, true); receiveReq.onreadystatechange = handleGetFavorites; receiveReq.send(null); } } function handleGetFavorites() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("fav"); var n_messages = topnavi_nodes.length; var put = ''; for (k = 0; k < n_messages; k++) { var favorite_node = topnavi_nodes[k].getElementsByTagName("favorite"); put += favorite_node[0].firstChild.nodeValue; } document.getElementById('favorites').innerHTML = put; } } function getJComments() { if (journalcomment != '0') { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/commentsj.php?id=' + journalcomment, true); receiveReq.onreadystatechange = handleGetJComments; receiveReq.send(null); } } } function handleGetJComments() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("cc"); var n_messages = topnavi_nodes.length; var put = ''; for (k = 0; k < n_messages; k++) { var comment_node = topnavi_nodes[k].getElementsByTagName("comment"); put += comment_node[0].firstChild.nodeValue; } document.getElementById('comments-' + journalcomment).innerHTML = put; journalcomment = '0'; } } function getComments() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/comments.php?id=' + document.getElementById('picid').value, true); receiveReq.onreadystatechange = handleGetComments; receiveReq.send(null); } } function handleGetComments() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("cc"); var n_messages = topnavi_nodes.length; var put = ''; for (k = 0; k < n_messages; k++) { var comment_node = topnavi_nodes[k].getElementsByTagName("comment"); put += comment_node[0].firstChild.nodeValue; } document.getElementById('comments').innerHTML = put; } } function cpEditPage(id) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { Effect.Appear('editpage', { duration: 0.2 }); document.getElementById('pages_1').style.opacity = '0.2'; document.getElementById('savesettings').style.opacity = '0.2'; receiveReq.open("GET", '/inc/ajax/page.php?id=' + id, true); receiveReq.onreadystatechange = handleCpEditPage; receiveReq.send(null); } } function handleCpEditPage() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("page"); var n_messages = topnavi_nodes.length; var put = ''; for (k = 0; k < n_messages; k++) { var masterid_node = topnavi_nodes[k].getElementsByTagName("masterid"); var title_node = topnavi_nodes[k].getElementsByTagName("title"); var type_node = topnavi_nodes[k].getElementsByTagName("type"); var published_node = topnavi_nodes[k].getElementsByTagName("published"); var shortname_node = topnavi_nodes[k].getElementsByTagName("shortname"); var topnavi_node = topnavi_nodes[k].getElementsByTagName("topnavi"); var showtitle_node = topnavi_nodes[k].getElementsByTagName("showtitle"); if(published_node[0].firstChild.nodeValue == '1') { var publishstate = ' checked'; } else { var publishstate = ''; } if(topnavi_node[0].firstChild.nodeValue == '1') { var topnavistate = ' checked'; } else { var topnavistate = ''; } if(showtitle_node[0].firstChild.nodeValue == '1') { var showtitle = ' checked'; } else { var showtitle = ''; } put += '
Page title
Change the page title (visible in the title bar of the browser and in the navigation)..
Show the title at the top of the page
'; if(type_node[0].firstChild.nodeValue == '1') { put += '
Page shortname
The shortname is visible in the web address (URL) to the page. It cannot be more than 20 characters long, and must only contain letters between a-z.
http://' + host + '/p/
'; } put += '
Publish
Only you will be able to access a page that is not published.
Publish this page
'; put += '
Top navigation
You can publish this in the top navigation if you want your visitors to be able to find the page without you linking to it.
Visible in top navigation
'; } put += '
'; if(type_node[0].firstChild.nodeValue == '1') { put += 'Delete page '; } put += 'Discard changes Save changes



'; document.getElementById('editpagediv').innerHTML = put; } } function deletePage() { var agree=confirm("Are you sure you want to delete this page?"); if(agree) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/delpage.php?id=' + document.getElementById('cp_edit_id').value, true); receiveReq.onreadystatechange = handleDeletePage; receiveReq.send(null); } } } function handleDeletePage() { if (receiveReq.readyState == 4) { abortCpEditPage(); setTimeout('getPages();',500); } } function abortCpEditPage() { Effect.Fade('editpage', { duration: 0.2 }); document.getElementById('pages_1').style.opacity = '1'; document.getElementById('savesettings').style.opacity = '1'; } function confSwitch(to) { var toelement = 'button_' + to; var fromelement = 'button_' + config; var todivelement = 'settings_' + to; var fromdivelement = 'settings_' + config; if(to != config) { document.getElementById(toelement).setAttribute("class", "settingsactive"); document.getElementById(fromelement).setAttribute("class", "settings"); document.getElementById(fromdivelement).style.display = 'none'; document.getElementById(todivelement).style.display = 'block'; config = to; } } function createNewPage() { if (sendReq.readyState == 4 || sendReq.readyState == 0) { sendReq.open("POST", '/inc/ajax/newpage.php', true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleCreateNewPage; var param = 'do=createpage'; sendReq.send(param); } } function handleCreateNewPage() { if (sendReq.readyState == 4) { createpage = '1'; getPages(); } } function saveCpEditPage() { if (sendReq.readyState == 4 || sendReq.readyState == 0) { if(document.getElementById('cp_edit_publish').checked == '1') { var cp_edit_publish = 'on'; } else { var cp_edit_publish = 'off'; } if(document.getElementById('cp_edit_topnavi').checked == '1') { var cp_edit_topnavi = 'on'; } else { var cp_edit_topnavi = 'off'; } if(document.getElementById('cp_edit_showtitle').checked == '1') { var cp_edit_showtitle = 'on'; } else { cp_edit_showtitle = 'off'; } sendReq.open("POST", '/inc/ajax/savepage.php?id=' + document.getElementById('cp_edit_id').value, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleSaveCpEditPage; var param = 'cp_edit_title=' + encodeURIComponent(document.getElementById('cp_edit_title').value); if(document.getElementById('cp_edit_type').value == '1') { param += '&cp_edit_url=' + document.getElementById('cp_edit_url').value; } param += '&cp_edit_publish=' + cp_edit_publish; param += '&cp_edit_topnavi=' + cp_edit_topnavi; param += '&cp_edit_showtitle=' + cp_edit_showtitle; sendReq.send(param); } } function handleSaveCpEditPage() { if (sendReq.readyState == 4) { abortCpEditPage(); setTimeout('getPages();',500); } } function saveConfig() { saved = '1'; if (sendReq.readyState == 4 || sendReq.readyState == 0) { document.getElementById('controlpanelstatus').innerHTML = 'Saving...'; if(document.getElementById('cp_anoncomment').checked == '1') { var cp_anoncomment = 'on'; } else { var cp_anoncomment = 'off'; } if(document.getElementById('cp_authcomment').checked == '1') { var cp_authcomment = 'on'; } else { var cp_authcomment = 'off'; } if(document.getElementById('cp_guestbook').checked == '1') { var cp_guestbook = 'on'; } else { var cp_guestbook = 'off'; } if(document.getElementById('cp_published').checked == '1') { var cp_published = 'on'; } else { var cp_published = 'off'; } if(document.getElementById('cp_authfav').checked == '1') { var cp_authfav = 'on'; } else { var cp_authfav = 'off'; } if(document.getElementById('cp_centernavi').checked == '1') { var cp_centernavi = 'on'; } else { var cp_centernavi = 'off'; } if(document.getElementById('cp_homebutton').checked == '1') { var cp_homebutton = 'on'; } else { var cp_homebutton = 'off'; } if(document.getElementById('cp_fullheight').checked == '1') { var cp_fullheight = 'on'; } else { var cp_fullheight = 'off'; } if(document.getElementById('cp_logospace').checked == '1') { var cp_logospace = 'on'; } else { cp_logospace = 'off'; } if(document.getElementById('cp_facebook') != null) { if(document.getElementById('cp_facebook').checked == '1') { var cp_facebook = 'on'; } else { var cp_facebook = 'off'; } } else { var cp_facebook = 'off'; } //if(document.getElementById('cp_anoncomment').checked == '1') { var cp_anoncomment = 'on'; } else { var cp_anoncomment = 'off'; } //if(document.getElementById('cp_anoncomment').checked == '1') { var cp_anoncomment = 'on'; } else { var cp_anoncomment = 'off'; } sendReq.open("POST", '/ajax/saveconf.php', true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleSaveConfig; var param = 'cp_title=' + encodeURIComponent(document.getElementById('cp_title').value); param += '&cp_lang=' + document.getElementById('cp_lang').value; param += '&cp_urchintracker=' + document.getElementById('cp_urchintracker').value; param += '&cp_anoncomment=' + cp_anoncomment; param += '&cp_authcomment=' + cp_authcomment; param += '&cp_authfav=' + cp_authfav; param += '&cp_guestbook=' + cp_guestbook; param += '&cp_custom=' + document.getElementById('cp_custom').value; param += '&cp_centernavi=' + cp_centernavi; param += '&cp_published=' + cp_published; param += '&cp_theme=' + document.getElementById('cp_theme').value; param += '&cp_logospace=' + cp_logospace; param += '&cp_front=' + document.getElementById('cp_front').value; param += '&cp_front_albumid=' + document.getElementById('cp_front_albumid').value; param += '&cp_front_id=' + document.getElementById('cp_front_id').value; param += '&cp_facebook=' + cp_facebook; param += '&cp_homebutton=' + cp_homebutton; param += '&cp_fullheight=' + cp_fullheight; var order = ''; var uoDiv = document.getElementById('pagesul'); if(uoDiv.firstChild) { var uoChild = uoDiv.firstChild; while(uoChild) { if(uoChild.nodeType==1) { var publishedpage = 'publish-' + uoChild.id; if(document.getElementById(publishedpage).checked == '1') { var dopublish = '1'; } else { var dopublish = '0'; } order += uoChild.id + ',' + dopublish + ':'; } uoChild = uoChild.nextSibling; } } param += '&cp_pages=' + order; sendReq.send(param); } } function handleSaveConfig() { if (sendReq.readyState == 4) { document.getElementById('controlpanelstatus').innerHTML = 'Saved.  Close control panel'; } } function saveImage(id,box) { var button = 'button-' + id; var buttonspan = 'buttonspan-' + id; document.getElementById(button).style.opacity = '0.3'; document.getElementById(buttonspan).innerHTML = 'Saving...'; document.getElementById(button).onclick = nullAction(); doSaveImage(id,box); } function registerChange() { saved = '0'; } function checkChanges() { if(saved == '0') { var agree=confirm("Any changes you have made that you have not saved will be discarded. Continue?"); if(agree) { closecontrolpanel(); } } else { closecontrolpanel(); window.location.href=window.location.href; } } function controlpanel() { fadeon('controlpanel'); var setwidth = (parseInt(myWidth)/2)-400; document.getElementById('controlpanel').style.maxHeight = myHeightLimit + 'px'; document.getElementById('controlpanel').style.display = 'block'; document.getElementById('controlpanel').style.left = setwidth + 'px'; setTimeout('getPages();',500); setTimeout('getApps();',700); } function closecontrolpanel() { fadeoff('controlpanel'); document.getElementById('controlpanel').style.display = 'none'; } function doSaveImage2() { document.getElementById('imgpropertiesb').style.opacity = '0.3'; if (sendReq.readyState == 4 || sendReq.readyState == 0) { if(document.getElementById('edit_delete').checked == '1') { photodiraction = 'deleted'; var deletevalue = 'on'; } else { var deletevalue = 'off'; photodiraction = 'saved'; } if(document.getElementById('edit_visible').checked == '1') { var visiblevalue = 'on'; } else { var visiblevalue = 'off'; } photodiractionid = document.getElementById('imageid').value; sendReq.open("POST", '/ajax/saveimage.php?id=' + document.getElementById('imageid').value, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleDoSaveImage2; var param = 'title=' + encodeURIComponent(document.getElementById('edit_title').value); param += '&desc=' + encodeURIComponent(document.getElementById('edit_desc').value); param += '&visible=' + visiblevalue; param += '&delete=' + deletevalue; sendReq.send(param); } } function handleDoSaveImage2() { if (sendReq.readyState == 4) { closePopup2(); if(uploadpicsactive == 1) { document.getElementById('photodiraction').innerHTML = 'Photo #' + photodiractionid + ' ' + photodiraction + ''; Effect.Appear('photodiraction'); getImages(); setTimeout('hidePhotoDirAction();',5000); photodiractionid = ''; photodiraction = ''; } else { window.location.href=window.location.href + '/saved/'; } } } function hidePhotoDirAction() { Effect.Fade('photodiraction'); } function doSaveImage(id,box) { if (sendReq.readyState == 4 || sendReq.readyState == 0) { var title = 'title-' + id; var description = 'desc-' + id; var visible = 'visible-' + id; if(document.getElementById(visible).checked == '1') { var visiblevalue = 'on'; } else { var visiblevalue = 'off'; } sendReq.open("POST", '/ajax/saveimage.php?id=' + id, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleDoSaveImage; var param = 'title=' + encodeURIComponent(document.getElementById(title).value); param += '&desc=' + encodeURIComponent(document.getElementById(description).value); param += '&visible=' + visiblevalue; sendReq.send(param); saveimg = box; } } function handleDoSaveImage() { if (sendReq.readyState == 4) { if(saveimg != '0') { var box = 'box-' + saveimg; Effect.Fade(box); saveimg = '0'; newuploads = newuploads - 1; if(newuploads == 0) { Effect.Fade('uploadsdiv', { duration: 1.0 }); } } } } function deleteObject() { if(deletemode == '0') { deletemode = '1'; document.getElementById('deletebutton').innerHTML = 'Abort delete'; } else { deletemode = '0'; document.getElementById('deletebutton').innerHTML = 'Delete objects'; } } function selectCover(id) { document.getElementById('img-' + id).style.border = '4px solid #666'; var oldcover = document.getElementById('cover').value; if(oldcover != '0') { document.getElementById('img-' + oldcover).style.border = '4px solid #333'; } document.getElementById('cover').value = id; selectGalleryCover(); } function doAddImagesToGallery() { // selectimageshidden var order = ''; document.getElementById('finishspan').innerHTML = 'Saving...'; document.getElementById('finisha').style.opacity = '0.7'; var oDiv = document.getElementById('selectimageshidden'); if(oDiv.firstChild) { var oChild = oDiv.firstChild; while(oChild) { if(oChild.nodeType==1) { if(document.getElementById(oChild.id).value == '1') { order += oChild.id + ':'; } } oChild = oChild.nextSibling; } } sendReq.open("POST", '/ajax/imagestogallery.php?id=' + document.getElementById('gallery_id').value, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleDoAddImagesToGallery; var param = 'images=' + encodeURIComponent(order); sendReq.send(param); } function handleDoAddImagesToGallery() { if (sendReq.readyState == 4) { closePopup2(); setTimeout('getGalleryImages();',500); } } function aselectGalleryCover() { document.getElementById('popupdiv2').innerHTML = '
Select a gallery cover
'; document.getElementById('popupdiv2').innerHTML += '
Make the selection
Click on the image you wish to select as gallery cover.
'; document.getElementById('popupdiv2').innerHTML += '
'; setTimeout('getSelectedImages();',500); showPopup2(); } function selectGalleryCover() { if(selcover == '0') { document.getElementById('selectgallerycover').innerHTML = 'Abort cover selection'; alert('Click on an image below to set it as gallery cover.'); selcover = '1'; } else { selcover = '0'; document.getElementById('selectgallerycover').innerHTML = 'Select gallery cover'; } } function onclickCover(id) { if(selcover == '1') { selectCover(id); } } function addImagesToGallery() { document.getElementById('popupdiv2').innerHTML = '
Add and remove images for gallery
'; document.getElementById('popupdiv2').innerHTML += '
Finished with selection
'; document.getElementById('popupdiv2').innerHTML += '
Make the selection
Checked images are not selected for your gallery. Click on them to add them to the gallery. The reversed procedure will remove an image from the gallery.
'; document.getElementById('popupdiv2').innerHTML += '
'; setTimeout('getSelectedImages();',500); showPopup2(); } function imageProperties(id) { document.getElementById('popupdiv2').innerHTML = '
Image properties #' + id + '
'; document.getElementById('popupdiv2').innerHTML += '
 
'; showPopup2(); getImageProperties(id); } function getImageProperties(id) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/image.php?id=' + id, true); receiveReq.onreadystatechange = handleGetImageProperties; receiveReq.send(null); } } function imagePropertiesUrl() { if(document.getElementById('edit_visible').checked == '1') { document.getElementById('url').style.display = 'block'; } else { document.getElementById('url').style.display = 'none'; } } function imagePropertiesDelete() { if(document.getElementById('edit_delete').checked == '1') { document.getElementById('delete').style.display = 'block'; document.getElementById('propimage').style.opacity = '.2'; document.getElementById('hide2').style.opacity = '.2'; document.getElementById('hide3').style.opacity = '.2'; document.getElementById('hide4').style.opacity = '.2'; document.getElementById('url').style.opacity = '.2'; } else { document.getElementById('delete').style.display = 'none'; document.getElementById('propimage').style.opacity = '1'; document.getElementById('hide2').style.opacity = '1'; document.getElementById('hide3').style.opacity = '1'; document.getElementById('hide4').style.opacity = '1'; document.getElementById('url').style.opacity = '1'; } } function handleGetImageProperties() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("img"); var n_messages = topnavi_nodes.length; var put = ''; for (k = 0; k < n_messages; k++) { var photoid_node = topnavi_nodes[k].getElementsByTagName("photoid"); var title_node = topnavi_nodes[k].getElementsByTagName("title"); var desc_node = topnavi_nodes[k].getElementsByTagName("desc"); var visible_node = topnavi_nodes[k].getElementsByTagName("visible"); var views_node = topnavi_nodes[k].getElementsByTagName("views"); } if(photoid_node[0].firstChild.nodeValue) { document.getElementById('uniqueviews').innerHTML = 'This picture has been viewed ' + views_node[0].firstChild.nodeValue + ' unique times.'; if(title_node[0].firstChild.nodeValue == 'false') { title_node[0].firstChild.nodeValue = 'Photo title'; } if(desc_node[0].firstChild.nodeValue == 'false') { desc_node[0].firstChild.nodeValue = 'Photo description'; } if(visible_node[0].firstChild.nodeValue == '1') { var visiblestate = 'checked'; var visiblestate2 = ' style="display: block;"'; } else { var visiblestate = ''; var visiblestate2 = ''; } document.getElementById('imageproperties2').innerHTML = '
'; document.getElementById('imageproperties2').innerHTML += '
URL to this image: http://' + host + '/photo/' + photoid_node[0].firstChild.nodeValue + '
'; document.getElementById('imageproperties2').innerHTML += ''; document.getElementById('imageproperties2').innerHTML += '
Save changes Close without saving
'; } else { document.getElementById('imageproperties2').innerHTML = 'The image cannot be found!'; document.getElementById('imageproperties2').innerHTML += '
Close
'; } } } function displayImage(id) { document.getElementById('fade3').style.display = 'block'; document.getElementById('imageviewer').innerHTML = ''; } function displayImage2() { var imgwidth = document.getElementById('displayimage').width; var imgheight = document.getElementById('displayimage').height; var right = (myWidth/2)-(imgwidth/2); var top = ((myHeight/2)-(imgheight/2))-20; document.getElementById('imageviewer').style.top = top + 'px'; document.getElementById('imageviewer').style.right = right + 'px'; document.getElementById('imageviewer').style.display = 'block'; } function hideImage() { fadeoff('image'); document.getElementById('imageviewer').style.display = 'none'; document.getElementById('fade3').style.display = 'none'; } function deleteGalleryCat(id) { var agree=confirm("Are you sure you want to delete the gallery category? It will be deleted immediately and galleries within it will be moved to Uncategorized."); if(agree) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/deletegallerycat.php?id=' + id, true); receiveReq.onreadystatechange = handleDeleteGalleryCat; receiveReq.send(null); } } } function handleDeleteGalleryCat() { if (receiveReq.readyState == 4) { getGalleries(); } } function deleteGallery(id) { var agree=confirm("Confirm that you want to delete the gallery. It cannot be undone."); if(agree) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/deletegallery.php?id=' + id, true); receiveReq.onreadystatechange = handleDeleteGallery; receiveReq.send(null); } } } function handleDeleteGallery() { if (receiveReq.readyState == 4) { getGalleries(); } } function clickAction(id) { var clickobject = 'object-' + id; var linkobject = 'link-object-' + id; if(deletemode == '1') { var agree = confirm("Are you sure you want to delete this object? If you want to turn off delete mode, click \"Abort delete\" in the toolbox."); if(agree) { document.getElementById(clickobject).contentEditable = "false"; var d = document.getElementById('custompage'); var olddiv = document.getElementById(clickobject); d.removeChild(olddiv); // deleteObject(); var deletedobjects = document.getElementById('deletedobjects').value; if(document.getElementById(linkobject) == null) { document.getElementById('deletedobjects').value = deletedobjects + ':' + id; } } } } function saveProperties(page) { document.getElementById('propertiesspan').innerHTML = 'Saving...'; sendReq.open("POST", '/ajax/properties_save.php', true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleSaveProperties; var param = 'from_page=' + encodeURIComponent(page); if(page == 'gallery' || page == 'galleryp') { if(document.getElementById('thumbsize1').checked) { var thumbsize = '1'; } if(document.getElementById('thumbsize2').checked) { var thumbsize = '2'; } if(document.getElementById('thumbsize3').checked) { var thumbsize = '3'; } } if(page == 'gallery') { if(document.getElementById('published').checked == '1') { var gpublished = '0'; } else { var gpublished = '1'; } if(document.getElementById('titles').checked == '1') { var gtitles = '1'; } else { var gtitles = '0'; } param += '&thumbsize=' + encodeURIComponent(thumbsize); param += '&gallery_id=' + document.getElementById('gallery_id').value; var order = ''; var uoDiv = document.getElementById('galleryimages'); if(uoDiv.firstChild) { var uoChild = uoDiv.firstChild; while(uoChild) { if(uoChild.nodeType==1) { order += uoChild.id + ':'; } uoChild = uoChild.nextSibling; } } param += '&galleryorder=' + order; param += '&cover=' + document.getElementById('cover').value; param += '&published=' + gpublished; param += '&titles=' + gtitles; param += '&galleryname=' + encodeURIComponent(document.getElementById('edit_gallery_name').value); } if(page == 'galleryp') { param += '&thumbsize=' + encodeURIComponent(thumbsize); // ASD var level1 = ''; var level2 = ''; var uncategorized = ''; var uoDiv = document.getElementById('ul-sub-uncat'); if(uoDiv.firstChild) { var uoChild = uoDiv.firstChild; while(uoChild) { if(uoChild.nodeType==1) { uncategorized += uoChild.id + ':'; } uoChild = uoChild.nextSibling; } } var oDiv = document.getElementById('master'); if(oDiv.firstChild) { var oChild = oDiv.firstChild; while(oChild) { if(oChild.nodeType==1) { level1 += oChild.id + ':'; // BEGIN SECOND RUN var ooDiv = document.getElementById(oChild.id); if(ooDiv.firstChild) { var ooChild = ooDiv.firstChild; while(ooChild) { if(ooChild.nodeType==1) { // BEGIN THIRD RUN var oooDiv = document.getElementById(ooChild.id); if(oooDiv.firstChild) { var oooChild = oooDiv.firstChild; while(oooChild) { if(oooChild.nodeType==1) { if(oooChild.id) { level2 += oooChild.id + '/' + oChild.id + ':'; } } oooChild = oooChild.nextSibling; } } // END THIRD RUN } ooChild = ooChild.nextSibling; } } // END SECOND RUN } oChild = oChild.nextSibling; } } } if(document.getElementById('blocklatest') != null) { if(document.getElementById('blocklatest').checked == '1') { var blocklatest = 'on'; } else { var blocklatest = 'off'; } } else { var blocklatest = 'off'; } param += '&blocklatest=' + blocklatest; param += '&level1=' + encodeURIComponent(level1); param += '&level2=' + encodeURIComponent(level2); param += '&uncategorized=' + encodeURIComponent(uncategorized); sendReq.send(param); } function handleSaveProperties() { if (sendReq.readyState == 4) { document.getElementById('propertiesspan').innerHTML = 'Changes saved'; } } function addGallery() { Effect.Appear('newgallery', { duration: 1.0 }); Effect.Fade('popupbutton', { duration: 1.0, to: 0.3 }); } function abortAddGallery() { Effect.Fade('newgallery', { duration: 1.0 }); Effect.Appear('popupbutton', { duration: 1.0, to: 1.0 }); } function doAddGallery() { if(document.getElementById('new_gallery_name').value != 'Enter a gallery name') { Effect.Fade('newgallery', { duration: 1.0 }); Effect.Appear('popupbutton', { duration: 1.0, to: 1.0 }); sendReq.open("POST", '/ajax/addgallery.php', true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleDoAddGallery; var param = 'galleryname=' + encodeURIComponent(document.getElementById('new_gallery_name').value); sendReq.send(param); document.getElementById('new_gallery_name').value = 'Enter a gallery name'; } else { alert("You must enter a gallery name!"); } } function handleDoAddGallery() { if (sendReq.readyState == 4) { getGalleries(); } } function addGalleryCat() { Effect.Appear('newgallerycat', { duration: 1.0 }); Effect.Fade('popupbutton', { duration: 1.0, to: 0.3 }); } function abortAddGalleryCat() { Effect.Fade('newgallerycat', { duration: 1.0 }); Effect.Appear('popupbutton', { duration: 1.0, to: 1.0 }); } function doAddGalleryCat() { if(document.getElementById('new_gallerycat_name').value != 'Enter a gallery category name') { Effect.Fade('newgallerycat', { duration: 1.0 }); Effect.Appear('popupbutton', { duration: 1.0, to: 1.0 }); sendReq.open("POST", '/ajax/addgallerycat.php', true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleDoAddGalleryCat; var param = 'gallerycatname=' + encodeURIComponent(document.getElementById('new_gallerycat_name').value); sendReq.send(param); document.getElementById('new_gallerycat_name').value = 'Enter a gallery category name'; } else { alert("You must enter a gallery category name!"); } } function handleDoAddGalleryCat() { if (sendReq.readyState == 4) { getGalleries(); } } function fieldCheck(id,defvalue,action) { if(action == 'focus') { if(document.getElementById(id).value == defvalue) { document.getElementById(id).value = ''; } } if(action == 'blur') { if(document.getElementById(id).value == '') { document.getElementById(id).value = defvalue; } } } function showNews() { document.getElementById('popupdiv').innerHTML = '
News and updates
'; document.getElementById('popupdiv').innerHTML += '
Newsfeed
All news related to your homepage
'; document.getElementById('popupdiv').innerHTML += '
Fetching news...
'; document.getElementById('popupdiv').innerHTML += '
Get older news



'; showPopup(); getNews(); } function pageProperties(page) { reload = '1'; document.getElementById('popupdiv').innerHTML = '
Properties
'; document.getElementById('popupdiv').innerHTML += '
'; document.getElementById('popupdiv').innerHTML += '
'; document.getElementById('popupdiv').innerHTML += '
'; if(page == 'galleryp') { document.getElementById('popupdiv').innerHTML += '
Configuring gallery overview page
'; } if(page == 'gallery') { document.getElementById('popupdiv').innerHTML += '
Configuring gallery ' + document.getElementById('gallery_name').value + '
'; } if(page == 'galleryp') { document.getElementById('popupdiv').innerHTML += '
Galleries and categories
Re-order galleries by dragging them. Move them to another category by dropping them on the category title.
Fetching galleries...
Add gallery Add gallery category
'; setTimeout('getGalleries();',500); document.getElementById('popupdiv').innerHTML += ''; document.getElementById('popupdiv').innerHTML += ''; if(document.getElementById('block_latest').value == '1') { var latestblocked = ' checked'; } document.getElementById('popupdiv').innerHTML += '
Other settings
Miscellaneous settings
'; } if(page == 'gallery') { if(document.getElementById('galleryp_publish').value == '1') { var publishstate = ''; } else { var publishstate = ' checked'; } if(document.getElementById('galleryp_titles').value != '1') { var titlesstate = ''; } else { var titlesstate = ' checked'; } document.getElementById('popupdiv').innerHTML += '
Gallery name and publish state
Change the name of your gallery here and decide if you want it to be published (publically visible).
Published
Show titles below thumbs in gallery
'; document.getElementById('popupdiv').innerHTML += '
Add, remove, re-order images and set gallery cover
Add and remove images to your gallery. Drag them around to change the order.
Add and remove images Select gallery cover
'; setTimeout('getGalleryImages();', 500); } if(page == 'galleryp' || page == 'gallery') { var val1 = ''; var val2 = ''; var val3 = ''; if(document.getElementById('galleryp_size').value == '1') { val1 = ' checked'; } if(document.getElementById('galleryp_size').value == '2') { val2 = ' checked'; } if(document.getElementById('galleryp_size').value == '3') { val3 = ' checked'; } document.getElementById('popupdiv').innerHTML += '
Thumbnail size
Select which size you want on the thumbnails in this view.
'; } document.getElementById('popupdiv').innerHTML += '
'; document.getElementById('popupdiv').innerHTML += '
 
Save changes Close
'; showPopup(); } function mainLoop() { } function getApps() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/apps.php', true); receiveReq.onreadystatechange = handleGetApps; receiveReq.send(null); } } function getPages() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/pages.php?get=full', true); receiveReq.onreadystatechange = handleGetPages; receiveReq.send(null); } } function getGalleries() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/galleries.php?get=full', true); receiveReq.onreadystatechange = handleGetGalleries; receiveReq.send(null); } } function galleryMove(from,to) { var d_nested = document.getElementById(from); var d = d_nested.parentNode; var oldcontent = d_nested.innerHTML; var throwawayNode = d.removeChild(d_nested); var toul = 'ul-' + to; document.getElementById(toul).innerHTML += '
  • ' + oldcontent + '
  • '; Sortable.create(toul); Sortable.create(d); Droppables.add(to, { accept: 'gallerydrop', hoverclass: 'gallerydropdivhover', onDrop: function(dragged, dropped, event) { galleryMove(dragged.id,dropped.id); } }); } function handleGetGalleries() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("galleries"); var n_messages = topnavi_nodes.length; var put = ''; document.getElementById('galleryorder').innerHTML = put; Sortable.create('master'); for(sortloop = 0; sortloop < mySortables.length; sortloop++) { Sortable.create(mySortables[sortloop]); } for(droploop = 0; droploop < myDroppables.length; droploop++) { Droppables.add(myDroppables[droploop], { accept: 'gallerydrop', hoverclass: 'gallerydropdivhover', onDrop: function(dragged, dropped, event) { galleryMove(dragged.id,dropped.id); } }); } } } function uninstall(id,app) { var agree=confirm("Are you sure you want to uninstall this application?"); if(agree) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/uninstall.php?app=' + id, true); receiveReq.onreadystatechange = handleInstall; receiveReq.send(null); document.getElementById('appssplash').innerHTML = 'Application "' + app + '" is now uninstalled.

    '; } } } function install(id,app) { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/inc/ajax/install.php?app=' + id, true); receiveReq.onreadystatechange = handleInstall; receiveReq.send(null); document.getElementById('appssplash').innerHTML = 'Application "' + app + '" is now successfully installed. You must publish the page for this application before the visitors can see it (do it in the Pages-tab).

    '; } } function handleInstall() { if (receiveReq.readyState == 4) { getApps(); setTimeout('getPages();',500); } } function handleGetApps() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("apps"); var n_messages = topnavi_nodes.length; var installed = '

    Installed applications

    Not installed applications

    '; document.getElementById('appsdiv').innerHTML = installed; document.getElementById('appsdiv').innerHTML += notinstalled; } } function handleGetPages() { var editpage = ''; if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("page"); var n_messages = topnavi_nodes.length; var put = '
    Publish
    '; document.getElementById('pagestarget').innerHTML = put; Sortable.create('pagesul'); if(editpage != '') { cpEditPage(editpage); } } } function showElement(id) { if(edit == '1') { var objectchange = 'options-' + id; document.getElementById(objectchange).style.display = 'block'; } } function hideElement(id){ if(edit == '1') { var objectchange = 'options-' + id; document.getElementById(objectchange).style.display = 'none'; } } function addText() { addnew = addnew + 1; document.getElementById('custompage').innerHTML += '
    Enter your text here
    '; document.getElementById('object-new-' + addnew).contentEditable='true'; enableDrag(); document.getElementById('object-new-' + addnew).focus(); } var selected = ''; function doAddLink() { if(document.getElementById('target1').checked == 1) { document.getElementById('edit').contentWindow.document.execCommand( 'unlink', false, null ); } if(document.getElementById('target2').checked == 1) { var addurl = document.getElementById('link_url').value; } if(document.getElementById('target3').checked == 1) { var addurl = document.getElementById('pagesel').value; } if(document.getElementById('target4').checked == 1) { var addurl = document.getElementById('photosel').value; } if(document.getElementById('target5').checked == 1) { var addurl = document.getElementById('pagesel').value; } if(addurl) { if(document.getElementById('opennew').checked != 1) { document.getElementById('edit').contentWindow.document.execCommand("CreateLink",false,addurl); } else { var url2 = "javascript:openLinkPopup('" + addurl + "')"; document.getElementById('edit').contentWindow.document.execCommand("CreateLink",false,url2); } } closePopup(); } function openLinkPopup(URI){ win = window.open(URI,"secWin","scrollbars=yes,resiz able=yes,location=yes"); win.focus; } function linkType() { if(selected != '') { var hidebox = selected + 'seldiv'; if(document.getElementById(hidebox) != null) { document.getElementById(hidebox).style.display = 'none'; } } if(document.getElementById('target1').checked == 1) { document.getElementById('typedivheader').style.display = 'none'; } if(document.getElementById('target2').checked == 1) { document.getElementById('linktitle').innerHTML = 'Enter URL'; document.getElementById('linkdesc').innerHTML = 'Type the URL that you wish to link to'; document.getElementById('typedivheader').style.display = 'block'; selected = 'url'; } if(document.getElementById('target3').checked == 1) { document.getElementById('linktitle').innerHTML = 'Select a page'; document.getElementById('linkdesc').innerHTML = 'Select one of your pages to link to'; document.getElementById('typedivheader').style.display = 'block'; selected = 'page'; } if(document.getElementById('target4').checked == 1) { document.getElementById('linktitle').innerHTML = 'Select a photo'; document.getElementById('linkdesc').innerHTML = 'Select a photo in the list'; document.getElementById('typedivheader').style.display = 'block'; selected = 'photo'; } if(document.getElementById('target5').checked == 1) { document.getElementById('linktitle').innerHTML = 'Select a journal entry'; document.getElementById('linkdesc').innerHTML = 'Select a journal entry in the list'; document.getElementById('typedivheader').style.display = 'block'; selected = 'journal'; } if(document.getElementById('target1').checked != 1) { var showbox = selected + 'seldiv'; document.getElementById(showbox).style.display = 'block'; document.getElementById('addremovelink').innerHTML = 'Add link'; document.getElementById('openlinknewwindow').style.display = 'block'; } else { document.getElementById('addremovelink').innerHTML = 'Remove link'; document.getElementById('openlinknewwindow').style.display = 'none'; } } function addLink() { document.getElementById('popupdiv').innerHTML = '
    Add a link
    '; document.getElementById('popupdiv').innerHTML += '
    Target type
    Select a target type for your link.
    '; document.getElementById('popupdiv').innerHTML += '
    No link URL Page Photo Journal entry
    '; document.getElementById('popupdiv').innerHTML += ''; document.getElementById('selectboxes').innerHTML += journalput; document.getElementById('selectboxes').innerHTML += photoput; document.getElementById('selectboxes').innerHTML += pageput; } } function handleGetImages() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("img"); var n_messages = topnavi_nodes.length; var imgfloat = 'float-' + imagetarget; var put = ''; if(document.getElementById('img_search') == null) { document.getElementById(imgfloat).innerHTML = ''; } for (k = 0; k < n_messages; k++) { var photoid_node = topnavi_nodes[k].getElementsByTagName("photoid"); put += ' '; } document.getElementById(imagetarget).innerHTML = put; } } function addImgToJournal(id) { if(document.getElementById('usehq').checked == '1') { var imagePath = 'http://my.1x.com/media/' + id + '-F.jpg'; } else { var imagePath = 'http://my.1x.com/media/large/' + id + '.jpg'; } document.getElementById('edit').contentWindow.document.execCommand('InsertImage', false, imagePath); closePopup(); } function toggleFontsize() { if(document.getElementById('fontsizebox').style.display != 'block') { document.getElementById('fontsizebox').style.display = 'block'; } else { document.getElementById('fontsizebox').style.display = 'none'; } } function setFontsize(size) { document.execCommand('fontSize', false, size); } function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { document.getElementById('p_status').innerHTML = 'Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.'; } } function newGallery() { document.getElementById('popupdiv').innerHTML = '
    Add a new gallery
    '; document.getElementById('popupdiv').innerHTML += '
    Organize your photos in galleries. Add photos to the gallery by simply dragging them to the gallery icon in the right panel.

    Gallery name:  

    Enter a gallery title and then click "Add gallery".'; document.getElementById('popupdiv').innerHTML += '
    Add gallery Close without saving
    '; showPopup(); document.getElementById('addgallery').style.opacity = '0.5'; } function showError(error) { alert(error); } function openPic(id) { if(edit != '1') { location.href = '/photo/' + id; } } function sz(t) { a = t.value.split('\n'); b=1; for (x=0;x < a.length; x++) { if (a[x].length >= t.cols) b+= Math.floor(a[x].length/t.cols); } b+= a.length; if (b > t.rows) t.rows = b; } function endEdit(from) { var extratext = ''; edit = '0'; document.getElementById('nav_edit').style.display = 'inline'; document.getElementById('nav_save').style.display = 'none'; document.getElementById('nav_revert').style.display = 'none'; if(from == 'gallery') { reload = '1'; var name = document.getElementById('galleryedit_name').value; var order = Sortable.sequence('photolist'); sendReq.open("POST", '/ajax/gallery_edit.php?id=' + document.getElementById('gallery_id').value, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleSaveChanges; var param = 'order=' + encodeURIComponent(order); param += '&name=' + encodeURIComponent(name); sendReq.send(param); } if(from == 'p') { reload = '1'; var position = ''; var param = 'a=b'; var changedfields = ''; var oDiv = document.getElementById('custompage'); if(oDiv.firstChild) { var oChild = oDiv.firstChild; while(oChild) { if(oChild.nodeType==1) { if(oChild.id) { var pos_x = document.getElementById(oChild.id).offsetLeft; var pos_y = document.getElementById(oChild.id).offsetTop; var divwidth = document.getElementById(oChild.id).offsetWidth; var divheight = document.getElementById(oChild.id).offsetHeight; if(document.getElementById('src-' + oChild.id) != null) { var src = document.getElementById('src-' + oChild.id).value; var size = document.getElementById('size-' + oChild.id).value; var link = document.getElementById('link-' + oChild.id).value; } else { var src = ''; var size = ''; var link = ''; } position += oChild.id + ':' + pos_x + ':' + pos_y + ':' + divwidth + ':' + divheight + ':' + src + ':' + size + ','; if(link != '') { param += '&edit_link_' + oChild.id + '=' + encodeURIComponent(link); } if(document.getElementById(oChild.id).innerHTML != '') { param += '&edit_' + oChild.id + '=' + encodeURIComponent(document.getElementById(oChild.id).innerHTML); changedfields += 'edit_' + oChild.id + ':'; } } } oChild = oChild.nextSibling; } } sendReq.open("POST", '/ajax/custompage_edit.php?type=position&id=' + document.getElementById('page_id').value, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleSaveChanges; param += '&position=' + encodeURIComponent(position); param += '&changedfields=' + encodeURIComponent(changedfields); param += '&deletedobjects=' + encodeURIComponent(document.getElementById('deletedobjects').value); sendReq.send(param); } } function handleSaveChanges() { if (sendReq.readyState == 4) { displayMessage('info','Changes saved!','Your changes have been saved.','Close'); } } function startEdit(from) { var extratext = ''; edit = '1'; document.getElementById('nav_edit').style.display = 'none'; document.getElementById('nav_save').style.display = 'inline'; document.getElementById('nav_revert').style.display = 'inline'; if(from == 'p') { document.getElementById('custompage').style.height = '10000px'; document.getElementById('fade').style.height = '10000px'; editCustomPage(); } displayMessage('warn','You are now editing','You are now editing this page. Remember to save your changes from the manage menu when you are done.','Close'); } function updateGalleryname() { var id = document.getElementById('gallery_id').value; var updatediv = 'galleryname-' + id; document.getElementById(updatediv).innerHTML = document.getElementById('galleryedit_name').value; } function checkFields(what) { var doreturn = false; if(what == 'addgallery') { if(document.getElementById('gallery_name').value != '') { document.getElementById('addgallery').style.opacity = '1.0'; } else { document.getElementById('addgallery').style.opacity = '0.5'; } } } function DEPRaddGallery() { if(document.getElementById('gallery_name').value != '') { } else { alert("You must fill in a gallery name!"); } } function displayMessage(type,title,message,buttonlabel) { if(type == 'info') { var image = 'http://my1x.1x.com/img/message_info.png'; } if(type == 'warn') { var image = 'http://my1x.1x.com/img/message_warn.png'; } if(type == 'error') { var image = 'http://my1x.1x.com/img/message_error.png'; } document.getElementById('popupdiv').innerHTML = '
    ' + title + '
    '; document.getElementById('popupdiv').innerHTML += '
    ' + message + '
    ' + buttonlabel + '
    '; showPopup(); } function showPopup2(name) { document.getElementById('fade2').style.display = 'block'; document.getElementById('popupdiv2').style.maxHeight = myHeightLimit + 'px'; var setwidth = (parseInt(myWidth)/2)-400; document.getElementById('popupdiv2').style.display = 'block'; document.getElementById('popupdiv2').style.left = setwidth + 'px'; } function showPopup(name) { document.getElementById('popupdiv').style.maxHeight = myHeightLimit + 'px'; var setwidth = (parseInt(myWidth)/2)-400; fadeon('popup'); document.getElementById('popupdiv').style.display = 'block'; document.getElementById('popupdiv').style.left = setwidth + 'px'; } function uploadPics() { uploadpicsactive = 1; var setwidth = (parseInt(myWidth)/2)-400; document.getElementById('uploadpopup').style.maxHeight = myHeightLimit + 'px'; fadeon('uploadpopup'); document.getElementById('uploadpopup').style.display = 'block'; document.getElementById('uploadpopup').style.left = setwidth + 'px'; imagetarget = 'imagebrowser2'; setTimeout('getImages();',500); } function closeUploadPics() { document.getElementById('uploadpopup').style.display = 'none'; fadeoff('uploadpopup'); uploadpicsactive = '0'; } function closePopup() { document.getElementById('popupdiv').innerHTML = ''; document.getElementById('popupdiv').style.display = 'none'; fadeoff('popup'); if(reload == '1') { window.location.href=window.location.href; } } function closePopup2() { document.getElementById('popupdiv2').style.display = 'none'; document.getElementById('fade2').style.display = 'none'; }