var ffhack = ''; var ffhack2 = '0'; var ffhack3 = ''; var moderator = '0'; var dark = ''; var sendReq = getXmlHttpRequestObject(); var receiveReq = getXmlHttpRequestObject(); var sendReq2 = getXmlHttpRequestObject(); var receiveReq2 = getXmlHttpRequestObject(); var sendReq3 = getXmlHttpRequestObject(); var receiveReq3 = getXmlHttpRequestObject(); var receiveReq9 = getXmlHttpRequestObject(); var blockwrite = '0'; var hashmark = ''; var ie = '0'; var printsshifttimer; var dolike = '0'; var frontcountdown; var docomment = '0'; var globaltimeloop = 0; var printsfullsizebg = '#fff'; var reply = '0'; var activereply = '0'; var activereply2 = '0'; var cartdisplay = '0'; var searchtimeout; var postlastsearch; var topsearchtimeout; var cart_active_item; var cart_active_price; var cart_active_curr; var voting_autoswap = '0'; var searchtoplink = ''; var selsearchhit = '0'; var anchornavenabled = '0'; var lastsearch = ''; var savingsettings = '0'; var badgechange = '0'; var loop = 0; var menuopen = ''; var newnotifications = ''; var newmails = ''; var selectedsize = '0'; var sound_newmsg = 'http://1x.com/img/newmsg.mp3'; var currency = 'eur'; function keypress(e) { var evtobj=window.event? event : e //distinguish between IE's explicit event object (window.event) and Firefox's implicit. var unicode=evtobj.charCode? evtobj.charCode : evtobj.keyCode var actualkey=String.fromCharCode(unicode) if (evtobj.keyCode == 27) { closeOpen(); if(chat_active_with != '0') { openChat(chat_active_with); } } } document.onkeyup=keypress function notificationsToggle() { location.href = '/notifications'; } function forceLogin() { setTimeout('loginToggle();',200); document.getElementById('mustlogin').style.display = 'block'; Effect.ScrollTo('pnavilogin', { duration:'0.2', offset:-15 }); } function loginToggle() { if(document.getElementById('pnavilogintable').style.display != 'block') { document.getElementById('pnavilogintable').style.display = 'block'; document.getElementById('pnavilogin').setAttribute("class", "pnaviloginactive"); document.getElementById('login_username').focus(); } else { document.getElementById('pnavilogintable').style.display = 'none'; document.getElementById('pnavilogin').setAttribute("class", "pnavilogin"); } } function mailToggle() { location.href = '/mail'; } function accountToggle() { stopSearch(); if(document.getElementById('pnavimailtable').style.display == 'block') { document.getElementById('pnavimailtable').style.display = 'none'; document.getElementById('pnavimail').setAttribute("class", "pnaviicon"); } if(document.getElementById('pnavinotificationstable').style.display == 'block') { document.getElementById('pnavinotificationstable').style.display = 'none'; document.getElementById('pnavinotifications').setAttribute("class", "pnaviicon"); } if(document.getElementById('pnaviaccounttable').style.display != 'block') { document.getElementById('pnaviaccounttable').style.display = 'block'; document.getElementById('pnaviaccount').setAttribute("class", "pnaviaccountactive"); } else { document.getElementById('pnaviaccounttable').style.display = 'none'; document.getElementById('pnaviaccount').setAttribute("class", "pnaviaccount"); } } function submenuprint4() { var menudiv = 'submenuprint4'; var buttondiv = 'subbuttonprint4'; if(document.getElementById(menudiv).style.display != 'block') { closeOpen(); document.getElementById(menudiv).style.display = 'block'; } else { document.getElementById(menudiv).style.display = 'none'; } } function submenuprint3() { var menudiv = 'submenuprint3'; var buttondiv = 'subbuttonprint3'; if(document.getElementById(menudiv).style.display != 'block') { closeOpen(); document.getElementById(menudiv).style.display = 'block'; } else { document.getElementById(menudiv).style.display = 'none'; } } function submenuprint2() { var menudiv = 'submenuprint2'; var buttondiv = 'subbuttonprint2'; if(document.getElementById(menudiv).style.display != 'block') { closeOpen(); document.getElementById(menudiv).style.display = 'block'; } else { document.getElementById(menudiv).style.display = 'none'; } } function submenuprint1() { var menudiv = 'submenuprint1'; var buttondiv = 'subbuttonprint1'; if(document.getElementById(menudiv).style.display != 'block') { closeOpen(); document.getElementById(menudiv).style.display = 'block'; } else { document.getElementById(menudiv).style.display = 'none'; } } function submenu() { if(document.getElementById('submenu2') != null) { if(document.getElementById('submenu2').style.display == 'block') { submenu2(); } } if(document.getElementById('submenu').style.display != 'block') { document.getElementById('submenu').style.display = 'block'; document.getElementById('submenubutton').setAttribute("class", "submenubuttonactive"); } else { document.getElementById('submenu').style.display = 'none'; document.getElementById('submenubutton').setAttribute("class", "submenubutton"); } } function submenu2() { if(document.getElementById('submenu') != null) { if(document.getElementById('submenu').style.display == 'block') { submenu(); } } if(document.getElementById('submenu2').style.display != 'block') { document.getElementById('submenu2').style.display = 'block'; document.getElementById('submenubutton2').setAttribute("class", "submenubuttonactive"); } else { document.getElementById('submenu2').style.display = 'none'; document.getElementById('submenubutton2').setAttribute("class", "submenubutton"); } } function pnaviToggle() { if(document.getElementById('pnavi2') != null) { if(document.getElementById('pnavi2').style.display == 'block') { pnavi2Toggle(); } } if(document.getElementById('pnavi').style.display != 'block') { document.getElementById('pnavi').style.display = 'block'; document.getElementById('pnavicurr').setAttribute("class", "pnavicurractive"); } else { document.getElementById('pnavi').style.display = 'none'; document.getElementById('pnavicurr').setAttribute("class", "pnavicurr"); } } function pnavi2Toggle() { if(document.getElementById('pnavi').style.display == 'block') { pnaviToggle(); } if(document.getElementById('pnavi2').style.display != 'block') { document.getElementById('pnavi2').style.display = 'block'; document.getElementById('pnavi2curr').setAttribute("class", "pnavicurractive"); } else { document.getElementById('pnavi2').style.display = 'none'; document.getElementById('pnavi2curr').setAttribute("class", "pnavicurr"); } } function reloadShoppingcart() { if(anchornavenabled == '1') { document.location.hash = '!/shoppingcart'; currentAnchor = 'foo'; checkAnchor(); } else { location.href = '/shoppingcart'; } } function reloadSeries(seriesid,uploadid) { if(anchornavenabled == '1') { document.location.hash = '!/series/edit/' + seriesid + '/' + uploadid; currentAnchor = 'foo'; checkAnchor(); } else { location.href = '/series/edit/' + seriesid + '/' + uploadid; } } function reloadPhotodir(queueid) { if(anchornavenabled == '1') { document.location.hash = '!/photodirectory/uploaded/' + queueid; currentAnchor = 'foo'; checkAnchor(); } else { location.href = '/photodirectory'; } } function previewP(size,x,y,realx,realy) { x = Math.round(x*1.2); y = Math.round(y*1.2); if(selectedsize != '0') { var deselectbutton = 'sizebutton-' + selectedsize; document.getElementById(deselectbutton).setAttribute("class", "sizebutton"); } var selectbutton = 'sizebutton-' + size; document.getElementById(selectbutton).setAttribute("class", "sizebuttonactive"); var top = 95-(y/2); var left = 230-(x/2); document.getElementById('printpreview').style.display = 'none'; document.getElementById('printpreviewwall').style.display = 'block'; document.getElementById('printpreview2').style.display = 'block'; $('printpreview2').morph('width: ' + x + 'px; top: ' + top + 'px;' + 'left:' + left + 'px;'); selectedsize = size; document.getElementById('buybutton').style.display = 'block'; document.getElementById('returnImage').style.display = 'block'; } function setTitle() { var newtitle; var extras = ''; if(document.getElementById('set_title') != null) { newtitle = document.getElementById('set_title').value; } else { if(document.getElementById('cleantitle') != null) { newtitle = document.getElementById('cleantitle').value; } } if(!newtitle) { newtitle = 'In Pursuit of the Sublime'; } var total = parseInt(newnotifications) + parseInt(newmails); if(total > 0) { extras = '(' + total + ') '; } //var online = ' [' + document.getElementById('onlinecount').innerHTML + ']'; document.title = '1x.com ' + extras + '- ' + newtitle; // + online; } 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; } document.onclick = function (e) { e = e || event var target = e.target || e.srcElement while(target) { if (target == document.getElementById('submenuprint4') || target == document.getElementById('submenuprintbutton4') || target == document.getElementById('submenuprint2') || target == document.getElementById('submenuprintbutton2') || target == document.getElementById('submenuprint3') || target == document.getElementById('submenuprintbutton3') || target == document.getElementById('submenuprint1') || target == document.getElementById('submenuprintbutton1') || target == document.getElementById('submenubutton') || target == document.getElementById('submenubutton2') || target == document.getElementById('submenu') || target == document.getElementById('submenu2') || target == document.getElementById('chat_contacts') || target == document.getElementById('chat_contactlist') || target == document.getElementById('search_q') || target == document.getElementById('topsearchresults') || target == document.getElementById('pnavimail') || target == document.getElementById('pnavimailtable') || target == document.getElementById('pnavinotifications') || target == document.getElementById('pnavinotificationstable') || target == document.getElementById('pnaviaccount') || target == document.getElementById('pnaviaccounttable') || target == document.getElementById('pnavi2curr') || target == document.getElementById('pnavi2') || target == document.getElementById('pnavicurr') || target == document.getElementById('pnavi') || target == document.getElementById('artistbutton1') || target == document.getElementById('artistbutton2') || target == document.getElementById('v-menu5') || target == document.getElementById('v-menu6') || target == document.getElementById('v-menu4') || target == document.getElementById('v-menu3') || target == document.getElementById('v-menu') || target == document.getElementById('v-menu2') || target == document.getElementById('notificationbutton') || target == document.getElementById('accountbutton') || target == document.getElementById('notificationbadge') || target == document.getElementById('friendbadge') || target == document.getElementById('mailbadge') || target == document.getElementById('mailbutton') || target == document.getElementById('pnavilogin') || target == document.getElementById('pnavilogintable')) { return } target = target.parentNode } // stopSearch(); closeOpen(); if(document.getElementById('chat_contactlist') != null) { if(document.getElementById('chat_contactlist').style.display == 'block') { chat_contactlisttoggle(); } } } function autoResize(element) { var maxheight = parseInt(myHeight) - 100; document.getElementById(element).style.maxHeight = maxheight + 'px'; } function startPage() { if(document.location.hash == '#!/') { currentAnchor = 'foo'; checkAnchor(); } } function relocatePopup(where) { var left = (myWidth/2)-where; document.getElementById('floatingwindow').style.left = left + 'px'; } function showElement(layer){ var myLayer = document.getElementById(layer); if(myLayer.style.display=="none"){ if(menuopen != '') { if(menuopen == 'v-menu2') { document.getElementById('notificationbutton').setAttribute("class", "notificationimg"); } if(menuopen == 'v-menu4') { document.getElementById('mailbutton').setAttribute("class", "notificationimg"); } var closeLayer = document.getElementById(menuopen); closeLayer.style.display="none"; menuopen = ''; } myLayer.style.display="block"; menuopen = layer; if(layer == 'v-menu2') { document.getElementById('notificationbutton').setAttribute("class", "notificationimgactive"); getNotifications(); } if(layer == 'v-menu4') { document.getElementById('mailbutton').setAttribute("class", "notificationimgactive"); getMail(); } } else { if(menuopen == 'v-menu2') { document.getElementById('notificationbutton').setAttribute("class", "notificationimg"); } if(menuopen == 'v-menu4') { document.getElementById('mailbutton').setAttribute("class", "notificationimg"); } menuopen = ''; myLayer.style.display="none"; } } function closeOpen() { if(menuopen != '') { if(menuopen == 'v-menu2') { document.getElementById('notificationbutton').setAttribute("class", "notificationimg"); } if(menuopen == 'v-menu4') { document.getElementById('mailbutton').setAttribute("class", "notificationimg"); } var closeLayer = document.getElementById(menuopen); closeLayer.style.display="none"; menuopen = ''; } if(document.getElementById('submenuprint1') != null) { if(document.getElementById('submenuprint1').style.display == 'block') { submenuprint1(); } } if(document.getElementById('submenuprint2') != null) { if(document.getElementById('submenuprint2').style.display == 'block') { submenuprint2(); } } if(document.getElementById('submenuprint3') != null) { if(document.getElementById('submenuprint3').style.display == 'block') { submenuprint3(); } } if(document.getElementById('submenuprint4') != null) { if(document.getElementById('submenuprint4').style.display == 'block') { submenuprint4(); } } if(document.getElementById('submenu') != null) { if(document.getElementById('submenu').style.display == 'block') { submenu(); } } if(document.getElementById('submenu2') != null) { if(document.getElementById('submenu2').style.display == 'block') { submenu2(); } } if(document.getElementById('pnavi') != null) { if(document.getElementById('pnavi').style.display == 'block') { pnaviToggle(); } } if(document.getElementById('pnavi2') != null) { if(document.getElementById('pnavi2').style.display == 'block') { pnavi2Toggle(); } } if(document.getElementById('pnaviaccounttable') != null) { if(document.getElementById('pnaviaccounttable').style.display == 'block') { accountToggle(); } } if(document.getElementById('pnavinotificationstable') != null) { if(document.getElementById('pnavinotificationstable').style.display == 'block') { notificationsToggle(); } } if(document.getElementById('pnavimailtable') != null) { if(document.getElementById('pnavimailtable').style.display == 'block') { mailToggle(); } } if(document.getElementById('pnavilogintable') != null) { if(document.getElementById('pnavilogintable').style.display == 'block') { loginToggle(); } } } function nl2br (str, is_xhtml) { var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '' : '
'; return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2'); } 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 like(id) { if(dolike == '0') { dolike = '1'; document.getElementById('likebutton').innerHTML = ''; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/backend/like.php?id=' + id, true); receiveReq.onreadystatechange = handleLike; receiveReq.send(null); } } } function closeTopBanner() { document.getElementById('topbanner').style.display = 'none'; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/backend/closetopbanner.php', true); receiveReq.onreadystatechange = handleCloseTopBanner; receiveReq.send(null); } } function handleCloseTopBanner() { if (receiveReq.readyState == 4) { } } function subNavi(target) { document.getElementById('navi-' + target).style.display = 'block'; } function subNaviOff(target) { document.getElementById('navi-' + target).style.display = 'none'; } function commentFocus() { if(document.getElementById('commenttext').value == 'Write a comment') { document.getElementById('commenttext').value = ''; } } function addToCart(what,picid,country,desc,price) { if(country != '') { //var incart = document.getElementById('cartcount').innerHTML; //var newamount = parseInt(incart) + 1; //document.getElementById('cartcount').innerHTML = newamount; //if(document.getElementById('itemscart').innerHTML == "No items in cart") { // document.getElementById('itemscart').innerHTML = ''; //} cart_active_item = desc; cart_active_price = price; //document.getElementById('itemscart').innerHTML += '
' + price + '
' + desc + '
'; //openCart(); //if(newamount == 1) { document.getElementById('carts').innerHTML = ''; } else { document.getElementById('carts').innerHTML = 's'; } if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/backend/cart.php?itemid=' + what + '&picid=' + picid + '&country=' + country, true); receiveReq.onreadystatechange = handleAddToCart; receiveReq.send(null); } } else { if(parseInt(what) > 4) { Effect.Appear('shippingloc'); Effect.ScrollTo('shippingloc'); } } } function handleAddToCart() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var status_node = xmldoc.getElementsByTagName("status"); var error_node = xmldoc.getElementsByTagName("error"); if(status_node[0].firstChild.nodeValue == 'ok') { if(cart_active_item != '' && cart_active_price != '') { var incart = document.getElementById('cartcount').innerHTML; var newamount = parseInt(incart) + 1; document.getElementById('cartcount').innerHTML = newamount; if(document.getElementById('itemscart').innerHTML == "No items in cart") { document.getElementById('itemscart').innerHTML = ''; } document.getElementById('itemscart').innerHTML += '
' + cart_active_price + '
' + cart_active_item + '
'; openCart(); if(newamount == 1) { document.getElementById('carts').innerHTML = ''; } else { document.getElementById('carts').innerHTML = 's'; } } } else { alert('Could not place your item in cart: ' + error_node[0].firstChild.nodeValue); } cart_active_item = ''; cart_active_price = ''; } } function printBadgeChange() { if(badgechange == '0') { document.getElementById('buyprintbadge').innerHTML = '
+  Add to cart
Add this print to your shopping cart
'; document.getElementById('buyprintbadge').setAttribute("class", "printsizebadge3"); // new Effect.Highlight('buyprintbadge', { startcolor: '#ffff99', endcolor: '#ffff99' }); badgechange = '1'; } } function printBadgeChange2() { if(badgechange == '1') { document.getElementById('buyprintbadge').innerHTML = '
Added to cart!
Click here to exit print mode
'; document.getElementById('buyprintbadge').setAttribute("class", "printsizebadge3"); badgechange = '0'; } } function discardNReply() { if(activereply != '0') { var abort = 'commentreplyeditor-' + activereply; document.getElementById(abort).innerHTML = ''; activereply = '0'; document.getElementById('reply_to').value = '0'; document.getElementById('commentbutton').style.opacity = '0.9'; blockwrite = '0'; } } function discardReply() { if(activereply2 != '0') { var abort = 'commentreplyeditor-' + activereply2; document.getElementById(abort).innerHTML = ''; activereply2 = '0'; document.getElementById('reply_to').value = '0'; document.getElementById('commentbutton').style.opacity = '0.9'; blockwrite = '0'; } } function doNReply(id) { if(activereply != '0' && activereply != id) { var abort = 'commentreplyeditor-' + activereply; if(document.getElementById(abort) != null) { document.getElementById(abort).innerHTML = ''; } else { activereply = '0'; } } document.getElementById('reply_to').value = id; var editor = 'commentreplyeditor-' + id; var textarea = 'commenttext-' + id; document.getElementById(editor).innerHTML = '
Write   or abort
'; document.getElementById(textarea).focus(); activereply = id; } function doReply(id) { if(activereply2 != '0' && activereply2 != id) { var abort = 'commentreplyeditor-' + activereply2; document.getElementById(abort).innerHTML = ''; } document.getElementById('reply_to').value = id; var editor = 'commentreplyeditor-' + id; var textarea = 'commenttext-' + id; document.getElementById(editor).innerHTML = '
Write   or abort
'; document.getElementById(textarea).focus(); activereply2 = id; document.getElementById('commentbutton').style.opacity = '0.2'; blockwrite = '1'; } function handleLike() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("like"); var n_messages = topnavi_nodes.length; for (k = 0; k < n_messages; k++) { var likestate_node = topnavi_nodes[k].getElementsByTagName("likestate"); var likebutton_node = topnavi_nodes[k].getElementsByTagName("likebutton"); var likelist_node = topnavi_nodes[k].getElementsByTagName("likedata"); likelist_node[0].normalize(); document.getElementById('likebutton').innerHTML = likebutton_node[0].firstChild.nodeValue; document.getElementById('likes').innerHTML = likelist_node[0].firstChild.nodeValue; dolike = '0'; //if(likestate_node[0].firstChild.nodeValue == 'Like') { document.getElementById('favscount').innerHTML = parseInt(document.getElementById('favscount').innerHTML) - 1; } //if(likestate_node[0].firstChild.nodeValue == 'Unlike') { document.getElementById('favscount').innerHTML = parseInt(document.getElementById('favscount').innerHTML) + 1; } } } } function handleDoWriteWallComment() { if (sendReq.readyState == 4) { if(activereply != '0') { var msg = document.getElementById('commenttext-' + activereply).value; loop = parseInt(loop) + 1; var newid = 'newcomment-' + activereply + '-' + loop; document.getElementById('newcomments-' + activereply).innerHTML += '
' + document.getElementById('auth_realname').value + '   ' + nl2br(msg,false) + '
'; var abort = 'commentreplyeditor-' + activereply; document.getElementById(abort).innerHTML = ''; if(document.getElementById('morecounter-' + activereply) == null) { //document.getElementById('arrowfirst-' + activereply).style.display = 'block'; } else { if(document.getElementById('morecounter-' + activereply).innerHTML == '0') { // document.getElementById('arrowfirst-' + activereply).style.display = 'block'; } } document.getElementById('morecounter-' + activereply).innerHTML = parseInt(document.getElementById('morecounter-' + activereply).innerHTML) + 1; activereply = '0'; document.getElementById('reply_to').value = '0'; document.getElementById('commentbutton').style.opacity = '0.9'; blockwrite = '0'; //Effect.Appear(newid); } } } function doWriteWallComment() { if(activereply != '0') { var msg = document.getElementById('commenttext-' + activereply).value; var reply_to = document.getElementById('reply_to').value; if(msg != '' && reply_to != '0') { if (sendReq.readyState == 4 || sendReq.readyState == 0) { sendReq.open("POST", '/backend/wallcomment.php?id=' + reply_to, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleDoWriteWallComment; var param = 'text=' + encodeURIComponent(msg); sendReq.send(param); } } } } function doMailReply() { var msg = document.getElementById('message').value; if(msg != '') { var mailid = document.getElementById('mailid').value; if(mailid) { if (sendReq.readyState == 4 || sendReq.readyState == 0) { sendReq.open("POST", '/backend/mailreply.php?id=' + mailid, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleDoMailReply; var param = 'text=' + encodeURIComponent(msg); sendReq.send(param); } } } } function handleDoMailReply() { if (sendReq.readyState == 4) { //var status = 'nok'; //var xmldoc = sendReq.responseXML; //var topnavi_nodes = xmldoc.getElementsByTagName("result"); //var n_messages = topnavi_nodes.length; //for (k = 0; k < n_messages; k++) { // var status_node = topnavi_nodes[k].getElementsByTagName("status"); // if(status_node[0].firstChild.nodeValue == 'ok') // { // status = 'ok'; // } //} // //if(status == 'ok') { finishWriteReply(); //} else { // alert('Your message could not be sent at this time. Try again later.'); //} } } function doWriteWall() { var msg = document.getElementById('walltext').value; var target = document.getElementById('userid').value; if(msg != '' && target != '') { if (sendReq.readyState == 4 || sendReq.readyState == 0) { sendReq.open("POST", '/backend/wall.php?id=' + target, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleDoWriteWall; var param = 'text=' + encodeURIComponent(msg); sendReq.send(param); } } } function handleDoWriteWall() { if (sendReq.readyState == 4) { writeWall(); } } function addComment(id,from) { if(from == 'reply' || from == 'noreply' && blockwrite != '1') { if(docomment == '0') { docomment = '1'; reply = document.getElementById('reply_to').value; if(reply != '0') { var button = 'commentbutton-' + reply; var textarea = 'commenttext-' + reply; } else { var button = 'commentbutton'; var textarea = 'commenttext'; } document.getElementById(button).innerHTML = ''; var comment = document.getElementById(textarea).value; document.getElementById(textarea).disable = true; if(comment && comment != "Write a comment") { if (sendReq.readyState == 4 || sendReq.readyState == 0) { sendReq.open("POST", '/backend/comment.php?id=' + id, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = handleAddComment; var param = 'text=' + encodeURIComponent(comment); param += '&reply=' + reply; sendReq.send(param); } } else { document.getElementById(button).innerHTML = 'Write'; alert('No comment written. Aborting!'); docomment = '0'; } } } } function handleAddComment() { if(sendReq.readyState == 4) { if(reply != '0') { var editor = 'commentreplyeditor-' + reply; document.getElementById(editor).innerHTML = ''; var picid = document.getElementById('picid').value; document.getElementById('reply_to').value = 0; docomment = '0'; document.getElementById('commentbutton').style.opacity = '0.9'; blockwrite = '0'; activereply2 = '0'; getComments(picid); } else { var button = 'commentbutton'; var textarea = 'commenttext'; document.getElementById(button).innerHTML = 'Write'; document.getElementById(textarea).value = 'Write a comment'; var picid = document.getElementById('picid').value; docomment = '0'; //var oldcommentamount = parseInt(document.getElementById('noofcomments').innerHTML); //var newcommentamount = parseInt(oldcommentamount) + 1; //document.getElementById('noofcomments').innerHTML = newcommentamount; //if(newcommentamount == 1) { document.getElementById('grammars').innerHTML = ''; } else { document.getElementById('grammars').innerHTML = 'S'; } activereply2 = '0'; getComments(picid); } } } function getMail() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/backend/mail.php', true); receiveReq.onreadystatechange = handleGetMail; receiveReq.send(null); } } function handleGetMail() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("mail"); var n_messages = topnavi_nodes.length; var elementcount = 0; var put = ''; //
  • Compose mail
    Mail
  • '; for (k = 0; k < n_messages; k++) { var preview_node = topnavi_nodes[k].getElementsByTagName("preview"); var title_node = topnavi_nodes[k].getElementsByTagName("title"); var from_node = topnavi_nodes[k].getElementsByTagName("from"); var realname_node = topnavi_nodes[k].getElementsByTagName("realname"); var between_node = topnavi_nodes[k].getElementsByTagName("between"); var mailid_node = topnavi_nodes[k].getElementsByTagName("mailid"); var seen_node = topnavi_nodes[k].getElementsByTagName("seen"); var picid_node = topnavi_nodes[k].getElementsByTagName("picid"); var profilepic_node = topnavi_nodes[k].getElementsByTagName("profilepic"); var random_node = topnavi_nodes[k].getElementsByTagName("random"); put += ''; } else { if(picid_node[0].firstChild.nodeValue != 'false') { put += ''; } else { put += '
     
    '; } } put += '
    ' + realname_node[0].firstChild.nodeValue + '
    ' + title_node[0].firstChild.nodeValue + '  ' + preview_node[0].firstChild.nodeValue + '
    '; } put += '
    SHOW ALL
    '; document.getElementById('pnavimailtable').innerHTML = put; newmails = 0; document.getElementById('mailbadge').style.display = 'none'; document.getElementById('mailbadge').innerHTML = '0'; setTitle(); } } function getNotifications() { document.getElementById('pnavinotificationstable').innerHTML = ''; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/backend/notifications.php', true); receiveReq.onreadystatechange = handleGetNotifications; receiveReq.send(null); } } function handleGetNotifications() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var put = ''; var topnavi_nodes = xmldoc.getElementsByTagName("friendrequest"); var n_messages = topnavi_nodes.length; var elementcount = 0; var put = ''; for (k = 0; k < n_messages; k++) { var from_node = topnavi_nodes[k].getElementsByTagName("from"); var total_node = topnavi_nodes[k].getElementsByTagName("total"); if(total_node[0].firstChild.nodeValue == '1') { var sword = ''; } else { var sword = 's'; } if(from_node[0].firstChild.nodeValue != 'false') { put += '
    ' + total_node[0].firstChild.nodeValue + ' new friend request' + sword + '
    From ' + from_node[0].firstChild.nodeValue + '. Click here.
    '; } } var topnavi_nodes = xmldoc.getElementsByTagName("notification"); var n_messages = topnavi_nodes.length; var elementcount = 0; for (k = 0; k < n_messages; k++) { var text_node = topnavi_nodes[k].getElementsByTagName("text"); var picid_node = topnavi_nodes[k].getElementsByTagName("picid"); var link_node = topnavi_nodes[k].getElementsByTagName("link"); var from_node = topnavi_nodes[k].getElementsByTagName("from"); var fromname_node = topnavi_nodes[k].getElementsByTagName("fromname"); var profilepic_node = topnavi_nodes[k].getElementsByTagName("profilepic"); var seen_node = topnavi_nodes[k].getElementsByTagName("seen"); var type_node = topnavi_nodes[k].getElementsByTagName("type"); var photo_node = topnavi_nodes[k].getElementsByTagName("photo"); var nottime_node = topnavi_nodes[k].getElementsByTagName("nottime"); var random_node = topnavi_nodes[k].getElementsByTagName("random"); if(type_node[0].firstChild.nodeValue == '1') { var picmode = '2'; } if(!picmode) { var picmode = '2'; } put += ''; } if(profilepic_node[0].firstChild.nodeValue != 'false' && picmode == '2') { put += ' '; } if(profilepic_node[0].firstChild.nodeValue == 'false' && picmode == '2' && photo_node[0].firstChild.nodeValue == 'false') { put += '
     
    '; } if(profilepic_node[0].firstChild.nodeValue == 'false' && picmode == '2' && photo_node[0].firstChild.nodeValue != 'false') { put += ''; } put += '
    '; if(type_node[0].firstChild.nodeValue == '1') { put += '' + fromname_node[0].firstChild.nodeValue + ' ' + text_node[0].firstChild.nodeValue; } if(type_node[0].firstChild.nodeValue == '2') { put += '' + fromname_node[0].firstChild.nodeValue + ' commented on your activity'; } if(type_node[0].firstChild.nodeValue == '3') { put += '' + fromname_node[0].firstChild.nodeValue + ' ' + text_node[0].firstChild.nodeValue; } if(type_node[0].firstChild.nodeValue == '4') { put += '' + fromname_node[0].firstChild.nodeValue + ' replied to your comment'; } if(type_node[0].firstChild.nodeValue == '5') { put += '' + fromname_node[0].firstChild.nodeValue + ' posted something on your wall'; } if(type_node[0].firstChild.nodeValue == '6') { put += '' + fromname_node[0].firstChild.nodeValue + ' ' + text_node[0].firstChild.nodeValue; } if(type_node[0].firstChild.nodeValue == '7') { put += '' + fromname_node[0].firstChild.nodeValue + ' ' + text_node[0].firstChild.nodeValue; } if(type_node[0].firstChild.nodeValue == '8') { put += '' + fromname_node[0].firstChild.nodeValue + ' ' + text_node[0].firstChild.nodeValue; } if(type_node[0].firstChild.nodeValue == '9') { put += '' + fromname_node[0].firstChild.nodeValue + ' ' + text_node[0].firstChild.nodeValue; } if(parseInt(type_node[0].firstChild.nodeValue) > 9) { put += '' + fromname_node[0].firstChild.nodeValue + ' ' + text_node[0].firstChild.nodeValue; } put += '  ' + nottime_node[0].firstChild.nodeValue + '
    '; put += ''; } put += '
    SHOW ALL
    '; document.getElementById('pnavinotificationstable').innerHTML = put; document.getElementById('notificationbadge').style.display = 'none'; document.getElementById('notificationbadge').innerHTML = '0'; newnotifications = '0'; setTitle(); } } function getComments(id) { //if(docomment == '0') //{ //docomment = '1'; //document.getElementById('commentbutton').innerHTML = ''; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { var gofrom = document.getElementById('latestcomment').value; if(gofrom == '0') { gofrom = '1'; } receiveReq.open("GET", '/backend/comments.php?id=' + id + '&from=' + gofrom, true); receiveReq.onreadystatechange = handleGetComments; receiveReq.send(null); } //} } function handleGetComments() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("comment"); var n_messages = topnavi_nodes.length; var appeararray = new Array(); var elementcount = 0; for (k = 0; k < n_messages; k++) { var commentid_node = topnavi_nodes[k].getElementsByTagName("commentid"); var fromname_node = topnavi_nodes[k].getElementsByTagName("fromname"); var fromuserid_node = topnavi_nodes[k].getElementsByTagName("fromuserid"); var comment_node = topnavi_nodes[k].getElementsByTagName("commenttext"); var date_node = topnavi_nodes[k].getElementsByTagName("date"); var reply_node = topnavi_nodes[k].getElementsByTagName("reply"); var photourl_node = topnavi_nodes[k].getElementsByTagName("photourl"); if(comment_node[0].firstChild.nodeValue) { comment_node[0].normalize(); if(reply_node[0].firstChild.nodeValue != '0') { var replytarget = 'commentr-' + reply_node[0].firstChild.nodeValue; document.getElementById(replytarget).innerHTML = '
    ' + document.getElementById(replytarget).innerHTML; appeararray[elementcount] = 'comment-' + commentid_node[0].firstChild.nodeValue; elementcount++; } else { document.getElementById('commentcontainer').innerHTML = '
    ' + document.getElementById('commentcontainer').innerHTML; appeararray[elementcount] = 'comment-' + commentid_node[0].firstChild.nodeValue; elementcount++; } if(parseInt(document.getElementById('latestcomment').value) < parseInt(date_node[0].firstChild.nodeValue)) { document.getElementById('latestcomment').value = date_node[0].firstChild.nodeValue; } } } if(reply != '0') { var button = 'commentbutton-' + reply; } else { var button = 'commentbutton'; } //document.getElementById(button).innerHTML = 'Write'; //docomment = '0'; Effect.multiple(appeararray,Effect.Appear); Effect.multiple(appeararray,Effect.Highlight); } } // FOR ARTIST // function deleteNews(id) { var newscontainer = 'newscontainer-f-' + id; Effect.Fade(newscontainer, { duration: 0.5 }); if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/backend/deletenews.php?id=' + id, true); receiveReq.onreadystatechange = handleDeleteNews; receiveReq.send(null); } } function handleDeleteNews() { if (receiveReq.readyState == 4) { } } function clearStatus() { //Effect.Fade('statustext', { duration: 0.3 }); document.getElementById('statustext').innerHTML = ''; //document.getElementById('statustext').style.display = 'block'; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/backend/deletestatus.php', true); receiveReq.onreadystatechange = handleDeleteNews; receiveReq.send(null); } } function writeWall(id) { var msg = document.getElementById('walltext').value; var p_realname = document.getElementById('p_realname').value; var p_userid = document.getElementById('p_userid').value; var auth_username = document.getElementById('auth_realname').value; var auth_userid = document.getElementById('auth_userid').value; globaltimeloop = globaltimeloop + 1; var time = globaltimeloop; document.getElementById('walltext').focus(); if(document.getElementById('wallempty') != null) { document.getElementById('wallempty').style.display = 'none'; } if(document.getElementById('emptywall') != null) { document.getElementById('newsdiv').innerHTML = ''; } document.getElementById('newsdiv').innerHTML = '' + document.getElementById('newsdiv').innerHTML; Effect.Appear('wallpost-' + time, { duration: 0.7 }); if(auth_userid && auth_userid == p_userid) { document.getElementById('walltext').value = 'What\'s on your mind?'; } else { document.getElementById('walltext').value = 'Write on ' + p_realname + '\'s wall'; } } function forceLoad(what) { what = '#!' + what; if(what == currentAnchor) { currentAnchor = 'foo'; checkAnchor(); } } function endSelProfilePic() { location.href = location.href; } function changePic() { document.getElementById('lightsoff').style.display = 'block'; document.getElementById('fwindowcontent').innerHTML = '
    Change profile picture
    Rules for profile pictures:
    Edit thumbnail
    '; document.getElementById('fwindowcontent').innerHTML += '
    '; Effect.Appear('floatingwindow', { duration: 0.4 }); } // FOR PRINTS var setspan = 'featured'; var setartist = 'all'; var setcolor = 'all'; var setsize = 'all'; var settag = 'all'; var color_selected = ''; var tag_selected = ''; var size_selected = ''; var nodisablecolor = '0'; var nodisabletags = '0'; var nodisableartists = '0'; var page = 1; var nextpageenabled = 1; var prevpageenabled = 1; function setArtist() { if(document.getElementById('which_artist').value != '') { setartist = document.getElementById('which_artist').value; } nodisableartists = '1'; updatePrints(); } function setSpan() { if(document.getElementById('which_featured').checked == 1) { setspan = 'featured'; } if(document.getElementById('which_new').checked == 1) { setspan = 'new'; } page = '1'; updatePrints(); } function setTag(tag,id) { var prevtag = settag; if(settag != 'all') { document.getElementById(tag_selected).setAttribute("class", "button4"); tag_selected = ''; settag = 'all'; } if(tag != prevtag) { document.getElementById(id).setAttribute("class", "button4marked"); tag_selected = id; settag = tag; } nodisableartists = '1'; nodisabletags = '1'; updatePrints(); } function setSize(size) { var prevsize = setsize; var sizebutton = 'sizebutton' + size; if(setsize != 'all') { document.getElementById(size_selected).setAttribute("class", "button4"); setsize = 'all'; size_selected = ''; } if(size != prevsize) { document.getElementById(sizebutton).setAttribute("class", "button4marked"); size_selected = sizebutton; setsize = size; } nodisableartists = '1'; nodisablecolor = '1'; updatePrints(); } function setColor(color,id,button) { var disabled = 'colorbutton' + color + 'disabled'; if(document.getElementById(id).getAttribute("class") != disabled) { var prevcolor = setcolor; if(setcolor != 'all') { var deselectclass = 'colorbutton' + setcolor; document.getElementById(color_selected).setAttribute("class", deselectclass); setcolor = 'all'; color_selected = ''; } if(color != prevcolor) { document.getElementById(id).setAttribute("class", button); color_selected = id; setcolor = color; } nodisableartists = '1'; nodisablecolor = '1'; updatePrints(); } } function nextPage() { if(nextpageenabled == '1') { page = parseInt(page) + 1; updatePrints(); } } function prevPage() { if(prevpageenabled == '1') { if(parseInt(page) > 1) { page = parseInt(page) - 1; updatePrints(); } } } function updatePrints() { if(nodisablecolor == '0') { } else { nodisablecolor = '0'; } var sendstring = '/backend/prints.php?span=' + setspan + '&artist=' + setartist + '&color=' + setcolor + '&size=' + setsize + '&tags=' + settag; if(nodisabletags == '0') { document.getElementById('tagtarget').innerHTML = ''; } if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", sendstring, true); receiveReq.onreadystatechange = handleUpdatePrints; receiveReq.send(null); } } function handleUpdatePrints() { if (receiveReq.readyState == 4) { // TAGS var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("ptag"); var n_messages = topnavi_nodes.length; var put = ''; var taghit = 0; for (k = 0; k < n_messages; k++) { var tagname_node = topnavi_nodes[k].getElementsByTagName("tagname"); taghit++; var tagbutton = 'tagbutton-' + tagname_node[0].firstChild.nodeValue; if(tag_selected == tagbutton) { var tagselected = 'marked'; } else { var tagselected = ''; } put += '' + tagname_node[0].firstChild.nodeValue + '   '; } if(nodisabletags == '0') { document.getElementById('tagtarget').innerHTML = put; } else { nodisabletags = '0'; } // PHOTOGRAPHERS var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("pphotographer"); var n_messages = topnavi_nodes.length; put = ''; if(nodisableartists == '0') { document.getElementById('artistspan').innerHTML = put; } else { nodisableartists = '0'; } // COLOR var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("pcolor"); var n_messages = topnavi_nodes.length; var put = ''; var taghit = 0; var foundmarked = '0'; for (k = 0; k < n_messages; k++) { var color_node = topnavi_nodes[k].getElementsByTagName("color"); var activatebutton = 'color-'+ color_node[0].firstChild.nodeValue; if(document.getElementById(activatebutton) != null) { var activateclass = 'colorbutton' + color_node[0].firstChild.nodeValue; if(color_selected == activatebutton) { foundmarked = '1'; activateclass += 'marked'; } document.getElementById(activatebutton).setAttribute("class", activateclass); } } if(foundmarked == '0' && color_selected != '') { color_selected = ''; setcolor = 'all'; } // SIZE var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("psize"); var n_messages = topnavi_nodes.length; var put = ''; var taghit = 0; var highest = 0; for (k = 0; k < n_messages; k++) { var size_node = topnavi_nodes[k].getElementsByTagName("size"); if(parseInt(size_node[0].firstChild.nodeValue) > parseInt(highest)) { highest = size_node[0].firstChild.nodeValue; } } if(parseInt(highest) > 0) { var loop = 1; while(parseInt(loop) <= parseInt(highest)) { var activatebutton = 'sizebutton'+ loop; var activateclass = 'button4'; if(size_selected == activatebutton) { activateclass += 'marked'; } document.getElementById(activatebutton).setAttribute("class", activateclass); loop++; } } // THUMBS var topnavi_nodes = xmldoc.getElementsByTagName("thumb"); var n_messages = topnavi_nodes.length; var put = ''; var hit = 0; var hitdisplay = 0; var totalhit = 0; var ignored = 0; var low = (30*page)-30; var high = low + 30; if(parseInt(low) < 1) { document.getElementById('prevpagebutton').setAttribute("class", "buttonv5disabled"); prevpageenabled = '0'; } else { document.getElementById('prevpagebutton').setAttribute("class", "buttonv5"); prevpageenabled = '1'; } document.getElementById('page_from').innerHTML = low; document.getElementById('page_to').innerHTML = high; for (k = 0; k < n_messages; k++) { totalhit++; if(totalhit > low && totalhit <= high) { hit++; hitdisplay++; if(hit == 1) { put += ''; } var picid_node = topnavi_nodes[k].getElementsByTagName("picid"); put += ''; if(hit == 3) { put += ''; hit = 0; } } else { ignored++; } } if(parseInt(hitdisplay) > 29) { document.getElementById('nextpagebutton').setAttribute("class", "buttonv5"); nextpageenabled = '1'; } else { document.getElementById('nextpagebutton').setAttribute("class", "buttonv5disabled"); nextpageenabled = '0'; } put += '
    '; if(totalhit) { document.getElementById('printbrowser').innerHTML = put; } else { //document.getElementById('printbrowser').innerHTML = '
    No images found with the selected filters. Click here to reset them.
    '; setcolor = 'all'; color_selected = ''; settag = 'all'; tag_selected = ''; setsize = 'all'; size_selected = ''; nodisableartists = '1'; updatePrints(); } } } var selected2 = '0'; var swappic; function startAutoswap() { if(document.getElementById('push_iframe') != null) { selected2 = '0'; if(swappic) { clearInterval(swappic); } swappic = setInterval('autoSwap();', 4000); } } function autoSwap() { if(document.getElementById('prints_pc') != null) { var next = parseInt(selected2) + 1; if(next == document.getElementById('prints_pc').value) { var next = '0'; } swapTo2(next); } } function swapTo2(id) { if(id != selected2) { var source2 = 'swapbox-' + selected2; var target = 'swapbox-' + id; var hideimage = 'image-' + selected2; var showimage = 'image-' + id; document.getElementById('frame').onclick = function () { showImage(printspic[id]); }; document.getElementById(source2).setAttribute("class", "swapbox"); document.getElementById(target).setAttribute("class", "swapboxactive"); document.getElementById(hideimage).style.display = 'none'; Effect.Appear(showimage, { duration: 0.5 }); selected2 = id; } } function swapTo(id) { if(swappic) { clearInterval(swappic); } if(id != selected2) { var source2 = 'swapbox-' + selected2; var target = 'swapbox-' + id; var hideimage = 'image-' + selected2; var showimage = 'image-' + id; document.getElementById('frame').onclick = function () { showImage(printspic[id]); }; document.getElementById(source2).setAttribute("class", "swapbox"); document.getElementById(target).setAttribute("class", "swapboxactive"); document.getElementById(hideimage).style.display = 'none'; Effect.Appear(showimage, { duration: 0.5 }); selected2 = id; } } var cat_selected = ''; var tag_selected = ''; var photographer_selected = ''; var selected = ''; var header = ''; var morelink = ''; function catSwap(catid,catshort,catname) { if(selected != '') { document.getElementById(selected).setAttribute("class", "button4"); } var target = 'catbutton-' + catid; document.getElementById(target).setAttribute("class", "button4marked"); document.getElementById('mini-target').innerHTML = '

    '; selected = 'catbutton-' + catid; header = catname + ' prints'; morelink = '/photos/' + catshort + '/prints'; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", '/backend/prints_cat.php?cat=' + catid, true); receiveReq.onreadystatechange = handleCatSwap; receiveReq.send(null); } } function handleCatSwap() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseXML; var topnavi_nodes = xmldoc.getElementsByTagName("thumb"); var n_messages = topnavi_nodes.length; var put = '