//common-min
function getElement(b){return document.getElementById?document.getElementById(b):(document.all?document.all[b]:null)}function CreateControlFlash(i,o,n,j,k,p){var l="";var m=getElement(i);l+="<object";if(p){l+=" id="+p}l+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';l+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';l+=" width="+n;l+=" height="+j+">";l+='<param name="flashVars" value="'+k+'" />';l+='<param name="movie" value='+o+" />";l+='<param name="quality" value="high" />';l+='<param name="AllowScriptAccess" value="always" />';l+='<param name="wmode" value="transparent" />';if(i=="flvPlayer"){l+='<param name="allowFullScreen" value="true" />'}l+="<embed";l+=' type="application/x-shockwave-flash"';l+=' showstatusbar="1"';l+=" width="+n;l+=" height="+j;l+=' wmode="transparent"';l+=" src="+o;if(i=="flvPlayer"){l+=' allowFullScreen="true"'}if(k){l+=' flashVars="'+k+'"'}l+=' quality="high"';l+=' AllowScriptAccess="always"';l+=' pluginspage="http://www.macromedia.com/go/getflashplayer">';l+="</embed>";l+="</object>";if(i=="upload_block"){l+="<br><br><a onClick=\"displayUploadBlock('gallery')\">Click here to upload an image gallery ( 3-15 related images )</a> | <a onClick=\"displayUploadBlock('sg_file_html')\">Click here if you have problems uploading</a>";l+="<br><br><b>Max file size: 25 MB ( 40 MB for trusted uploaders = members with more than 20 uploads )</b>";l+="<br><br>"}else{if(i=="upload_avatar_block"){l+="<a onClick=\"displayUploadBlock('sg_file_html')\">Click here if you have problems uploading</a>"}else{if(i=="upload_private_avatar_block"){l+="<br><a onClick=\"displayPrivateUploadBlock('sg_file_html')\">Click here if you have problems uploading</a>"}}}m.innerHTML=l}var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();var isRichText=false;var Stage={getWidth:function(){var c=0,d=0;if(typeof(window.innerWidth)=="number"){c=window.innerWidth;d=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){c=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){c=document.body.clientWidth;d=document.body.clientHeight}}}return[c,d]},getScrollXY:function(){var c=0,d=0;if(typeof(window.pageYOffset)=="number"){d=window.pageYOffset;c=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){d=document.body.scrollTop;c=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){d=document.documentElement.scrollTop;c=document.documentElement.scrollLeft}}}return[c,d]}};var alertHtmlWrap='<img src="http://h6img.com//assets/build1/i/okay1-1.jpg" width="396" height="233"><h3 id="_alertmessage"></h3><div id="_alertsubmessage"></div><button id="_alertcancel" class="hid">cancel</button><button id="_alertok">OK</button>';var Alert={html:alertHtmlWrap,preload:function(){if(!$("#_alert").length){this.alert=document.createElement("div");this.alert.className="okay1";this.alert.id="_alert";this.alert.style.position="absolute";this.alert.style.zIndex=999;this.alert.innerHTML=this.html;this.alert.style.display="none"}},show:function(c,j,b,i,g){if(!$("#_alert").length){this.alert=document.createElement("div");this.alert.className="okay1";this.alert.id="_alert";this.alert.style.position="absolute";this.alert.style.zIndex=999;this.alert.innerHTML=this.html;document.body.appendChild(this.alert)}var a=Stage.getWidth();var h=Stage.getScrollXY();var d=1/2*(a[0]-396)+h[0];var f=1/2*(a[1]-233)+h[1];this.move(d,f);if(g==true){$("#_alertok").hide()}if(i){$("#_alertcancel").show()}else{$("#_alertcancel").hide()}var e=this;$("#_alertcancel").mousedown(function(){e.doCancel()});if(g!=true){$("#_alertok").show();$("#_alertok").mousedown(function(){e.doOk()})}this.message=j;this.submessage=b;this.listener=c;$("#_alertmessage").html(this.message);$("#_alertsubmessage").html(this.submessage);if(g==true){$("#_alertok").mousedown(function(){e.doOk()})}this.alert.style.display=""},doCancel:function(){if(this.listener&&this.listener.onAlertCancel){this.listener.onAlertCancel(this.alert)}this.hide();$("#_alertcancel").unbind("mousedown");$("#_alertok").unbind("mousedown");$("#_alertmessage").html("");$("#_alertsubmessage").html("")},doOk:function(){if(this.listener&&this.listener.onAlertOk){this.listener.onAlertOk(this.alert)}this.hide();$("#_alertcancel").unbind("mousedown");$("#_alertok").unbind("mousedown");$("#_alertmessage").html("");$("#_alertsubmessage").html("")},hide:function(){this.alert.style.display="none"},move:function(a,b){if(this.alert){this.alert.style.left=a+"px";this.alert.style.top=b+"px"}}};var LoginAlert={finishOriginatingRequests:new String(),requestParameters:new Array(),show:function(h){if(h&&h.originatingRequest){this.finishOriginatingRequests=h.originatingRequest;this.requestParameters=h.requestParameters}var g=new Object();var e=this;g.onAlertOk=function(a){$.ajax({method:"get",url:"/ajax/login.php?username="+escape($("#pop_username").val())+"&password="+escape($("#pop_password").val()),success:function(k){var n=k.split("&");var j=n[0].split("=")[1];if(j=="true"){if(LoginAlert.finishOriginatingRequests){LoginAlert.finishOriginatingRequests.apply(LoginAlert.finishOriginatingRequests,LoginAlert.requestParameters)}else{Alert.show(undefined,"Yay!","Logged in!",false)}var l=n[1].split("=")[1];var i=n[2].split("=")[1];updateUserStatus(l,i)}else{var m=n[1].split("=")[1];Alert.show(undefined,"Login Error!",m,false,false)}if(LoginAlert.finishOriginatingRequests){LoginAlert.finishOriginatingRequests=null}},async:false})};var f='User: <input id="pop_username" name="pop_username" type="text" maxlength="22"> Pass: <input id="pop_password" name="pop_password" type="password" maxlength="15"> <button id="_alertok" style="position: static">OK</button> <a href="/signup.php">JOIN HEAVEN666, It\'s Easy and Free!</a>';Alert.show(g,"You are not logged in.",f,true,true)}};function _getCookie(e){var d=e;var f="";if(document.cookie.length>0){offset=document.cookie.indexOf(d);if(offset!=-1){offset+=d.length+1;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}f=unescape(document.cookie.substring(offset,end))}}return f}function appendToBody(d,c){d.innerHTML=d.innerHTML+c}function updateUserStatus(b,a){html='<a href="/user/'+b+'">Me</a>';if(a>0){html+=' <img src="//h6img.com/assets/pixel.gif" class=emailOn>'}html+="<ul>";html+='<li><a href="/my_account.php">My account</a></li>';html+='<li><a href="/user/'+b+'">Profile</a></li>';html+='<li><a href="/my_messages.php">Messages';if(a>0){html+=" ("+a+")"}else{html+=" (0)"}html+="</a></li>";html+='<li><a href="/my_uploads.php">Uploads</a></li>';html+='<li><a href="/signup.php?action=logout">Logout</a></li>';html+="</ul>";$(".menu li:first").html(html)}function addToFav(){var b=_getCookie("h6userid");if(b==""){LoginAlert.show({originatingRequest:addToFav,requestParameters:[]})}else{$.ajax({method:"get",url:"/ajax/add_to_fav.php?media_id="+$("#media_id").val(),success:function(f){var g=f.split("&");var e=g[0].split("=")[1];var h=g[1].split("=")[1];if(e=="true"){$("#ratingResponse").show();$("#ratingResponse").html(h);$("#ratingResponse").delay(7500).slideUp("slow")}else{Alert.show(undefined,"Error!",h,false,false)}},async:false})}}function addFriend(d,e){var f=_getCookie("h6userid");if(f==""){LoginAlert.show({originatingRequest:addFriend,requestParameters:[d,e]})}else{$.ajax({method:"get",url:"/ajax/add_friend.php?user_id="+f+"&friend_id="+d+"&friend_username="+e,success:function(g){var h=g.split("&");var b=h[0].split("=")[1];var i=h[1].split("=")[1];if(b=="true"){Alert.show(undefined,"Success",i,false)}else{Alert.show(undefined,"Error!",i,false,false)}},async:false})}}function blockUser(f,c){var e=_getCookie("h6userid");if(e==""){LoginAlert.show({originatingRequest:blockUser,requestParameters:[f,c]})}else{$.ajax({method:"get",url:"/ajax/block_user.php?block="+f+"&user_id="+e+"&blocked_id="+c,success:function(i){var k=i.split("&");var h=k[0].split("=")[1];var g=k[1].split("=")[1];var l=k[2].split("=")[1];if(h=="true"){var m=k[3].split("=")[1];if(l==1){html=" | <a href=\"javascript:void(0)\" onClick=\"blockUser('0', '"+g+"')\">Unblock</a>"}else{html=" | <a href=\"javascript:void(0)\" onClick=\"blockUser('1', '"+g+"')\">Block User</a>"}$("#block_user").html(html);Alert.show(undefined,"Success",m,false)}else{var j=k[3].split("=")[1];Alert.show(undefined,"Error!",j,false,false)}},async:false})}}function launchProfilePhotos(b,c,a){$.fn.colorbox({iframe:true,top:"15px",width:"820px",height:"420px",preloading:false,href:"/pop/profile_photo_album.php?userid="+b+"&username="+c+"&photo_id="+a,opacity:0.5,scrolling:false,onComplete:function(){setTimeout(setFocusCbox,1000)}})}function launchPrivatePhotos(b,c,a){$.fn.colorbox({iframe:true,top:"15px",width:"820px",height:"420px",preloading:false,href:"/pop/private_photo_album.php?userid="+b+"&username="+c+"&photo_id="+a,opacity:0.5,scrolling:false,onComplete:function(){setTimeout(setFocusCbox,1000)}})}function launchEmailFriendPanel(a,b){$.fn.colorbox({iframe:true,width:"480px",height:"330px",preloading:false,href:"/pop/email_to_friend.php?section="+a+"&url="+b,opacity:0.5,close:false,scrolling:false})}function launchFlagContentPanel(a){var b=_getCookie("h6userid");if(b==""){LoginAlert.show({originatingRequest:launchFlagContentPanel,requestParameters:[a]})}else{$.fn.colorbox({iframe:true,width:"430px",height:"210px",preloading:false,href:"/pop/flag_content.php?media_id="+a,opacity:0.5,close:false,scrolling:false})}}function launchEditUpload(a){var b=_getCookie("h6userid");if(b==""){LoginAlert.show({originatingRequest:launchEditUpload,requestParameters:[a]})}else{$.fn.colorbox({iframe:true,width:"530px",height:"495px",preloading:false,href:"/pop/my_uploads_edit.php?upload_id="+a,opacity:0.5,close:false,scrolling:false})}}function commentsRatingAbuse(c,d){$.ajax({method:"get",url:"/ajax/comments_rating_abuse.php?user_id="+c+"&comment_id="+d,success:function(b){var e=b.split("&");var a=e[0].split("=")[1];if(a=="false"){Alert.show(undefined,"Error",e[1].split("=")[1],false)}else{Alert.show(undefined,"Success",e[1].split("=")[1],false)}},async:false})}function include(h,e){var f=document.getElementsByTagName("head")[0];if(h=="css"){var g=document.createElement("link");g.id="RichTextEditorStyles";g.type="text/css";g.rel="stylesheet";g.href=e}f.appendChild(g)}function addProfileComment(c){var b=_getCookie("h6userid");if(b==""){LoginAlert.show({originatingRequest:addQuickProfileComment,requestParameters:[c]})}else{if($("#comment").val().length>=2){$.ajax({method:"get",url:"/ajax/add_profile_comment.php?to_userid="+$("#searched_userid").val()+"&to_username="+$("#searched_username").val()+"&pid="+0+"&gid="+0+"&type="+c+"&comment="+escape($("#comment").val()),success:function(d){var g=d.split("&");var a=g[0].split("=")[1];if(a=="false"){Alert.show(undefined,"Error",g[1].split("=")[1],false)}else{var h=g[1].split("=")[1];var e=g[2].split("=")[1];var f="<li>";f+='<div id="comment'+e+'" gid="'+e+'" userid="'+b+'" class="comment">';f+='<div class=avatar><a href="/user/'+h+'"><img src="'+$("#user_avatar").val()+'"></a></div>';f+='<div class=rightside><div class=title><a href="/user/'+h+'">'+h+"</a> | 1 second ago</div>"+$("#comment").val()+' <a onClick="displayReplyProfileComment(this)">reply</a></div>';f+='<div class="clear over"></div>';f+="</div>";f+="</li>";$("#comment").val("");$("#comment").css("height","30px");$("#add_comment_std").show();$("#add_comment").hide();$(".topLevel").prepend($(f).hide().fadeIn("slow"));scaleImages("comment"+e,540)}},async:false})}else{Alert.show(undefined,"Error","Your comment must have at least 2 characters",false)}}}function displayReplyProfileComment(g){var h=_getCookie("h6userid");if(h==""){LoginAlert.show({originatingRequest:displayReplyProfileComment,requestParameters:[g]})}else{var i=g.parentNode.parentNode.id.substring(7);if(!$(".addReply").length){var f="<div class=addReply>";f+='<div class=avatar><img src="'+$("#user_avatar").val()+'"></div>';f+="<div id=add_reply_std>";f+='<form name="replyform" action="" method="POST">';f+="<textarea id=reply name=reply rows=1></textarea><br>";f+='<input type="button" value="ADD COMMENT" onClick="replyProfileComment(\'std\')" class=button_black>';f+=' <input type="button" value="Go advanced" onClick="goProfileAdvanced(true)" class=button_black>';f+=' <a href="javascript:void(0)" onClick="discardReplay()">Cancel</a>';f+="</form>";f+="</div>";f+="<div id=add_reply></div>";f+="</div>";$("#comment"+i).append(f);$("#reply").bind({keyup:function(){limitlength(this,1024)},click:function(){$("#reply").animate({height:"70px"},400)},blur:function(){if($("#reply").val()==""){$("#reply").animate({height:"30px"},400)}}})}else{$("#reply").val("");$("#reply").css("height","30px");$("#add_reply").hide();$("#add_reply_std").show();$("#comment"+i).append($(".addReply"))}var a=$("#comment"+i).width()-118;$("#reply").css("width",a+"px")}}function replyProfileComment(b){var c=_getCookie("h6userid");if(c==""){LoginAlert.show({originatingRequest:replyProfileComment,requestParameters:[b]})}else{if($("#reply").val().length>=1){var f=$(".addReply").parent().attr("id");var f=f.substring(7);var d=$("#comment"+f).attr("gid");var e=$("#comment"+f).attr("userid");$.ajax({method:"get",url:"/ajax/add_profile_comment.php?to_userid="+$("#searched_userid").val()+"&to_username="+$("#searched_username").val()+"&reply_to_userid="+e+"&pid="+f+"&gid="+d+"&type="+b+"&comment="+escape($("#reply").val()),success:function(g){var j=g.split("&");var a=j[0].split("=")[1];if(a=="false"){Alert.show(undefined,"Error",j[1].split("=")[1],false)}else{var k=j[1].split("=")[1];var h=j[2].split("=")[1];var i='<ul><li><div id="comment'+h+'" gid="'+d+'" userid="'+c+'" class="comment">';i+='<div class=avatar><a href="/user/'+k+'"><img src="'+$("#user_avatar").val()+'"></a></div>';i+='<div class=rightside><div class=title><a href="/user/'+k+'">'+k+"</a> | 1 second ago<span id=rating_"+h+"></span></div>"+$("#reply").val()+' <a onClick="displayReplyProfileComment(this)">reply</a></div>';i+='<div class="clear over"></div>';i+="</div>";i+="</li></ul>";$(".addReply").remove();$("#reply").val("");$("#reply").css("height","30px");$("#add_reply_std").show();$("#add_reply").hide();$("#comment"+f).after($(i).hide().fadeIn("slow"))}},async:false})}else{Alert.show(undefined,"Error","Your comment must have at least 1 character",false)}}}function delProfileComment(j,h,g,i){var f=_getCookie("h6userid");if(f==""){LoginAlert.show({originatingRequest:delProfileComment,requestParameters:[j,h,g,i]})}else{$("#user_comments_block").html('<div style="margin:0 auto; text-align:center; width:100%; height:500px">loading ...</div>');$.ajax({method:"get",url:"/ajax/del_profile_comment.php?comment_id="+j+"&pid="+g+"&user_id="+f+"&user_name="+h+"&page="+i,success:function(a){$("#user_comments_block").html(a);scaleImages("user_comments_block",0)},async:false})}}function launchSendMessage(b,a){var c=_getCookie("h6userid");if(c==""){LoginAlert.show({originatingRequest:launchSendMessage,requestParameters:[b,a]})}else{$.fn.colorbox({iframe:true,width:"537px",height:"402px",preloading:false,href:"/pop/send_message.php?to_userid="+b+"&to_username="+a,opacity:0.5,close:false,scrolling:false})}}function sending(a){if(a){$("control_buttons").hide();$("control_loading").show()}else{$("control_buttons").show();$("control_loading").hide()}}function sendPm(){sending(true);updateRTEs();if($("#subject").val().length<=0){Alert.show(undefined,"Error","Subject missing. Please check the subject of your message",false);sending(false)}else{if($("#hdnrte2").val().length<=2){Alert.show(undefined,"Error","Your message must have at least 2 characters",false);sending(false)}else{if($("#hdnrte2").val().length>65535){Alert.show(undefined,"Error","Your message is too long. 65535 is the max number of characters allowed",false);sending(false)}else{$("#message").val($("#hdnrte2").val());$('form[name="send_message"]').submit()}}}}function rateComment(f){var d=_getCookie("h6userid");if(d==""){LoginAlert.show({originatingRequest:rateComment,requestParameters:[f]})}else{var e=$("#comments_actions").parent().attr("id").substring(7);if($("#rating_"+e).html().length){currentRating="1"}else{currentRating="0"}$.ajax({method:"get",url:"/ajax/rate_comment.php?comment_id="+e+"&media_id="+$("media_id").value+"&rating="+f+"&current_rating="+currentRating,success:function(i){var k=i.split("&");var h=k[0].split("=")[1];if(h=="flag"){Alert.show(undefined,"Success","This comment has been flagged as inappropriate!",false);var g=k[1].split("=")[1]}else{if(h=="true"){var l=k[1];var g=k[2].split("=")[1];$("#rating_"+g).html(l)}else{var j=k[1].split("=")[1];Alert.show(undefined,"Error!",j,false,false)}}},async:false})}}function filterComment(){var f=_getCookie("h6userid");if(f==""){LoginAlert.show({originatingRequest:filterComment,requestParameters:[]})}else{var d=$("#comments_actions").parent().attr("id").substring(7);if(!$("#filter_action").length){var e="<div id=filter_action>";e+='<form action="" method="POST">';e+='<input type="hidden" name="action" value="filter_com">';e+='<input type="hidden" name="comment_id" value="'+d+'">';e+='<select name="reason" onChange="this.form.submit()">';e+='<option value="0">Select Reason</option>';e+='<option value="1">Pointless</option>';e+='<option value="2">Line jump</option>';e+='<option value="3">Bashing the upload</option>';e+='<option value="4">Bashing the website</option>';e+='<option value="5">Not related</option>';e+='<option value="6">Media fail</option>';e+="</select>";e+="</form>";e+="</div>";$("#comment"+d).append(e)}else{$("#comment"+d).append($("#filter_action"))}}}function showFilteredComment(d,b){d.parentNode.className="hid";$("#comment"+b).show()}function psContestEntry(c,d){var c=$("#comments_actions").parent().attr("id").substring(7);$.ajax({method:"get",url:"/ajax/mark_ps_contest_entry.php?comment_id="+c,success:function(b){var e=b.split("&");var a=e[0].split("=")[1];if(a=="false"){Alert.show(undefined,"Error",e[1].split("=")[1],false)}else{Alert.show(undefined,"Success",e[1].split("=")[1],false)}},async:false})}function displayCommentActions(a){$("#comments_actions").show();$("#"+a).append($("#comments_actions"));$("#"+a).unbind("mouseover")}function addCommentEvents(){$(".comment").hover(function(){displayCommentActions(this.id)},function(){$("#comments_actions").hide();$("#"+this.id).bind("mouseover",function(){displayCommentActions(this.id)})})}function orderComments(c,a,b){$("#user_comments").html('<div style="margin:25px auto; text-align:center; width:100%; height:500px">loading ...</div>');$.ajax({method:"get",url:"/ajax/display_comments.php?media_id="+$("#media_id").val()+"&comments="+c+"&order="+a+"&media_userid="+b,success:function(d){$("#user_comments").html(d)},async:false});scaleImages("user_comments",0);addCommentEvents();$("#comment").bind({keyup:function(){limitlength(this,1024)},click:function(){$("#comment").animate({height:"100px"},400)},blur:function(){if($("#comment").val()==""){$("#comment").animate({height:"30px"},400)}}})}function goAdvanced(b){if(b){$("#add_reply_std").hide();$("#add_reply").show();if($("#add_reply").html()==""){initRTE("","./html/","");rte8=new richTextEditor("rte8");rte8.html=$("#reply").val().replace(/\n/g,"<br>");rte8.build()}else{enableDesignMode("rte8",$("#reply").val().replace(/\n/g,"<br>"));$("#panel_buttons").show();$("#panel_loading").hide()}}else{$("#add_comment_std").hide();$("#add_comment").show();if($("#add_comment").html()==""){initRTE("","./html/","");rte7=new richTextEditor("rte7");rte7.html=$("#comment").val().replace(/\n/g,"<br>");rte7.build()}else{setHtmlSrc("rte7",$("#comment").val().replace(/\n/g,"<br>"));$("#panel_buttons").show();$("#panel_loading").hide()}}}function displayAdvanced(c){if(c){$("#add_reply_std").hide();$("#add_reply").show();if($("#add_reply").html()==""){initRTE("","./html/","");rte10=new richTextEditor("rte10");rte10.html=$("#reply").val().replace(/\n/g,"<br>");rte10.build()}else{enableDesignMode("rte10",$("#reply").val().replace(/\n/g,"<br>"));$("#panel_buttons").show();$("#panel_loading").hide()}var b=$("#reply").width();$("#add_reply .rte_textarea").css("width",b+"px");$("#add_reply .toolbar").css("width",(b+8)+"px")}else{$("#add_comment_std").hide();$("#add_comment").show();if($("#add_comment").html()==""){initRTE("","./html/","");rte9=new richTextEditor("rte9");rte9.html=$("#comment").val().replace(/\n/g,"<br>");rte9.build()}else{setHtmlSrc("rte9",$("#comment").val().replace(/\n/g,"<br>"));$("#panel_buttons").show();$("#panel_loading").hide()}}}function goProfileAdvanced(c){if(c){$("#add_reply_std").hide();$("#add_reply").show();if($("#add_reply").html()==""){initRTE("","./html/","");rte12=new richTextEditor("rte12");rte12.html=$("#reply").val().replace(/\n/g,"<br>");rte12.build()}else{enableDesignMode("rte12",$("#reply").val().replace(/\n/g,"<br>"));$("#panel_buttons").show();$("#panel_loading").hide()}var b=$("#reply").width();$("#add_reply .rte_textarea").css("width",b+"px");$("#add_reply .toolbar").css("width",(b+8)+"px")}else{$("#add_comment_std").hide();$("#add_comment").show();if($("#add_comment").html()==""){initRTE("","./html/","");rte11=new richTextEditor("rte11");rte11.html=$("#comment").val().replace(/\n/g,"<br>");rte11.build()}else{setHtmlSrc("rte11",$("#comment").val().replace(/\n/g,"<br>"));$("#panel_buttons").show();$("#panel_loading").hide()}var b=$("#comment").width();$("#add_comment .rte_textarea").css("width",b+"px");$("#add_comment .toolbar").css("width",(b+8)+"px")}}function displayReplyPost(f){var g=_getCookie("h6userid");if(g==""){LoginAlert.show({originatingRequest:displayReplyPost,requestParameters:[f]})}else{var h=f.parentNode.parentNode.id.substring(7);if(!$(".addReply").length){var a="<div class=addReply>";a+='<div class=avatar><img src="'+$("#user_avatar").val()+'"></div>';a+="<div id=add_reply_std>";a+='<form name="replyform" action="" method="POST">';a+="<textarea id=reply name=reply rows=1></textarea><br>";a+='<input type="button" value="ADD COMMENT" onClick="replyPost(\'std\')" class=button_black>';a+=' <input type="button" value="Go advanced" onClick="goAdvanced(true)" class=button_black>';a+=' <a href="javascript:void(0)" onClick="discardReplay()">Cancel</a>';a+="</form>";a+="</div>";a+="<div id=add_reply></div>";a+="</div>";$("#comment"+h).append(a);$("#reply").bind({keyup:function(){limitlength(this,1024)},click:function(){$("#reply").animate({height:"70px"},400)},blur:function(){if($("#reply").val()==""){$("#reply").animate({height:"30px"},400)}}})}else{$("#reply").val("");$("#reply").css("height","30px");$("#add_reply").hide();$("#add_reply_std").show();$("#comment"+h).append($(".addReply"))}}}function displayReplyComment(){var f=_getCookie("h6userid");if(f==""){LoginAlert.show({originatingRequest:displayReplyComment,requestParameters:[]})}else{var g=$("#comments_actions").parent().attr("id").substring(7);if(!$(".addReply").length){var e="<div class=addReply>";e+='<div class=avatar><img src="'+$("#user_avatar").val()+'"></div>';e+="<div id=add_reply_std>";e+='<form name="replyform" action="" method="POST">';e+="<textarea id=reply name=reply rows=1></textarea><br>";e+='<input type="button" value="ADD COMMENT" onClick="replyComment(\'std\')" class=button_black>';e+=' <input type="button" value="Go advanced" onClick="displayAdvanced(true)" class=button_black>';e+=' <a href="javascript:void(0)" onClick="discardReplay()">Cancel</a>';e+="</form>";e+="</div>";e+="<div id=add_reply></div>";e+="</div>";$("#comment"+g).append(e);$("#reply").bind({keyup:function(){limitlength(this,1024)},click:function(){$("#reply").animate({height:"70px"},400)},blur:function(){if($("#reply").val()==""){$("#reply").animate({height:"30px"},400)}}})}else{$("#reply").val("");$("#reply").css("height","30px");$("#add_reply").hide();$("#add_reply_std").show();$("#comment"+g).append($(".addReply"))}var a=$("#comment"+g).width()-118;$("#reply").css("width",a+"px")}}function discardReplay(){$("#reply").css("height","30px");$("#reply").click(function(){$("#reply").animate({height:"70px"},400)});$(".addReply").remove()}function replyPost(b){var c=_getCookie("h6userid");if(c==""){LoginAlert.show({originatingRequest:replyPost,requestParameters:[b]})}else{if($("#reply").val().length>=1){var d=$(".addReply").parent().attr("id");var d=d.substring(7);$.ajax({method:"get",url:"/ajax/reply_post.php?parent_id="+d+"&thread_id="+$("#media_id").val()+"&type="+b+"&reply="+escape($("#reply").val()),success:function(e){var h=e.split("&");var a=h[0].split("=")[1];if(a=="false"){Alert.show(undefined,"Error",h[1].split("=")[1],false)}else{var i=h[1].split("=")[1];var f=h[2].split("=")[1];var g='<ul><li><div id="comment'+f+'" class="comment';if(i==$("#media_username").val()){g+=" upl"}g+='">';g+='<div class=avatar><a href="/user/'+i+'"><img src="'+$("#user_avatar").val()+'"></a></div>';g+='<div class=rightside><div class=title><a href="/user/'+i+'">'+i+"</a> | 1 second ago<span id=rating_"+f+"></span></div>"+$("#reply").val()+' <a onClick="displayReplyPost(this)">reply</a></div>';g+='<div class="clear over"></div>';g+="</div>";g+="</li></ul>";$(".addReply").remove();$("#reply").val("");$("#reply").css("height","30px");$("#add_reply_std").show();$("#add_reply").hide();$("#comment"+d).after($(g).hide().fadeIn("slow"))}},async:false})}else{Alert.show(undefined,"Error","Your comment must have at least 1 character",false)}}}function replyComment(b){var c=_getCookie("h6userid");if(c==""){LoginAlert.show({originatingRequest:replyComment,requestParameters:[b]})}else{if($("#reply").val().length>=1){var d=$(".addReply").parent().attr("id");var d=d.substring(7);$.ajax({method:"get",url:"/ajax/reply_comment.php?parent_id="+d+"&media_id="+$("#media_id").val()+"&type="+b+"&reply="+escape($("#reply").val()),success:function(e){var h=e.split("&");var a=h[0].split("=")[1];if(a=="false"){Alert.show(undefined,"Error",h[1].split("=")[1],false)}else{var j=h[1].split("=")[1];var f=h[2].split("=")[1];var g='<ul><li><div id="comment'+f+'" class="comment';if(j==$("#media_username").val()){g+=" upl"}g+='">';g+='<div class=avatar><a href="/user/'+j+'"><img src="'+$("#user_avatar").val()+'"></a></div>';g+='<div class=rightside><div class=title><a href="/user/'+j+'">'+j+"</a> | 1 second ago | +1<span id=rating_"+f+"></span></div>"+$("#reply").val()+"</div>";g+='<div class="clear over"></div>';g+="</div>";g+="</li></ul>";$(".addReply").remove();$("#reply").val("");$("#reply").css("height","30px");$("#add_reply_std").show();$("#add_reply").hide();$("#comment"+d).after($(g).hide().fadeIn("slow"));var i=$("#comment"+f+" .rightside").width();scaleImages("comment"+f,i);$("#comment"+f).hover(function(){displayCommentActions(this.id)},function(){$("#comments_actions").hide();$("#"+this.id).bind("mouseover",function(){displayCommentActions(this.id)})})}},async:false})}else{Alert.show(undefined,"Error","Your comment must have at least 1 character",false)}}}function addPost(c){var d=_getCookie("h6userid");if(d==""){LoginAlert.show({originatingRequest:addPost,requestParameters:[c]})}else{if($("#comment").val().length>=1){$.ajax({method:"get",url:"/ajax/add_post.php?thread_id="+$("#media_id").val()+"&type="+c+"&post="+escape($("#comment").val()),success:function(b){var g=b.split("&");var a=g[0].split("=")[1];if(a=="false"){Alert.show(undefined,"Error",g[1].split("=")[1],false)}else{var h=g[1].split("=")[1];var e=g[2].split("=")[1];var f="<li>";f+='<div id="comment'+e+'" class="comment';if(h==$("#media_username").val()){f+=" upl"}f+='">';f+='<div class=avatar><a href="/user/'+h+'"><img src="'+$("#user_avatar").val()+'"></a></div>';f+='<div class=rightside><div class=title><a href="/user/'+h+'">'+h+"</a> | 1 second ago</div>"+$("#comment").val()+' <a onClick="displayReplyPost(this)">reply</a></div>';f+='<div class="clear over"></div>';f+="</div>";f+="</li>";$("#comment").val("");$("#comment").css("height","30px");$("#add_comment_std").show();$("#add_comment").hide();$(".topLevel").append($(f).hide().fadeIn("slow"))}},async:false})}else{Alert.show(undefined,"Error","Your comment must have at least 1 character",false)}}}function addComment(c){var d=_getCookie("h6userid");if(d==""){LoginAlert.show({originatingRequest:addComment,requestParameters:[c]})}else{if($("#comment").val().length>=1){$.ajax({method:"get",url:"/ajax/add_comment.php?media_id="+$("#media_id").val()+"&type="+c+"&comment="+escape($("#comment").val()),success:function(b){var g=b.split("&");var a=g[0].split("=")[1];if(a=="false"){Alert.show(undefined,"Error",g[1].split("=")[1],false)}else{var h=g[1].split("=")[1];var e=g[2].split("=")[1];var f="<li>";f+='<div id="comment'+e+'" class="comment';if(h==$("#media_username").val()){f+=" upl"}f+='">';f+='<div class=avatar><a href="/user/'+h+'"><img src="'+$("#user_avatar").val()+'"></a></div>';f+='<div class=rightside><div class=title><a href="/user/'+h+'">'+h+"</a> | 1 second ago | +1</div>"+$("#comment").val()+"</div>";f+='<div class="clear over"></div>';f+="</div>";f+="</li>";$("#comment").val("");$("#comment").css("height","30px");$("#add_comment_std").show();$("#add_comment").hide();$(".topLevel").append($(f).hide().fadeIn("slow"));scaleImages("comment"+e,560);$("#comment"+e).hover(function(){displayCommentActions(this.id)},function(){$("#comments_actions").hide();$("#"+this.id).bind("mouseover",function(){displayCommentActions(this.id)})})}},async:false})}else{Alert.show(undefined,"Error","Your comment must have at least 1 character",false)}}}function scaleImages(d,b){$("#"+d+" img").load(function(){actualHeight=this.height;actualWidth=this.width;if(b==0){wLimit=this.parentNode.offsetWidth}else{wLimit=b}if(actualWidth>wLimit){this.width=wLimit;this.height=(actualHeight/actualWidth)*this.width;this.style.cursor="url('http://h6img.com/assets/build1/i/magnify.cur'),default";this.onclick=function(){$.fn.colorbox({href:this.src,opacity:0.5,photo:true,scrolling:false,close:false})}}})}var th_img=null;var th_img_start=null;var th_folder=null;var th_title=null;var th_pos=0;var th_preload=null;var th_watchdog=null;var th_lastframe=0;function th_start(c){if(th_img==c){return}th_stop();th_img=c;th_img_start=c.src;th_pos=0;var d=c.src.lastIndexOf("/");th_folder=c.src.substring(0,d+1);th_title=c.src.substring(d+1);var d=th_title.lastIndexOf("-");th_title=th_title.substring(0,d+1);th_shortname=c.src.substring(d+1);d=th_shortname.lastIndexOf(".jpg");th_shortname=th_shortname.substring(0,d);th_lastframe=0;th_rotate();th_watchdog=setTimeout(th_swap,25)}function th_stop(b){if(th_watchdog){clearTimeout(th_watchdog)}if(th_img&&th_img_start){th_img.src=th_img_start}th_img=null}function th_rotate(){th_preload=new Image();th_preload.src=th_folder+th_title+th_pos+".jpg";th_pos+=1;if(th_pos>7){th_pos=0}}function th_swap(){if(th_img==null){return}if(!th_preload.complete){th_watchdog=setTimeout(th_swap,25);return}if(th_preload.width==0){th_rotate();return}var b=new Date().getTime()-th_lastframe;if(b<0){b=0}else{if(b>500){b=500}}if(b>=500){th_img.src=th_preload.src;th_lastframe=new Date().getTime();th_watchdog=setTimeout(th_swap,500);th_rotate();return}th_watchdog=setTimeout(th_swap,25)}function checkAll(d,e){for(var f=0;f<d.length;f++){fldObj=d.elements[f];if(fldObj.type=="checkbox"){fldObj.checked=e}}}function resetCheckAllValue(c,d){if(!d){main_checkbox=document.getElementById("checkall_checkbox");main_checkbox.checked=false}}function limitlength(i,j,h){var g=j;var f=g-i.value.length;if(f<0){i.value=i.value.substring(0,g);f=0}if(h){$(h).innerHTML=f+" characters remaining"}}function updateUsernameStatus(){var a=document.register.username.value;if(a!=""){$("#check_username").show();$.ajax({method:"get",url:"/ajax/signup_checkups.php?field=username&username="+a,success:function(b){$("#check_username").html(b)},async:false})}}function rateMedia(c){var d=_getCookie("h6userid");if(d==""){LoginAlert.show({originatingRequest:rateMedia,requestParameters:[c]})}else{$.ajax({method:"get",url:"/ajax/rate_media.php?media_id="+$("#media_id").val()+"&rating="+c,success:function(h){var j=h.split("&");var g=j[0].split("=")[1];if(g=="true"){var f=j[1];var k=j[2];$("#rating").html(k);$("#ratingResponse").show();$("#ratingResponse").html(f);$("#ratingResponse").delay(7500).slideUp("slow")}else{var i=j[1].split("=")[1];Alert.show(undefined,"Error!",i,false,false)}},async:false})}}function _setCookie(h,k,m,j,l){if(m>0){var i=new Date();var n=new Date(i.getTime()+m*24*60*60*1000);n=n.toGMTString()}else{var n=0}document.cookie=h+"="+escape(k)+((m)?"; expires="+n:"")+((j)?"; path="+j:"")+((l)?"; domain="+l:"")}function _deleteCookie(e,f,d){if(_getCookie(e)){document.cookie=e+"="+((f)?"; path="+f:"")+((d)?"; domain="+d:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function removeUpload(b){if(confirm("Are you sure you want to remove this upload?")){window.location.href="http://adm.heaven666.org/my_uploads_edit.php?action_remove=1&upload_id="+b}}function setBrowseOption(b){_setCookie("browse",b+"-",0,"/",".heaven666.org")}function setFocusCbox(){$(".cboxIframe").focus()}function updateEmbedCode(d){var b,a;if(d=="predefW"){b=$("#embedPredefSize").val();a=Math.round(9*b/16);$("#embedCustomSizeW").val("");$("#embedCustomSizeH").val("")}else{if(d="customW"){b=$("#embedCustomSizeW").val();a=Math.round(9*b/16);$("#embedCustomSizeH").val(a)}else{a=$("#embedCustomSizeH").val();b=Math.round(16*b/9);$("#embedCustomSizeW").val(b)}}var c='<iframe width="'+b+'" height="'+a+'" src="http://www.heaven666.org/embed/'+$("#media_id").val()+'" frameborder="0" allowfullscreen></iframe>';$("#embedCode").val(c)}function new_window(e,h,g){var f=function(){if(!window.open(e,"t","scrollbars=yes,toolbar=0,resizable=1,status=0,width="+h+",height="+g)){document.location.href=e}};if(/Firefox/.test(navigator.userAgent)){setTimeout(f,0)}else{f()}}function switchSearchAction(a){$("#search_action").val(a);var b=$("#search_q").val();$("#search_q").val("");$("#search_q").focus();$("#search_q").val(b);$("#search_action_select li a").css("font-weight","normal")}function editSelection(){var b=_getCookie("h6userid");if(b==""){LoginAlert.show({originatingRequest:editSelection,requestParameters:[]})}else{$.fn.colorbox({iframe:true,width:"360px",height:"500px",preloading:false,href:"/pop/edit_selection.php",opacity:0.5,onClosed:function(){window.location.reload()}})}}function updateMediaList(b){$("#media_list").html("loading..");$.ajax({method:"get",url:"/ajax/update_media_list.php?order_by="+b,success:function(a){$("#media_list").html(a);$("#media_list [title], .media [title]").tipsy({html:true,gravity:"n",offset:9})}})};

//autocomplete
(function(a){a.Autocompleter=function(c,d){this.cacheData_={};this.cacheLength_=0;this.selectClass_="jquery-autocomplete-selected-item";this.keyTimeout_=null;this.lastKeyPressed_=null;this.lastProcessedValue_=null;this.lastSelectedValue_=null;this.active_=false;this.finishOnBlur_=true;if(!c||!(c instanceof jQuery)||c.length!==1||c.get(0).tagName.toUpperCase()!=="INPUT"){alert("Invalid parameter for jquery.Autocompleter, jQuery object with one element with INPUT tag expected");return}if(typeof d==="string"){this.options={url:d}}else{this.options=d}this.options.maxCacheLength=parseInt(this.options.maxCacheLength,10);if(isNaN(this.options.maxCacheLength)||this.options.maxCacheLength<1){this.options.maxCacheLength=1}this.options.minChars=parseInt(this.options.minChars,10);if(isNaN(this.options.minChars)||this.options.minChars<1){this.options.minChars=1}this.dom={};this.dom.$elem=c;if(this.options.inputClass){this.dom.$elem.addClass(this.options.inputClass)}this.dom.$results=a("<div></div>").hide();if(this.options.resultsClass){this.dom.$results.addClass(this.options.resultsClass)}this.dom.$results.css({position:"absolute"});a("body").append(this.dom.$results);var b=this;c.keydown(function(f){b.lastKeyPressed_=f.keyCode;switch(b.lastKeyPressed_){case 38:f.preventDefault();if(b.active_){b.focusPrev()}else{b.activate()}return false;break;case 40:f.preventDefault();if(b.active_){b.focusNext()}else{b.activate()}return false;break;case 9:case 13:if(b.active_){f.preventDefault();b.selectCurrent();return false}break;case 27:if(b.active_){f.preventDefault();b.finish();return false}break;default:b.activate()}});c.blur(function(){if(b.finishOnBlur_){setTimeout(function(){b.finish()},200)}})};a.Autocompleter.prototype.position=function(){var b=this.dom.$elem.offset();this.dom.$results.css({top:b.top+this.dom.$elem.outerHeight(),left:b.left})};a.Autocompleter.prototype.cacheRead=function(e){var g,d,c,b,f;if(this.options.useCache){e=String(e);g=e.length;if(this.options.matchSubset){d=1}else{d=g}while(d<=g){if(this.options.matchInside){b=g-d}else{b=0}f=0;while(f<=b){c=e.substr(0,d);if(this.cacheData_[c]!==undefined){return this.cacheData_[c]}f++}d++}}return false};a.Autocompleter.prototype.cacheWrite=function(b,c){if(this.options.useCache){if(this.cacheLength_>=this.options.maxCacheLength){this.cacheFlush()}b=String(b);if(this.cacheData_[b]!==undefined){this.cacheLength_++}return this.cacheData_[b]=c}return false};a.Autocompleter.prototype.cacheFlush=function(){this.cacheData_={};this.cacheLength_=0};a.Autocompleter.prototype.callHook=function(d,c){var b=this.options[d];if(b&&a.isFunction(b)){return b(c,this)}return false};a.Autocompleter.prototype.activate=function(){var c=this;var b=function(){c.activateNow()};var d=parseInt(this.options.delay,10);if(isNaN(d)||d<=0){d=250}if(this.keyTimeout_){clearTimeout(this.keyTimeout_)}this.keyTimeout_=setTimeout(b,d)};a.Autocompleter.prototype.activateNow=function(){var b=this.dom.$elem.val();if(b!==this.lastProcessedValue_&&b!==this.lastSelectedValue_){if(b.length>=this.options.minChars){this.active_=true;this.lastProcessedValue_=b;this.fetchData(b)}}};a.Autocompleter.prototype.fetchData=function(c){if(this.options.data){this.filterAndShowResults(this.options.data,c)}else{var b=this;this.fetchRemoteData(c,function(d){b.filterAndShowResults(d,c)})}};a.Autocompleter.prototype.fetchRemoteData=function(d,f){var e=this.cacheRead(d);var b=this;this.dom.$elem.addClass(this.options.loadingClass);var c=function(h){var g=false;if(h!==false){g=b.parseRemoteData(h);b.cacheWrite(d,g)}b.dom.$elem.removeClass(b.options.loadingClass);f(g)};a.ajax({url:this.makeUrl(d),success:c,error:function(){c(false)}})};a.Autocompleter.prototype.setExtraParam=function(c,d){var b=a.trim(String(c));if(b){if(!this.options.extraParams){this.options.extraParams={}}if(this.options.extraParams[b]!==d){this.options.extraParams[b]=d;this.cacheFlush()}}};a.Autocompleter.prototype.makeUrl=function(g){var b=this;var e=this.options.paramName||"q";var c=this.options.url;var f=a.extend({},this.options.extraParams);if(this.options.paramName===false){c+=encodeURIComponent(g)}else{f[e]=g}var d=[];a.each(f,function(h,i){d.push(b.makeUrlParam(h,i))});if(d.length){c+=c.indexOf("?")==-1?"?":"&";c+=d.join("&")}return c};a.Autocompleter.prototype.makeUrlParam=function(b,c){return String(b)+"="+encodeURIComponent(c)};a.Autocompleter.prototype.parseRemoteData=function(f){var d=[];var h=String(f).replace("\r\n","\n");var e,b,c,k,l=h.split("\n");var g;for(e=0;e<l.length;e++){k=l[e].split("|");c=[];for(b=0;b<k.length;b++){c.push(unescape(k[b]))}g=c.shift();d.push({value:unescape(g),data:c})}return d};a.Autocompleter.prototype.filterAndShowResults=function(b,c){this.showResults(this.filterResults(b,c),c)};a.Autocompleter.prototype.filterResults=function(f,c){var h=[];var n,e,g,o,k,b;var m,j,d="";var l=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");for(g=0;g<f.length;g++){o=f[g];k=typeof o;if(k==="string"){n=o;e={}}else{if(a.isArray(o)){n=o[0];e=o.slice(1)}else{if(k==="object"){n=o.value;e=o.data}}}n=String(n);if(n>""){if(typeof e!=="object"){e={}}b=!this.options.filterResults;if(!b){j=String(c);j=j.replace(l,"\\$&");if(!this.options.matchInside){j="^"+j}if(!this.options.matchCase){d="i"}m=new RegExp(j,d);b=m.test(n)}if(b){h.push({value:n,data:e})}}}if(this.options.sortResults){}if(this.options.maxItemsToShow>0&&this.options.maxItemsToShow<h.length){h.length=this.options.maxItemsToShow}return h};a.Autocompleter.prototype.showResults=function(f,c){var l=this;var h=a("<ul></ul>");var g,m,k,b,j=false,e=false;var d=f.length;for(g=0;g<d;g++){m=f[g];k=a("<li>"+this.showResult(m.value,m.data)+"</li>");k.data("value",m.value);k.data("data",m.data);k.click(function(){var i=a(this);l.selectItem(i)}).mousedown(function(){l.finishOnBlur_=false}).mouseup(function(){l.finishOnBlur_=true});h.append(k);if(j===false){j=String(m.value);e=k;k.addClass(this.options.firstItemClass)}if(g==d-1){k.addClass(this.options.lastItemClass)}}this.position();this.dom.$results.html(h).show();b=this.dom.$results.outerWidth()-this.dom.$results.width();this.dom.$results.width(this.dom.$elem.outerWidth()-b);a("li",this.dom.$results).hover(function(){l.focusItem(this)},function(){});if(this.autoFill(j,c)){this.focusItem(e)}};a.Autocompleter.prototype.showResult=function(c,b){if(a.isFunction(this.options.showResult)){return this.options.showResult(c,b)}else{return c}};a.Autocompleter.prototype.autoFill=function(f,d){var c,b,e,g;if(this.options.autoFill&&this.lastKeyPressed_!=8){c=String(f).toLowerCase();b=String(d).toLowerCase();e=f.length;g=d.length;if(c.substr(0,g)===b){this.dom.$elem.val(f);this.selectRange(g,e);return true}}return false};a.Autocompleter.prototype.focusNext=function(){this.focusMove(+1)};a.Autocompleter.prototype.focusPrev=function(){this.focusMove(-1)};a.Autocompleter.prototype.focusMove=function(b){var c,d=a("li",this.dom.$results);b=parseInt(b,10);for(var c=0;c<d.length;c++){if(a(d[c]).hasClass(this.selectClass_)){this.focusItem(c+b);return}}this.focusItem(0)};a.Autocompleter.prototype.focusItem=function(c){var b,d=a("li",this.dom.$results);if(d.length){d.removeClass(this.selectClass_).removeClass(this.options.selectClass);if(typeof c==="number"){c=parseInt(c,10);if(c<0){c=0}else{if(c>=d.length){c=d.length-1}}b=a(d[c])}else{b=a(c)}if(b){b.addClass(this.selectClass_).addClass(this.options.selectClass)}}};a.Autocompleter.prototype.selectCurrent=function(){var b=a("li."+this.selectClass_,this.dom.$results);if(b.length==1){this.selectItem(b)}else{this.finish()}};a.Autocompleter.prototype.selectItem=function(e){var d=e.data("value");var c=e.data("data");var b=this.displayValue(d,c);this.lastProcessedValue_=b;this.lastSelectedValue_=b;this.dom.$elem.val(b).focus();this.setCaret(b.length);this.callHook("onItemSelect",{value:d,data:c});this.finish()};a.Autocompleter.prototype.displayValue=function(c,b){if(a.isFunction(this.options.displayValue)){return this.options.displayValue(c,b)}else{return c}};a.Autocompleter.prototype.finish=function(){if(this.keyTimeout_){clearTimeout(this.keyTimeout_)}if(this.dom.$elem.val()!==this.lastSelectedValue_){if(this.options.mustMatch){this.dom.$elem.val("")}this.callHook("onNoMatch")}this.dom.$results.hide();this.lastKeyPressed_=null;this.lastProcessedValue_=null;if(this.active_){this.callHook("onFinish")}this.active_=false};a.Autocompleter.prototype.selectRange=function(e,b){var d=this.dom.$elem.get(0);if(d.setSelectionRange){d.focus();d.setSelectionRange(e,b)}else{if(this.createTextRange){var c=this.createTextRange();c.collapse(true);c.moveEnd("character",b);c.moveStart("character",e);c.select()}}};a.Autocompleter.prototype.setCaret=function(b){this.selectRange(b,b)};a.fn.autocomplete=function(b){if(typeof b==="string"){b={url:b}}var c=a.extend({},a.fn.autocomplete.defaults,b);return this.each(function(){var e=a(this);var d=new a.Autocompleter(e,c);e.data("autocompleter",d)})};a.fn.autocomplete.defaults={paramName:"q",minChars:1,loadingClass:"acLoading",resultsClass:"acResults",inputClass:"acInput",selectClass:"acSelect",mustMatch:false,matchCase:false,matchInside:true,matchSubset:false,useCache:false,maxCacheLength:10,autoFill:false,filterResults:true,sortResults:false,sortFunction:false,onItemSelect:true,onNoMatch:false,maxItemsToShow:-1}})(jQuery);function siteSearchSubmit(){document.forms.site_search.submit()}function messagesFromSearchSubmit(){document.forms.messagesFrom.submit()}function messagesToSearchSubmit(){document.forms.messagesTo.submit()}function messagesWithTitleSearchSubmit(){document.forms.messagesWithTitle.submit()};

//colorbox
(function(a,b,c){function bc(b){if(!U){P=b,_(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=Z(K.initialWidth,"x"),K.h=Z(K.initialHeight,"y"),X.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),ba(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}X.load(!0)}}function bb(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(X.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(X.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,d),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function ba(b,c){c&&c.call(P),a.event.trigger(b)}function _(b){K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.substring(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function $(a){return K.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function Z(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function Y(c,d,e){e=b.createElement("div"),c&&(e.id=f+c),e.style.cssText=d||"";return a(e)}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;X=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{};if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bc(f[0]);return f},X.init=function(){z=a(c),r=Y().attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y("Overlay",o?"position:absolute":"").hide(),s=Y("Wrapper"),t=Y("Content").append(A=Y("LoadedContent","width:0; height:0; overflow:hidden"),C=Y("LoadingOverlay").add(Y("LoadingGraphic")),D=Y("Title"),E=Y("Current"),G=Y("Next"),H=Y("Previous"),F=Y("Slideshow").bind(h,bb),I=Y("Close")),s.append(Y().append(Y("TopLeft"),u=Y("TopCenter"),Y("TopRight")),Y(!1,"clear:left").append(v=Y("MiddleLeft"),t,w=Y("MiddleRight")),Y(!1,"clear:left").append(Y("BottomLeft"),x=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"}),B=Y(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),t.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){X.next()}),H.click(function(){X.prev()}),I.click(function(){X.close()}),J=G.add(H).add(E).add(F),t.children().removeClass("hover"),q.click(function(){K.overlayClose&&X.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),X.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})},X.remove=function(){r.add(q).remove(),a("."+g).removeData(e).removeClass(g)},X.position=function(a,c){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var d=0,e=0;z.unbind("resize."+f),r.hide(),K.fixed&&!o?r.css({position:"fixed"}):(d=z.scrollTop(),e=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?e+=Math.max(z.width()-K.w-O-M-Z(K.right,"x"),0):K.left!==!1?e+=Z(K.left,"x"):e+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?d+=Math.max(b.documentElement.clientHeight-K.h-N-L-Z(K.bottom,"y"),0):K.top!==!1?d+=Z(K.top,"y"):d+=Math.round(Math.max(b.documentElement.clientHeight-K.h-N-L,0)/2),r.show(),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:d,left:e},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",c&&c(),setTimeout(function(){z.bind("resize."+f,X.position)},1)},step:function(){g(this)}})},X.resize=function(a){if(S){a=a||{},a.width&&(K.w=Z(a.width,"x")-O-M),a.innerWidth&&(K.w=Z(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=Z(a.height,"y")-N-L),a.innerHeight&&(K.h=Z(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=A.wrapInner("<div style='overflow:auto'></div>").children();K.h=b.height(),b.replaceWith(b.children())}A.css({height:K.h}),X.position(K.transition==="none"?0:K.speed)}},X.prep=function(b){function h(){K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h;return K.h}function g(){K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w;return K.w}if(!!S){var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y("LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function o(){n&&r[0].style.removeAttribute("filter")}var b,c,g,h,i=y.length,k,l;!S||(l=function(){clearTimeout(W),C.hide(),ba(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show(),i>1?(typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",i)).show(),G[K.loop||Q<i-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),b=Q?y[Q-1]:y[i-1],g=Q<i-1?y[Q+1]:y[0],K.slideshow&&F.show(),K.preloading&&(h=a.data(g,e).href||g.href,c=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,c=a.isFunction(c)?c.call(b):c,$(h)&&(a("<img/>")[0].src=h),$(c)&&(a("<img/>")[0].src=c))):J.hide(),K.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],K.fastIframe?l():a(k).one("load",l),k.name=f+ +(new Date),k.src=K.href,K.scrolling||(k.scrolling="no"),n&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(A).one(m,function(){k.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,o):o())},K.transition==="fade"?r.fadeTo(d,0,function(){X.position(0,c)}):X.position(d,c)}},X.load=function(b){var c,d,e=X.prep;T=!0,R=!1,P=y[Q],b||_(),ba(m),ba(i,K.onLoad),K.h=K.height?Z(K.height,"y")-N-L:K.innerHeight&&Z(K.innerHeight,"y"),K.w=K.width?Z(K.width,"x")-O-M:K.innerWidth&&Z(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=Z(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=Z(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,W=setTimeout(function(){C.show()},100),K.inline?(Y().hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):$(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y("Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){X.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},X.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Q<y.length-1?Q+1:0,X.load())},X.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Q?Q-1:y.length-1,X.load())},X.close=function(){S&&!U&&(U=!0,S=!1,ba(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),ba(m),A.remove(),setTimeout(function(){U=!1,ba(l,K.onClosed)},1)}))},X.element=function(){return a(P)},X.settings=d,V=function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),bc(this))},a.fn.delegate?a(b).delegate("."+g,"click",V):a("."+g).live("click",V),a(X.init)})(jQuery,document,this);

//tipsy
(function(a){a.fn.tipsy=function(b){b=a.extend({},a.fn.tipsy.defaults,b);return this.each(function(){var c=a.fn.tipsy.elementOptions(this,b);a(this).hover(function(){a.data(this,"cancel.tipsy",true);var d=a.data(this,"active.tipsy");if(!d){d=a('<div class="tipsy"><div class="tipsy-inner"/></div>');d.css({position:"absolute",zIndex:100000});a.data(this,"active.tipsy",d)}if(a(this).attr("title")||typeof(a(this).attr("original-title"))!="string"){a(this).attr("original-title",a(this).attr("title")||"").removeAttr("title")}var f;if(typeof c.title=="string"){f=a(this).attr(c.title=="title"?"original-title":c.title)}else{if(typeof c.title=="function"){f=c.title.call(this)}}d.find(".tipsy-inner")[c.html?"html":"text"](f||c.fallback);var i=a.extend({},a(this).offset(),{width:this.offsetWidth,height:this.offsetHeight});d.get(0).className="tipsy";d.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).appendTo(document.body);var e=d[0].offsetWidth,h=d[0].offsetHeight;var g=(typeof c.gravity=="function")?c.gravity.call(this):c.gravity;switch(g.charAt(0)){case"n":d.css({top:i.top+i.height-5-c.offset,left:i.left+i.width/2-e/2}).addClass("tipsy-north");break;case"s":d.css({top:i.top-h,left:i.left+i.width/2-e/2}).addClass("tipsy-south");break;case"e":d.css({top:i.top+i.height/2-h/2,left:i.left-e}).addClass("tipsy-east");break;case"w":d.css({top:i.top+i.height/2-h/2,left:i.left+i.width}).addClass("tipsy-west");break}if(c.fade){d.css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:0.8})}else{d.css({visibility:"visible"})}},function(){a.data(this,"cancel.tipsy",false);var d=this;setTimeout(function(){if(a.data(this,"cancel.tipsy")){return}var e=a.data(d,"active.tipsy");if(c.fade){e.stop().fadeOut(function(){a(this).remove()})}else{e.remove()}},100)})})};a.fn.tipsy.elementOptions=function(c,b){return a.metadata?a.extend({},b,a(c).metadata()):b};a.fn.tipsy.defaults={fade:false,fallback:"",gravity:"n",html:false,title:"title",offset:0};a.fn.tipsy.autoNS=function(){return a(this).offset().top>(a(document).scrollTop()+a(window).height()/2)?"s":"n"};a.fn.tipsy.autoWE=function(){return a(this).offset().left>(a(document).scrollLeft()+a(window).width()/2)?"e":"w"}})(jQuery);

//richtext
var debugMode=false;var isRichText=false;var allRTEs="";var currentRTE="";var selectionText="";var rng;var lastCommand;var maxLoops=20;var loopCnt=0;var baseUrl=window.parent.document.location.protocol+"//"+document.domain+"/";var embedVideoItems=0;var embedVideo=new Array();var imagesPath="";var includesPath="";var cssFile="";var ua=navigator.userAgent.toLowerCase();var isIE=((ua.indexOf("msie")!=-1)&&(ua.indexOf("opera")==-1)&&(ua.indexOf("webtv")==-1));var ieVersion=parseFloat(ua.substring(ua.indexOf("msie ")+5));var isGecko=(ua.indexOf("gecko")!=-1);var isSafari=(ua.indexOf("safari")!=-1);var isIphone=(ua.indexOf("iphone")!=-1);var webkitVersion=get_webkit_version();if(webkitVersion){webkitVersion=webkitVersion.major}else{webkitVersion=null}var isKonqueror=(ua.indexOf("konqueror")!=-1);var konquerorVersion=parseFloat(ua.substring(ua.indexOf("konqueror/")+10));var isOpera=(ua.indexOf("opera")!=-1);var isNetscape=(ua.indexOf("netscape")!=-1);var netscapeVersion=parseFloat(ua.substring(ua.lastIndexOf("/")+1));var toolbar1Enabled=true;var cmdInsertHTMLEnabled=true;var cmdCreateLinkEnabled=true;var cmdInsertImageEnabled=true;function initRTE(g,e,f){try{imagesPath=g;includesPath=e;cssFile=f;if(document.designMode){if(document.getElementById&&!isIE&&!isSafari&&!isKonqueror){isRichText=true;if(isNetscape&&netscapeVersion<8){cmdInsertHTMLEnabled=false}}else{if(isIE&&ieVersion>=5.5){isRichText=true}else{if(isSafari){if(!isIphone){if(webkitVersion>=420){isRichText=true}else{if(webkitVersion>=312){isRichText=true;toolbar1Enabled=false;cmdInsertImageEnabled=false;cmdInsertHTMLEnabled=false;cmdCreateLinkEnabled=false}}}}}}}if(isRichText){if(isIE){document.onmouseover=raiseButton;document.onmouseout=normalButton;document.onmousedown=lowerButton;document.onmouseup=raiseButton}}}catch(h){if(debugMode){alert(h)}}}function richTextEditor(b){this.rteID=b;this.html="";if(b=="rte1"){this.containerElem=document.getElementById("add_profile_comment")}else{if(b=="rte2"){this.containerElem=document.getElementById("send_message")}else{if(b=="rte3"){this.containerElem=document.getElementById("message_reply")}else{if(b=="rte4"){this.containerElem=document.getElementById("update_blackboard")}else{if(b=="rte5"){this.containerElem=document.getElementById("upload_article")}else{if(b=="rte6"){this.containerElem=document.getElementById("edit_article")}else{if(b=="rte7"||b=="rte9"||b=="rte11"){this.containerElem=document.getElementById("add_comment")}else{if(b=="rte8"||b=="rte10"||b=="rte12"){this.containerElem=document.getElementById("add_reply")}}}}}}}}this.build=build}function build(){with(this){if(isRichText){writeRichText(this);enableDesignMode(this.rteID,htmlDecode(this.html));if(isGecko){currentRTE=this.rteID;insertHTML("<br>");rteCommand(this.rteID,"undo")}}else{writePlainText(this)}}}function writePlainText(e){var f="";if(e.rteID=="rte1"){f+='<input type=hidden id=touserid name=touserid value="">';f+='<input type=hidden id=tousername name=tousername value="">';f+='<input type=hidden id=replytouserid name=replytouserid value="">';f+='<input type=hidden id=pid name=pid value="">';f+='<input type=hidden id=gid name=gid value="">';f+='<div style="text-align:left; font:12px Verdana, Arial, sans-serif; padding:0 3px 0 3px; color:#444">Please help us keep this website clean and nonsense free. In that respect please do NOT: thank people for the add, for the point, for the comment, etc. You deserved it! Abusing this simple rule might get your account closed.</div>'}f+='<textarea name="'+e.rteID+'" id="hdn'+e.rteID+'" style="width:515px; height:260px">'+e.html+"</textarea>";if(e.rteID=="rte1"||e.rteID=="rte2"){f+='<div id="panel_buttons" style="position:absolute;left:0;bottom:6px">';f+='<input type=button class="button_black" onClick="rteSubmit(\''+e.rteID+'\')" value="';if(e.rteID=="rte1"){f+="ADD"}else{f+="SEND"}f+='">&nbsp;';f+='<input type=button class="button_black" onClick="closePanel(';if(e.rteID=="rte1"){f+="'panel1'"}else{if(e.rteID=="rte2"){f+="'panel2'"}}f+=')" value="close">';f+="</div>";f+='<div id="panel_loading" class="hid" style="position:absolute; left:10px; bottom:8px">sending ...</div>'}else{if(e.rteID=="rte3"||e.rteID=="rte4"||e.rteID=="rte7"||e.rteID=="rte8"||e.rteID=="rte9"||e.rteID=="rte10"||e.rteID=="rte11"||e.rteID=="rte12"){if(e.rteID=="rte3"||e.rteID=="rte4"){var g="SEND";var h="sending ..."}else{var g="ADD COMMENT";var h="adding ..."}f+='<div id="panel_buttons" class="alignL" style="width:514px; padding:5px; margin: 0 auto"><input type=button class="button_black" onClick="rteSubmit(\''+e.rteID+'\')" value="'+g+'"></div>';f+='<div id="panel_loading" class="hid" style="width:514px;margin-top:4px">'+h+"</div>"}}appendToBody(e.containerElem,f)}function rteSubmit(c){document.getElementById("panel_buttons").className="hid";document.getElementById("panel_loading").className="bg1";updateRTEs();for(var d=0;d<embedVideoItems;d++){document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp("<BR><IMG id=embed_"+d+' src="http://h6img.com/assets/build1/i/videoreplacement.gif"><BR>','i'),embedVideo[d]);document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp("<BR><IMG id=embed_"+d+' src="http://h6img.com/assets/build1/i/videoreplacement.gif">','i'),embedVideo[d]);document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp("<IMG id=embed_"+d+' src="http://h6img.com/assets/build1/i/videoreplacement.gif"><BR>','i'),embedVideo[d]);document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp("<IMG id=embed_"+d+' src="http://h6img.com/assets/build1/i/videoreplacement.gif">','i'),embedVideo[d]);document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp("<BR><IMG id=embed_"+d+' src="//h6img.com/assets/build1/i/videoreplacement.gif"><BR>','i'),embedVideo[d]);document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp("<BR><IMG id=embed_"+d+' src="//h6img.com/assets/build1/i/videoreplacement.gif">','i'),embedVideo[d]);document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp("<IMG id=embed_"+d+' src="//h6img.com/assets/build1/i/videoreplacement.gif"><BR>','i'),embedVideo[d]);document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp("<IMG id=embed_"+d+' src="//h6img.com/assets/build1/i/videoreplacement.gif">','i'),embedVideo[d]);document.getElementById("hdn"+c).value=document.getElementById("hdn"+c).value.replace(new RegExp('<img id="embed_'+d+'" src="//h6img.com/assets/build1/i/videoreplacement.gif">','i'),embedVideo[d])}if(c=="rte1"){addProfileComment()}else{if(c=="rte2"){sendMessage()}else{if(c=="rte3"){if(document.getElementById("hdnrte3").value.length<=0){Alert.show(undefined,"Error","You are not allowed to send an empty message",false);document.getElementById("panel_buttons").className="bg1 alignL";document.getElementById("panel_loading").className="hid"}else{if(document.getElementById("hdnrte3").value.length>65535){Alert.show(undefined,"Error","Your message is too long. 65535 is the max number of characters allowed",false);document.getElementById("panel_buttons").className="bg1 alignL";document.getElementById("panel_loading").className="hid"}else{document.getElementById("message_body").value=document.getElementById("hdnrte3").value;document.reply_message.submit()}}}else{if(c=="rte7"||c=="rte8"||c=="rte9"||c=="rte10"||c=="rte11"||c=="rte12"){if(document.getElementById("hdn"+c).value.length<=0){Alert.show(undefined,"Error","You are not allowed to add an empty comment",false);document.getElementById("panel_buttons").className="bg1 alignL";document.getElementById("panel_loading").className="hid"}else{if(document.getElementById("hdn"+c).value.length>10000){Alert.show(undefined,"Error","Your message is too long. 10000 is the max number of characters allowed",false);document.getElementById("panel_buttons").className="bg1 alignL";document.getElementById("panel_loading").className="hid"}else{if(c=="rte7"){document.getElementById("comment").value=document.getElementById("hdnrte7").value;addPost("adv")}else{if(c=="rte8"){document.getElementById("reply").value=document.getElementById("hdnrte8").value;replyPost("adv")}else{if(c=="rte9"){document.getElementById("comment").value=document.getElementById("hdnrte9").value;addComment("adv")}else{if(c=="rte10"){document.getElementById("reply").value=document.getElementById("hdnrte10").value;replyComment("adv")}else{if(c=="rte11"){document.getElementById("comment").value=document.getElementById("hdnrte11").value;addProfileComment("adv")}else{if(c=="rte12"){document.getElementById("reply").value=document.getElementById("hdnrte12").value;replyProfileComment("adv")}}}}}}}}}}}}}function writeRichText(f){try{if(allRTEs.length>0){allRTEs+=";"}allRTEs+=f.rteID;html="";if(f.rteID=="rte1"){html+='<input type=hidden id=touserid name=touserid value="">';html+='<input type=hidden id=tousername name=tousername value="">';html+='<input type=hidden id=replytouserid name=replytouserid value="">';html+='<input type=hidden id=pid name=pid value="">';html+='<input type=hidden id=gid name=gid value="">';html+='<div style="text-align:left; font:12px Verdana, Arial, sans-serif; padding:0 3px 0 3px; color:#444">Please help us keep this website clean and nonsense free. In that respect please do NOT: thank people for the add, for the point, for the comment, etc. You deserved it! Abusing this simple rule might get your account closed.</div>'}html+="<table id=contain_"+f.rteID+' style="visibility:visible;width:516px;text-align:left" cellspacing="0">';html+="<tr><td>";html+='<table class="toolbar" cellpadding="0" cellspacing="0" id="toolbar1_'+f.rteID+'" width="560px">';html+="<tr>";html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" class="rteImage rteBold" alt="Bold" title="Bold" onmousedown="rteCommand(\''+f.rteID+"', 'bold')\"></td>";html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" class="rteImage rteItalic" alt="Italic" title="Italic" onmousedown="rteCommand(\''+f.rteID+"', 'italic')\"></td>";html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" class="rteImage rteUnderline" alt="Underline" title="Underline" onmousedown="rteCommand(\''+f.rteID+"', 'underline')\"></td>";html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" class="rteImage rteLeft_just" alt="Align Left" title="Align Left" onmousedown="rteCommand(\''+f.rteID+"', 'justifyleft')\"></td>";html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" class="rteImage rteCenter" alt="Center" title="Center" onmousedown="rteCommand(\''+f.rteID+"', 'justifycenter')\"></td>";html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" class="rteImage rteRight_just" alt="Align Right" title="Align Right" onmousedown="rteCommand(\''+f.rteID+"', 'justifyright')\"></td>";if(cmdInsertHTMLEnabled||cmdCreateLinkEnabled){html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" id=hyperLinkButton class="rteImage rteCreatelink" alt="Insert Link" title="Insert Link" onmousedown="dlgInsertLink(\''+f.rteID+"')\"></td>"}if(cmdInsertImageEnabled){html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" id=addImageButton class="rteImage rteInsertimage" alt="Add Image" title="Add Image" onmousedown="addImage(\''+f.rteID+"')\"></td>";html+='<td><img src="http://static.networkpiece.com/c/pixel.gif" id=embedVideoButton class="rteImage rteInsertvideo" alt="Embed Video" title="Embed Video" onmousedown="dlgEmbedVideo(\''+f.rteID+"')\"></td>"}html+='<td width="100%"></td>';html+="</tr>";html+="</table>";html+="</td>";html+="</tr>";html+="</table>";html+='<input type="hidden" id="hdn'+f.rteID+'" name="hdn'+f.rteID+'" value="">';html+='<iframe id="'+f.rteID+'" name="'+f.rteID+'" src="'+includesPath+'blank.htm" frameborder="0" class=rte_textarea></iframe>';if(f.rteID=="rte1"){html+='<div id="panel_buttons" style="position:absolute; left:4px; bottom:6px">';html+='<input type=button class="button_black" onClick="rteSubmit(\''+f.rteID+'\')" value="';if(f.rteID=="rte1"){html+="ADD"}else{html+="SEND"}html+='">&nbsp;';html+='<input type=button class="button_black" onClick="closePanel(';if(f.rteID=="rte1"){html+="'panel1'"}else{if(f.rteID=="rte2"){html+="'panel2'"}}html+=')" value="close">';html+="</div>";html+='<div id="panel_loading" class="hid" style="padding:4px 8px">sending ...</div>'}else{if(f.rteID=="rte3"||f.rteID=="rte4"||f.rteID=="rte7"||f.rteID=="rte8"||f.rteID=="rte9"||f.rteID=="rte10"||f.rteID=="rte11"||f.rteID=="rte12"){if(f.rteID=="rte3"||f.rteID=="rte4"){var h="SEND";var e="sending ..."}else{var h="ADD COMMENT";var e="adding ..."}html+='<div id="panel_buttons" class="alignL" style="width:514px;margin-top:4px"><input type=button class="button_black" onClick="rteSubmit(\''+f.rteID+'\')" value="'+h+'">';if(f.rteID=="rte8"||f.rteID=="rte10"){html+=' <a href="javascript:void(0)" onClick="discardReplay()">Cancel</a>'}html+="</div>";html+='<div id="panel_loading" class="hid" style="width:514px;margin-top:4px">'+e+"</div>"}}appendToBody(f.containerElem,html)}catch(g){if(debugMode){alert(g)}}}function enableDesignMode(n,o){try{if(cssFile.length>0){var j='<style type="text/css">@import url('+cssFile+");</style>\n"}else{var j='<style type="text/css">\n';j+="body {\n";j+="font:12px Verdana, Arial, Helvetica, sans-serif;color:#444;background:#FFF\n";j+="}\n";j+="</style>\n"}var e='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n';e+='<html id="'+n+'" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\n';e+="<head>\n";e+='<meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n';e+='<base href="'+baseUrl+'" />\n';e+=j;e+="</head>\n";e+='<body style="margin: 0; padding: 0;">';e+=o;e+="</body>\n";e+="</html>";var k=document.getElementById(n);try{if(isGecko){k.contentDocument.designMode="on";try{var m=k.contentWindow.document;m.open("text/html","replace");m.write(e);m.close();m.addEventListener("keypress",geckoKeyPress,true)}catch(l){alert("Error preloading content.")}loopCnt=0}else{if(k.contentWindow){try{var m=k.contentWindow.document;m.open("text/html","replace");m.write(e);m.close();if(isIE){m.attachEvent("onkeypress",evt_ie_keypress)}}catch(l){alert("Error preloading content.")}m.designMode="on";loopCnt=0}else{var m=k.document;m.open("text/html","replace");m.write(e);m.close();if(isIE){m.attachEvent("onkeypress",evt_ie_keypress)}m.designMode="on";loopCnt=0}}}catch(l){if(loopCnt<maxLoops){setTimeout("enableDesignMode('"+n+"', '"+o+"');",100);loopCnt+=1}else{alert("Error enabling designMode.")}}}catch(l){if(debugMode){alert(l)}}}function updateRTE(d){try{if(isRichText){setHiddenVal(d)}else{return}}catch(c){if(debugMode){alert(c)}}}function updateRTEs(){try{if(allRTEs!=""){var d=allRTEs.split(";");for(var e=0;e<d.length;e++){updateRTE(d[e])}}}catch(f){if(debugMode){alert(f)}}}function rteCommand(g,h,e){try{var j=document.getElementById(g);if(j.contentWindow){j.contentWindow.focus();j.contentWindow.document.execCommand(h,false,e)}else{j.document.focus();j.document.execCommand(h,false,e)}loopCnt=0;return false}catch(k){if(debugMode){alert(k)}if(loopCnt<maxLoops){setTimeout("rteCommand('"+g+"', '"+h+"', '"+e+"');",100);loopCnt+=1}else{alert("Error executing command.")}}}function dlgColorPalette(e,k){try{setRange(e);var l=document.getElementById(k+"_"+e);var o=findPosX(l,e);var j=findPosY(l,e)+l.offsetHeight;var n=document.getElementById("cp");n.style.left=o+"px";n.style.top=j+"px";if((k==lastCommand)&&(e==currentRTE)){if(n.style.visibility=="hidden"){showHideElement("cp","show")}else{showHideElement("cp","hide")}}else{showHideElement("cp","show")}lastCommand=k;currentRTE=e}catch(m){if(debugMode){alert(m)}}}function dlgInsertLink(d){try{if(cmdInsertHTMLEnabled){setRange(d);currentRTE=d;Alert.show(document.getElementById("hyperLinkButton"),"Insert Hyperlink",'<table cellspacing="4" border="0" style="text-align:center; margin:0 auto"><tr><td><input name="url" type="text" id="url" value="Enter URL" maxlength="250" style="width:340px" onFocus="if(this.value==\'Enter URL\')this.value=\'\'" onBlur="if(this.value==\'\')this.value=\'Enter URL\'"></td></tr><tr><td><input name="linkText" type="text" id="linkText" style="width:340px" value="Enter text" onFocus="if(this.value==\'Enter text\')this.value=\'\'" onBlur="if(this.value==\'\')this.value=\'Enter text\'"></td></tr></table>');document.getElementById("hyperLinkButton").onAlertOk=function(a){if(document.getElementById("url").value.length>3&&document.getElementById("linkText").value.length>0&&document.getElementById("url").value!="Enter URL"&&document.getElementById("linkText").value!="Enter text"){var b='<a href="'+document.getElementById("url").value+'" target="_blank">'+document.getElementById("linkText").value+"</a>&nbsp;";insertHTML(b)}}}else{var e=prompt("Enter URL","http://");rteCommand(d,"createlink",e)}}catch(f){if(debugMode){alert(f)}}}function dlgEmbedVideo(d){try{setRange(d);currentRTE=d;Alert.show(document.getElementById("embedVideoButton"),"Embed Video",'<textarea onkeyup="limitlength(this, 2048)" rows="2" id="vidobject" name="vidobject" style="height:52px;width:340px" onFocus="if(this.value==\'Enter Video Embed Code - Only From Heaven666, Youtube, Vimeo\')this.value=\'\'" onBlur="if(this.value==\'\')this.value=\'Enter Video Embed Code - Only From Heaven666, Youtube, Vimeo\'">Enter Video Embed Code - Only From Heaven666, Youtube, Vimeo</textarea>');document.getElementById("embedVideoButton").onAlertOk=function(g){if(document.getElementById("vidobject").value.length>70){var a=document.getElementById("vidobject").value.toLowerCase();var b=a.indexOf("<iframe");if(b>=0){var e=false;var i=a.indexOf("src=",b);if(i>=0){var f=a.substr(i+4,40);if(f.indexOf("vimeo.com")>=0||f.indexOf("youtube.com")>=0||f.indexOf("youtu.be")>=0||f.indexOf("heaven666.org")>=0){e=true}}if(!e){alert("Error: You can only embed videos from Heaven666, Youtube and Vimeo");return 0}else{if(a.indexOf("<iframe",b+7)>=0){alert("Error: Your embed code doesn't seem valid");return 0}}}embedVideo[embedVideoItems]=document.getElementById("vidobject").value;var h='<br><img id="embed_'+embedVideoItems+'" src="//h6img.com/assets/build1/i/videoreplacement.gif"><br>';embedVideoItems++;insertHTML(h)}}}catch(c){if(debugMode){alert(c)}}};function setColor(e){try{var d=currentRTE;if(isSafari||isIE){if(lastCommand=="hilitecolor"){lastCommand="backcolor"}if(!isSafari){rng.select()}}rteCommand(d,lastCommand,e);showHideElement("cp","hide")}catch(f){if(debugMode){alert(f)}}}function addImage(d){try{Alert.show(document.getElementById("addImageButton"),"Insert Image",'<input type="text" id="imageUrl" name="imageUrl" style="width:340px" value="Enter Image URL" onFocus="if(this.value==\'Enter Image URL\')this.value=\'\'" onBlur="if(this.value==\'\')this.value=\'Enter Image URL\'">',true);document.getElementById("addImageButton").onAlertOk=function(a){if(document.getElementById("imageUrl").value.length>3&&document.getElementById("imageUrl").value!="Enter Image URL"){if(document.getElementById("imageUrl").value.indexOf("photobucket.com")>0){alert("Error: We do not allow images from Photobucket, because they will be restricted quickly due to exceeding bandwith usage");return 0}rteCommand(d,"InsertImage",document.getElementById("imageUrl").value)}}}catch(c){if(debugMode){alert(c)}}};function findPosX(d,e){var f=0;if(d.offsetParent.offsetParent.offsetParent){f=d.offsetLeft;while(d.offsetParent.offsetParent){f+=d.offsetLeft;d=d.offsetParent}}return f}function findPosY(f,e){var d=0;if(f.offsetParent.offsetParent.offsetParent){d=f.offsetTop;while(f.offsetParent.offsetParent){d+=f.offsetTop;f=f.offsetParent}}return d}function selectFont(m,e){try{var h=document.getElementById(e).selectedIndex;if(h!=0){var l=document.getElementById(e).options[h].value;var k=e.replace("_"+m,"");rteCommand(m,k,l);document.getElementById(e).selectedIndex=document.getElementById(e).selectedIndex}}catch(j){if(debugMode){alert(j)}}}function insertHTML(d){try{if(document.all&&!isOpera){rng.pasteHTML(d);rng.collapse(false);rng.select()}else{rteCommand(currentRTE,"inserthtml",d)}}catch(c){if(debugMode){alert(c)}}}function showHideElement(e,f){try{if(document.getElementById(e)){e=document.getElementById(e);if(f=="show"){if(e.id.substring(0,7)=="toolbar"){e.style.display="block"}e.style.visibility="visible"}else{if(f=="hide"){if(e.id.substring(0,7)=="toolbar"){e.style.display="none"}e.style.visibility="hidden"}}}}catch(d){if(debugMode){alert(d)}}}function setRange(f){try{var g=document.getElementById(f);if(g.contentWindow){var e=g.contentWindow.document;g.contentWindow.focus()}else{var e=g.document;e.focus()}if(document.all){sel=e.selection;rng=sel.createRange();selectionText=rng.text.toString()}else{if(window.getSelection){rng=e.createRange();selectionText=e.getSelection()}}}catch(h){if(debugMode){alert(h)}}}function stripHTML(e){try{var d=e.replace(/(<([^>]+)>)/ig,"");d=d.replace(/\r\n/g," ");d=d.replace(/\n/g," ");d=d.replace(/\r/g," ");d=trim(d);return d}catch(f){if(debugMode){alert(f)}}}function trim(c){try{c=c.replace(/^\s+/g,"");return c.replace(/\s+$/g,"")}catch(d){if(debugMode){alert(d)}}}function cleanWordContent(b){b=String(b).replace(/<\\?\?xml[^>]*>/g,"");b=String(b).replace(/<\/?o:p[^>]*>/g,"");b=String(b).replace(/<\/?v:[^>]*>/g,"");b=String(b).replace(/<\/?o:[^>]*>/g,"");return b}function setHiddenVal(e){try{var g=document.getElementById("hdn"+e);if(g.value==null){g.value=""}var f=getHtmlSrc(e);f=cleanWordContent(f);if(stripHTML(f.replace("&nbsp;"," "))==""&&f.toLowerCase().search("<hr")==-1&&f.toLowerCase().search("<img")==-1){f=""}g.value=f}catch(h){if(debugMode){alert(h)}}}function getHtmlSrc(f){try{var g=document.getElementById(f);if(g.contentWindow){var e=g.contentWindow.document}else{var e=g.document}return e.body.innerHTML}catch(h){if(debugMode){alert(h)}}}function setHtmlSrc(m,e){try{var j=document.getElementById(m);if(j.contentWindow){var l=j.contentWindow.document}else{var l=j.document}if(isIE){var h=htmlEncode(e);h=h.replace("%3CP%3E%0D%0A%3CHR%3E","%3CHR%3E");h=h.replace("%3CHR%3E%0D%0A%3C/P%3E","%3CHR%3E");l.body.innerHTML=htmlDecode(h)}else{e=strip160(e);l.body.innerHTML=e}}catch(k){if(debugMode){alert(k)}}}function strip160(b){newString="";for(i=0;i<b.length;i++){if(b.charCodeAt(i)==160){newString=newString+" "}else{newString=newString+b.charAt(i)}}return newString}function htmlEncode(b){return b.replace(/\&/ig,"&amp;").replace(/\</ig,"&lt;").replace(/\>/ig,"&gt;").replace(/\"/ig,"&quot;")}function htmlDecode(b){return b.replace(/\&amp\;/ig,"&").replace(/\&lt\;/ig,"<").replace(/\&gt\;/ig,">").replace(/\&quot\;/ig,'"')}function parse_webkit_version(g){try{var j=g.split(".");var e=(g[g.length-1]=="+");if(e){var k="+"}else{var k=parseInt(j[1]);if(isNaN(k)){k=""}}return{major:parseInt(j[0]),minor:k,is_nightly:e}}catch(h){if(debugMode){alert(h)}}}function get_webkit_version(){try{var e=new RegExp("\\(.*\\) AppleWebKit/(.*) \\((.*)");var h=e.exec(navigator.userAgent);if(h){var f=parse_webkit_version(h[1]);return{major:f.major,minor:f.minor,is_nightly:f.is_nightly}}else{return false}}catch(g){}}function geckoKeyPress(g){try{var k=g.target.id;if(g.ctrlKey){var e=String.fromCharCode(g.charCode).toLowerCase();var j="";switch(e){case"b":j="bold";break;case"i":j="italic";break;case"u":j="underline";break}if(j){rteCommand(k,j);g.preventDefault();g.stopPropagation()}}}catch(h){if(debugMode){alert(h)}}}function evt_ie_keypress(d){try{ieKeyPress(d,rte)}catch(c){if(debugMode){alert(c)}}}function ieKeyPress(g,k){try{var e=(g.which||g.charCode||g.keyCode);var j=String.fromCharCode(e).toLowerCase()}catch(h){if(debugMode){alert(h)}}}function raiseButton(c){try{var d=window.event.srcElement;className=d.className;if(className=="rteImage"||className=="rteImageLowered"){d.className="rteImageRaised"}}catch(c){if(debugMode){alert(c)}}}function normalButton(c){try{var d=window.event.srcElement;className=d.className;if(className=="rteImageRaised"||className=="rteImageLowered"){d.className="rteImage"}}catch(c){if(debugMode){alert(c)}}}function lowerButton(c){try{var d=window.event.srcElement;className=d.className;if(className=="rteImage"||className=="rteImageRaised"){d.className="rteImageLowered"}}catch(c){if(debugMode){alert(c)}}};

