/* Copyrighted by Rooftop Confessions LLC */ function do_popup(url, name, options, h, w, x, y, scaleType, url_up_down) { var windowOptions; //scaleType='full'; if(scaleType=='full'){ w = screen.availWidth; h = screen.availHeight; x = 0; y = 0; } else{ if (scaleType == 'percent') { w = (w * screen.availWidth) / 100; h = (h * screen.availHeight) / 100; } if (x == 'center') { x = (screen.availWidth - w) / 2; y = (screen.availHeight - h) / 2; } } windowOptions = options + ',width=' + w + ',height=' + h + ',left=' + x + ',top=' + y; newWindow = window.open(url, name, windowOptions); if(url_up_down=='1'){newWindow.focus();} else{newWindow.blur();} } function loadXMLDoc(text){ if(window.DOMParser){ parser=new DOMParser(); xmlDoc=parser.parseFromString(text,"text/xml"); } else if(window.ActiveXObject){ xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async="false"; xmlDoc.loadXML(text); } else{xmlDoc=null;} return(xmlDoc); }; function getHTTPObject(){ if(window.XMLHttpRequest){return new XMLHttpRequest();} else if (window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");} else {return null;} } function pg(m,u,p,cb,cb_args){ var httpObject=null; var value,readyState; httpObject = getHTTPObject(); if(httpObject != null){ if(!p){p=null;} if(m=="g"){ httpObject.open("GET",u); } else if(m="p"){ httpObject.open("POST",u); httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); httpObject.setRequestHeader("Content-length", p.length); httpObject.setRequestHeader("Connection", "close"); } httpObject.send(p); httpObject.onreadystatechange = function(){ readyState=httpObject.readyState; cb_args.push(readyState); if(readyState<4){value="";}else{value=httpObject.responseText;} cb(cb_args,value); } } }; function VoteForgiveCondemn(cb_args,cbv,ue_for,ue_ov,e,n,t,vote){ var dspan,forwhat,dowhat; var m,u,p,ue; var cbv_arr,error; if(!cb_args){ if(trim(e).length==0){e="undef";} if(trim(n).length==0){n="undef";} if(trim(t).length==0){t="undef";} if(trim(vote).length==0){vote="undef";} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; cb_args[2]=e; cb_args[3]=n; cb_args[4]=t; cb_args[5]=vote; if(ue_for=="video"){forwhat="video-confessions";} else if(ue_for=="text"){forwhat="text-confessions";} dowhat="vote_forgive_condemn"; u="/"+forwhat+"/"+e+"/"+n+"/"+t+"/"+dowhat+"/"+vote+"/?req_mode=ajax"; m="g"; p=""; pg(m,u,p,VoteForgiveCondemn,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; e=cb_args[2]; n=cb_args[3]; t=cb_args[4]; vote=cb_args[5]; if(ue_ov){ue=ue_ov;} else{ if(ue_for=="video"){ue="ForgiveCondemnScoreVideo";} else{ue_for="ForgiveCondemnScoreText";} } cbv_arr=cbv.split("::"); error_mesg=cbv_arr[0]; error_code=cbv_arr[1]; cbv=cbv_arr[2]; if(error_mesg!="error_mesg"){ dspan=document.getElementById(ue); dspan.style.display='none'; DisplayForgaveCondemned('','',ue_for,ue,e,'','',''); } else{ window.location=cbv; /*dspan=document.getElementById(ue); dspan.innerHTML = cbv; dspan.style.border="1px solid red"; dspan.style.background="#F9F0E7";*/ /*if(cbv>0){dspan.style.color = "green";} else if(cbv<0){dspan.style.color = "red";} else{dspan.style.color = "grey";}*/ } } } }; function VoteOnComment(cb_args,cbv,ue_for,ue_ov,e,n,t,vote,cid){ var dspan,forwhat,dowhat; var m,u,p,ue; if(!cb_args){ if(trim(e).length==0){e="undef";} if(trim(n).length==0){n="undef";} if(trim(t).length==0){t="undef";} if(trim(vote).length==0){vote="undef";} if(trim(cid).length==0){cid="undef";} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; cb_args[2]=e; cb_args[3]=n; cb_args[4]=t; cb_args[5]=vote; cb_args[6]=cid; if(ue_for=="video"){forwhat="video-confessions";} else if(ue_for=="text"){forwhat="text-confessions";} dowhat="vote_on_comment"; u="/"+forwhat+"/"+e+"/"+n+"/"+t+"/"+dowhat+"/?req_mode=ajax"; m="p"; p="vote="+vote+"&cid="+cid; pg(m,u,p,VoteOnComment,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; e=cb_args[2]; n=cb_args[3]; t=cb_args[4]; vote=cb_args[5]; cid=cb_args[6]; if(ue_ov){ue=ue_ov;} else{ if(ue_for=="video"){ue="CommentScoreVideo_"+cid;} else{ue_for="CommentScoreText_"+cid;} } cbv_arr=cbv.split("::"); error_mesg=cbv_arr[0]; error_code=cbv_arr[1]; if(error_mesg=="error_mesg"){cbv=cbv_arr[2];} if(error_mesg!="error_mesg"){ dspan=document.getElementById(ue); dspan.innerHTML = cbv; posimg_ue='img_pos_score_'+cid; negimg_ue='img_neg_score_'+cid; posimg=document.getElementById(posimg_ue); negimg=document.getElementById(negimg_ue); posimg.src='/images/latest_design/thumbs_up_grey.jpg'; negimg.src='/images/latest_design/thumbs_down_grey.jpg'; posimg.style.cursor=''; negimg.style.cursor=''; posimg.onclick=''; negimg.onclick=''; /* if(cbv>0){dspan.style.color = "green";} else if(cbv<0){dspan.style.color = "red";} else{dspan.style.color = "grey";} */ }else{window.location=cbv;} } } }; function PostComment(cb_args,cbv,ue_for,ue_ov,e,n,t,cid){ var dspan,forwhat,dowhat; var m,u,p,ue; var readyState,comment,comm_element; if(!cb_args){ if(trim(e).length==0){e="undef";} if(trim(n).length==0){n="undef";} if(trim(t).length==0){t="undef";} if(trim(cid).length==0){cid="undef";} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; cb_args[2]=e; cb_args[3]=n; cb_args[4]=t; cb_args[5]=cid; if(ue_for=="video"){forwhat="video-confessions"; comm_element="commentVideo_"+cid;} else if(ue_for=="text"){forwhat="text-confessions"; comm_element="commentText_"+cid;} dowhat="post_comment"; comment=trim(document.getElementById(comm_element).value); if(comment.length==0){alert("Oops. You forgot to comment :)"); return;} u="/"+forwhat+"/"+e+"/"+n+"/"+t+"/"+dowhat+"/?req_mode=ajax"; m="p"; p="cid="+cid+"&comment="+comment; pg(m,u,p,PostComment,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; e=cb_args[2]; n=cb_args[3]; t=cb_args[4]; cid=cb_args[5]; if(ue_ov){ue=ue_ov;} else{ if(ue_for=="video"){ue="PostCommentVideo_"+cid;} else{ue_for="PostCommentText_"+cid;} } cbv_arr=cbv.split("::"); error_mesg=cbv_arr[0]; error_code=cbv_arr[1]; if(error_mesg=="error_mesg"){cbv=cbv_arr[2];} if(error_mesg!="error_mesg"){ dspan=document.getElementById(ue); dspan.innerHTML = cbv; } else{ if(error_code==1){window.location=cbv;} else{alert("Sorry, there was an Error. (Code:"+error_code+")\n\nPlease try again later.");} } } } }; function RateEpisode(cb_args,cbv,ue_for,ue_ov,e,n,t,vote){ var dspan,forwhat,dowhat; var m,u,p,ue; var cbv_arr,error; if(!cb_args){ if(trim(e).length==0){e="undef";} if(trim(n).length==0){n="undef";} if(trim(t).length==0){t="undef";} if(trim(vote).length==0){vote="undef";} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; cb_args[2]=e; cb_args[3]=n; cb_args[4]=t; cb_args[5]=vote; if(ue_for=="video"){forwhat="video-confessions";} else if(ue_for=="text"){forwhat="text-confessions";} dowhat="rate_episode"; u="/"+forwhat+"/"+e+"/"+n+"/"+t+"/"+dowhat+"/?req_mode=ajax"; m="p"; p="vote="+vote; pg(m,u,p,RateEpisode,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; e=cb_args[2]; n=cb_args[3]; t=cb_args[4]; vote=cb_args[5]; if(ue_ov){ue=ue_ov;} else{ if(ue_for=="video"){ue="RateEpisodeVideo";} else{ue_for="RateEpisodeText";} } cbv_arr=cbv.split("::"); error_mesg=cbv_arr[0]; error_code=cbv_arr[1]; if(error_mesg=="error_mesg"){cbv=cbv_arr[2];} if(error_mesg!="error_mesg"){ dspan=document.getElementById(ue); dspan.innerHTML = cbv; } else{ window.location=cbv; } } } }; function DisplayCommentForm(cb_args,cbv,ue_for,ue_ov,e,n,t,cid){ var dspan,forwhat,dowhat; var m,u,p,ue; if(!cb_args){ if(trim(e).length==0){e="undef";} if(trim(n).length==0){n="undef";} if(trim(t).length==0){t="undef";} if(trim(cid).length==0){cid="undef";} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; cb_args[2]=e; cb_args[3]=n; cb_args[4]=t; cb_args[5]=cid; if(ue_for=="video"){forwhat="video-confessions";} else if(ue_for=="text"){forwhat="text-confessions";} dowhat="show_comment_form"; u="/"+forwhat+"/"+e+"/"+n+"/"+t+"/"+dowhat+"/?req_mode=ajax"; m="p"; p="cid="+cid; pg(m,u,p,DisplayCommentForm,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; e=cb_args[2]; n=cb_args[3]; t=cb_args[4]; cid=cb_args[5]; if(ue_ov){ue=ue_ov;} else{ if(ue_for=="video"){ue="PostCommentVideo_"+cid;} else{ue_for="PostCommentText_"+cid;} } dspan=document.getElementById(ue); dspan.innerHTML = cbv; dspan.style.display='block'; } } }; function DisplayForgaveCondemned(cb_args,cbv,ue_for,ue_ov,e,n,t,xargs){ var dspan,forwhat,dowhat; var m,u,p,ue; var div; //Override: Always use this container ue_ov="WhoForgaveCondemnedSection"; if(!cb_args){ if(trim(e).length==0){e="undef";} if(trim(n).length==0){n="undef";} if(trim(t).length==0){t="undef";} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; cb_args[2]=e; cb_args[3]=n; cb_args[4]=t; if(ue_for=="video"){forwhat="video-confessions";} else if(ue_for=="text"){forwhat="text-confessions";} dowhat="who-forgave-condemned"; u="/"+forwhat+"/"+e+"/"+n+"/"+t+"/"+dowhat+"/?req_mode=ajax&ajax_xargs="+xargs; m="g"; p=""; pg(m,u,p,DisplayForgaveCondemned,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; e=cb_args[2]; n=cb_args[3]; t=cb_args[4]; if(ue_ov){ue=ue_ov;} else{ue="ForgaveCondemned";} dspan=document.getElementById(ue); dspan.innerHTML = cbv; } } }; function DisplayEpisodeComments(cb_args,cbv,ue_for,ue_ov,e,n,t,xargs){ var dspan,forwhat,dowhat; var m,u,p,ue; var div; if(!cb_args){ if(trim(e).length==0){e="undef";} if(trim(n).length==0){n="undef";} if(trim(t).length==0){t="undef";} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; cb_args[2]=e; cb_args[3]=n; cb_args[4]=t; if(ue_for=="video"){forwhat="video-confessions";} else if(ue_for=="text"){forwhat="text-confessions";} dowhat="episode_comments"; u="/"+forwhat+"/"+e+"/"+n+"/"+t+"/"+dowhat+"/?req_mode=ajax&ajax_xargs="+xargs; m="g"; p=""; pg(m,u,p,DisplayEpisodeComments,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; e=cb_args[2]; n=cb_args[3]; t=cb_args[4]; if(ue_ov){ue=ue_ov;} else{ue="Comments";} dspan=document.getElementById(ue); dspan.innerHTML = cbv; } } }; function DisplayUserFeed(cb_args,cbv,ue_for,ue_ov,puser,xargs){ var dspan,forwhat,dowhat; var m,u,p,ue; var div; if(!cb_args){ var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; forwhat="members/profile"; dowhat=puser; u="/"+forwhat+"/"+dowhat+"/?req_mode=ajax&ajax_xargs="+xargs; m="g"; p=""; pg(m,u,p,DisplayUserFeed,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; ue=ue_for; if(ue_ov){ue=ue_ov;} else if(ue_for){ue=ue_for;} else{ue="UserFeed";} dspan=document.getElementById(ue); dspan.innerHTML = cbv; } } }; function TextConfessionForm(cb_args,cbv,ue_for,ue_ov){ var dspan,forwhat,dowhat; var m,u,p,ue; var tdiv,rdiv,ldiv; if(!cb_args){ tdiv="Top"; bdiv="Bottom"; ldiv="Left"; rdiv="Right"; tdiv_ptr=document.getElementById(tdiv); bdiv_ptr=document.getElementById(bdiv); rdiv_ptr=document.getElementById(rdiv); ldiv_ptr=document.getElementById(ldiv); if(tdiv_ptr && tdiv!=ue_ov){tdiv_ptr.style.display='none';} if(bdiv_ptr && bdiv!=ue_ov){bdiv_ptr.style.display='none';} if(rdiv_ptr && rdiv!=ue_ov){rdiv_ptr.style.display='none';} if(ldiv_ptr && ldiv!=ue_ov){ldiv_ptr.style.display='none';} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; if(ue_for=="display"){dowhat="display";} else if(ue_for=="process"){dowhat="process";} forwhat="text_confession_form"; u="/"+forwhat+"/"+dowhat+"/?req_mode=ajax"; if(dowhat=="display"){m="g"; p="";} else if(dowhat=="process"){ m="p"; var title=trim(document.getElementById("title").value); var confession=trim(document.getElementById("confession").value); var listing_type=get_radio_button_value('textconfession','listing_type'); if(!listing_type){listing_type="";} //var anonymous_el=document.getElementById("listing_type_anonymous"); //var non_anonymous_el=document.getElementById("listing_type_non_anonymous"); //if(anonymous_el.checked){listing_type=anonymous_el.value;} //else if(non_anonymous_el.checked){listing_type=non_anonymous_el.value;} //else{listing_type="";} p="title="+title+"&confession="+confession+"&listing_type="+listing_type; } pg(m,u,p,TextConfessionForm,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; if(ue_ov){ue=ue_ov;} else{ if(ue_for=="left"){ue="left";} } if(ue_for=="process"){ xmlDoc=loadXMLDoc(cbv); mesgtype_el=xmlDoc.getElementsByTagName("mesgtype")[0]; popalert_el=xmlDoc.getElementsByTagName("popalert")[0]; redirect_el=xmlDoc.getElementsByTagName("redirect")[0]; html_el=xmlDoc.getElementsByTagName("html")[0]; formerror_el=xmlDoc.getElementsByTagName("formerror")[0]; mesgtype_val=mesgtype_el.childNodes[0].nodeValue; popalert_val=popalert_el.childNodes[0].nodeValue; redirect_val=redirect_el.childNodes[0].nodeValue; html_val=html_el.childNodes[0].nodeValue; formerror_val=formerror_el.childNodes[0].nodeValue; if(popalert_val){ var popalert_mesg=popalert_el.getAttribute("mesg"); popalert_mesg=xml_decode(popalert_mesg); alert(popalert_mesg); } if(redirect_val){ var redirect_url=redirect_el.getAttribute("url"); if(redirect_url){window.location=redirect_url; return(1);} } if(html_val){ var html_mesg=html_el.getAttribute('content'); html_mesg=xml_decode(html_mesg); } if(formerror_val){ var error_mesg=formerror_el.getAttribute('error'); var title_login=formerror_el.getAttribute('title_login'); var listing_login=formerror_el.getAttribute('listing_login'); error_mesg=xml_decode(error_mesg); } } else{html_mesg=cbv;} if(html_mesg){ dspan=document.getElementById(ue); dspan.innerHTML = html_mesg; dspan.style.display='block'; } } } }; function EditProfileForm(cb_args,cbv,ue_for,ue_ov){ var dspan,forwhat,dowhat; var m,u,p,ue; var tdiv,rdiv,ldiv; if(!cb_args){ rdiv="right"; var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; dowhat=ue_for; forwhat="edit_myprofile"; u="/"+forwhat+"/"+dowhat+"/?req_mode=ajax"; if(dowhat!="process"){m="g"; p="";} else if(dowhat=="process"){ m="p"; var process_todo=trim(document.getElementById("process_todo_profile").innerHTML); if(process_todo=="bio"){ var bio_text=trim(document.getElementById("bio_text").value); if(!bio_text){alert("Oops :) You did not Write about yourself"); return(1);} p="bio_text="+bio_text; } else if(process_todo=="gender"){ var male_el=document.getElementById("male"); var female_el=document.getElementById("female"); if(male_el.checked){gender=male_el.value;} else if(female_el.checked){gender=female_el.value;} else{alert("Oops :) You did not select your gender"); return(1);} p="gender="+gender; } else if(process_todo=="bday"){ var bday=trim(document.getElementById('bday').value); var bmonth=trim(document.getElementById('bmonth').value); var byear=trim(document.getElementById('byear').value); p="bday="+bday+"&bmonth="+bmonth+"&byear="+byear; } else if(process_todo=="location"){ var country=trim(document.getElementById('country').value); p="country="+country; } else if(process_todo=="image"){ var image=trim(document.getElementById('image').value); if(!image){alert("Oops :) You did not Upload an Image"); return(1);} p="image="+image; } p+="&process_todo="+process_todo; } pg(m,u,p,EditProfileForm,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; if(ue_ov){ue=ue_ov;} else{ if(ue_for=="right"){ue="right";} } if(ue_for=="process"){ xmlDoc=loadXMLDoc(cbv); mesgtype_el=xmlDoc.getElementsByTagName("mesgtype")[0]; popalert_el=xmlDoc.getElementsByTagName("popalert")[0]; redirect_el=xmlDoc.getElementsByTagName("redirect")[0]; html_el=xmlDoc.getElementsByTagName("html")[0]; formerror_el=xmlDoc.getElementsByTagName("formerror")[0]; mesgtype_val=mesgtype_el.childNodes[0].nodeValue; popalert_val=popalert_el.childNodes[0].nodeValue; redirect_val=redirect_el.childNodes[0].nodeValue; html_val=html_el.childNodes[0].nodeValue; formerror_val=formerror_el.childNodes[0].nodeValue; if(popalert_val){ var popalert_mesg=popalert_el.getAttribute("mesg"); popalert_mesg=xml_decode(popalert_mesg); alert(popalert_mesg); } if(redirect_val){ var redirect_url=redirect_el.getAttribute("url"); if(redirect_url){window.location=redirect_url; return(1);} } if(html_val){ var html_mesg=html_el.getAttribute('content'); html_mesg=xml_decode(html_mesg); } if(formerror_val){ var error_mesg=formerror_el.getAttribute('error'); var bio_text=formerror_el.getAttribute('bio_text'); error_mesg=xml_decode(error_mesg); } } else{html_mesg=cbv;} if(html_mesg){ dspan=document.getElementById(ue); dspan.innerHTML = html_mesg; } } } }; function FillStars(cb_args,cbv,ue_for,ue_ov,e,n,t,xargs){ var dspan,forwhat,dowhat; var m,u,p,ue; var cbv_arr,error; if(!cb_args){ if(trim(e).length==0){e="undef";} if(trim(n).length==0){n="undef";} if(trim(t).length==0){t="undef";} var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; cb_args[2]=e; cb_args[3]=n; cb_args[4]=t; if(ue_for=="video"){forwhat="video-confessions";} else if(ue_for=="text"){forwhat="text-confessions";} dowhat="fillstars"; u="/"+forwhat+"/"+e+"/"+n+"/"+t+"/"+dowhat+"/?req_mode=ajax"; m="p"; p="ajax_xargs="+xargs; pg(m,u,p,FillStars,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; e=cb_args[2]; n=cb_args[3]; t=cb_args[4]; if(ue_ov){ue=ue_ov;} else{ if(ue_for=="video"){ue="RateConfessionVideo";} else{ue_for="RateConfessionText";} } dspan=document.getElementById(ue); dspan.innerHTML = cbv; } } }; function UploadFile(ue_for,ue_ov,fn,fn_upb,fn_upb_error,ststdo,ststdo_mesg){ var fn_upb_dspan,fn_dspan; fn_dspan=document.getElementById(fn); fn_upb_dspan=document.getElementById(fn_upb); fn_upb_error_dspan=document.getElementById(fn_upb_error); if(ststdo=="start"){ var image=trim(document.getElementById('submitted_profile_image').value); if(!image){alert("Oops :) You did not Upload an Image"); return(1);} else{ fn_dspan.style.display='none'; fn_upb_dspan.style.display='block'; fn_upb_error_dspan.style.display='none'; fn_dspan.submit(); return true; } } else if(ststdo=="stop" || ststdo=="done"){ if(ststdo_mesg && ststdo=="stop"){ fn_dspan.style.display='block'; fn_upb_dspan.style.display='none'; fn_upb_error_dspan.style.display='block'; fn_upb_error_dspan.innerHTML = ststdo_mesg; fn_upb_error_dspan.style.color = "red"; } else{ fn_dspan.style.display='none'; fn_upb_dspan.style.display='none'; var redirect_url=ststdo_mesg; var popalert_mesg="Profile image has been Updated"; alert(popalert_mesg); window.location=redirect_url; return(1); } } }; function HideCommentForm(ue_for,ue_ov,cid){ var dspan,ue; if(ue_ov){ue=ue_ov;} else if(ue_for=="video"){ue="PostCommentVideo_"+cid;} else{ue_for="PostCommentText_"+cid;} dspan=document.getElementById(ue); dspan.style.display='none'; } function trim(string) { return string.replace(/^\s+|\s+$/g,""); } function xml_decode(string){ if(string){ string.replace(/&/gi,'&'); string.replace(/</gi,'<'); string.replace(/>/gi,'>'); string.replace(/'/gi,'\''); string.replace(/"/gi,'"'); }else{string='';} return(string); }; function SubmitLogin(cb_args,cbv,ue_for,ue_ov){ var dspan,forwhat,dowhat; var m,u,p,ue; var cbv_arr,error; if(!cb_args){ var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; if(ue_for=="login"){dowhat="submit_login"; forwhat="login";} else if(ue_for=="forgot_login"){dowhat="submit_forgot_login"; forwhat="login";} else if(ue_for=="register"){dowhat="submit_register_ajax"; forwhat="register";} u="/"+forwhat+"/"+dowhat+"/?req_mode=ajax"; m="p"; if(ue_for=="login"){ var username=trim(document.getElementById("loginUsername").value); var password=trim(document.getElementById("loginPassword").value); p="username_login="+username+"&password_login="+password; } else if(ue_for=="forgot_login"){ var email=trim(document.getElementById("loginEmail").value); p="user_email="+email; } else if(ue_for=="register"){ var fullname=trim(document.getElementById("regFullname").value); var username=trim(document.getElementById("regUsername").value); var password=trim(document.getElementById("regPassword").value); var email=trim(document.getElementById("regEmail").value); var terms_checked; terms_checked=""; var terms_el=document.getElementById("TermsConditions"); if(terms_el.checked){terms_checked=terms_el.value;} p="fullname="+fullname+"&username="+username+"&password1="+password+"&user_email="+email+"&terms_checkbox="+terms_checked; } pg(m,u,p,SubmitLogin,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; if(ue_ov){ue=ue_ov;} cbv_arr=cbv.split("::"); error_mesg=cbv_arr[0]; error_code=cbv_arr[1]; cbv=cbv_arr[2]; redirect_url=cbv_arr[3]; //if(error_mesg=="error_mesg"){cbv=cbv_arr[2];} if(error_mesg!="error_mesg"){ if(ue_for=="login"){window.location=cbv;} else if(ue_for=="forgot_login"){alert(cbv); window.location=redirect_url; return(1);} else if(ue_for=="register"){alert(cbv); window.location=redirect_url; return(1);} } else{ if(error_code==1){ dspan=document.getElementById(ue); dspan.innerHTML = cbv; } else{alert("Sorry, there was an Error. (Code:"+error_code+")\n\nPlease try again later.");} } } } }; function BasicNextPrev(cb_args,cbv,ue_for,ue_ov,xargs){ var dspan,forwhat,dowhat; var m,u,p,ue; var cbv_arr,error; if(!cb_args){ var cb_args=new Array(); cb_args[0]=ue_for; cb_args[1]=ue_ov; forwhat="basic_next_prev"; dowhat=ue_for; u="/"+forwhat+"/"+dowhat+"/?req_mode=ajax&ajax_xargs="+xargs; m="g"; p=""; pg(m,u,p,BasicNextPrev,cb_args); } else{ readyState=cb_args.pop(); if(readyState<4){} else{ ue_for=cb_args[0]; ue_ov=cb_args[1]; if(ue_ov){ue=ue_ov;} cbv_arr=cbv.split("::"); error_mesg=cbv_arr[0]; error_code=cbv_arr[1]; cbv=cbv_arr[2]; redirect_url=cbv_arr[3]; dspan=document.getElementById(ue); if(error_mesg!="error_mesg"){ dspan.innerHTML = cbv; } else{ if(error_code==1){ dspan.innerHTML = cbv; } else{alert("Sorry, there was an Error. (Code:"+error_code+")\n\nPlease try again later.");} } } } };