function donothing(){a=1;} function gts(){ var d = new Date(); var n = d.getTime(); return n; } function youtube_parser(url){ var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/; var match = url.match(regExp); if (match&&match[7].length==11){ return match[7]; }else{ return false; } } ids=""; function loadmoreyoutube(ids) { url = '/js/act/get_moreyoutube.php?ids='+ids; jQuery.ajax({ url: url, type: 'GET', data:{}, cache: false, success: function(data) { //called when successful //alert(data.error); //alert(data.thecontent); var tall = document.getElementsByClassName('morelink'); for (var i = 0; i < tall.length; i++) { tall[i].style.display = 'none'; } document.getElementById("thetubes").innerHTML=document.getElementById("thetubes").innerHTML+data.thecontent; }, error: function(e) { //alert("OOO");//called when there is an error } }); //alert("LLL"); } function getyoutubevid() { vidid=document.getElementById('vid_id').value; vid=youtube_parser(vidid); if(vid){document.getElementById('vid_id').value=vid;} } function limitText(limitField, limitCount, limitNum) { limitField=document.getElementById(limitField); limitCount=document.getElementById(limitCount); if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.innerHTML = "You have " + (limitNum - limitField.value.length) + " Characters Left"; } } function getwall(uid) { doc="/js/act/getwall_act.php"; jQuery.ajax({ url: doc, type: 'GET', cache: false, success: function(data) { firstrow=data.firstrow; zuthewall=data.thewall; document.getElementById('recent_wall_post').innerHTML=firstrow; document.getElementById('wall_posts').innerHTML=zuthewall; wid=data.wid; }, error: function(e) { } }); } function clearcompost_blur() { thepost=document.getElementById('comm_post').value; if(thepost=="") { document.getElementById('comm_post').style.backgroundColor="#000000"; document.getElementById('comm_post').style.color="#fff"; document.getElementById('comm_post').value="Message"; } } function clearcompost() { thepost=document.getElementById('comm_post').value; if(thepost=="Message" || thepost=="Please enter your message!"){ document.getElementById('comm_post').style.backgroundColor="#333333"; document.getElementById('comm_post').style.color="#fff"; document.getElementById('comm_post').value=""; } } function clearmsg() { jQuery('#wp_emsg').fadeOut('slow', function() { }); clearTimeout(toprocess); toprocess=0; } var toprocess=""; var cascade=""; function wall_second_row_delay(clive) { currentlive=clive; jQuery('#wall_post_2').fadeOut('fast', function() { jQuery('#wall_post_2').html(currentlive); }); jQuery('#wall_post_2').fadeIn('slow', function() { }); clearTimeout(cascade); } function dothewallpost(uid,userphoto) { thepost=document.getElementById('comm_post').value; if(thepost=="" || thepost=="Message" || thepost=="Please enter your message!"){ document.getElementById('comm_post').style.backgroundColor="yellow"; document.getElementById('comm_post').style.color="red"; document.getElementById('comm_post').value="Please enter your message!"; return false; } document.getElementById("comm_post").style.display="none"; document.getElementById("comm_post_sub").style.display="none"; document.getElementById("wps_progress").style.display="block"; displayname=document.getElementById('userdisplayname').value; doc="/js/act/wallpost_act.php"; jQuery.ajax({ url: doc, type: 'POST', cache: false, data:{uid:uid,thepost:thepost,displayname:displayname,userphoto:userphoto}, success: function(data) { jQuery("#wps_progress").css('display','none'); if(data.error == ""){ firstrow=data.firstrow; if(jQuery('#wall_post_0')){ currentlive=jQuery('#wall_post_0').html(); } jQuery('#recent_wall_post').fadeOut('fast', function() { }); jQuery('#recent_wall_post').html(firstrow); jQuery('#recent_wall_post').fadeIn('fast', function() { jQuery('#recent_wall_post').html(firstrow); }); wid=data.wid if(jQuery('#wall_post_0') && document.getElementById('wall_post_2')!=null){ currentlive=currentlive.replace("Most Recent Post", ""); pos = currentlive.lastIndexOf('0'); currentlive=currentlive.substring(0, pos) + '2' + currentlive.substring(pos + 1); cascade=setTimeout(function(){wall_second_row_delay(currentlive); parameter = null},2000); } jQuery('#wp_emsg').fadeIn('slow', function() { }); jQuery("#comm_post").val('Message'); jQuery('#thechrcount').html('Maximum 230 Characters'); jQuery('#comm_post').css('display','block'); jQuery('#comm_post_sub').css('display','block'); toprocess=setTimeout(clearmsg,5000); } }, error: function(e) { } }); } function gettumblr(offset) { if(typeof offset == 'undefined') {offset = '';} doc="/phpTumblr/test.php"; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{offset:offset}, success: function(data) { document.getElementById('tumblr').innerHTML=data; }, error: function(e) { } }); } var recentwalltimer=0; var recentwalltimeout=20000; var thebeat=0; function update_state() { doc="/cmeter/update_state2.php"; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{loginid:userid,pagename:pagename,username:username,useremail:useremail,userlevel:userlevel,userinvisible:userinvisible}, success: function(data) { }, error: function(e) { } }); } function checkwall(fd) { if(typeof from_delete == 'undefined') {from_delete = '';} doc="/js/act/checkwall.php"; thebeat=thebeat+1; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{loginid:userid,pagename:pagename,username:username,useremail:useremail,userlevel:userlevel,userinvisible:userinvisible,tcount:thecount,twid:wid}, success: function(data) { if(data.bwmessage != "") { if(document.getElementById('bw_announce_user')) { if(data.active=="Y"){ bwmessage="

bateworld Announcement!

"; bwmessage=bwmessage+"
"; bwmessage=bwmessage+data.bwmessage; bwmessage=bwmessage+"
"; bwmessage=bwmessage+"
 
"; jQuery('#bw_announce_user').fadeOut('slow', function() { document.getElementById('bw_announce_user').innerHTML=bwmessage; }); jQuery('#bw_announce_user').fadeIn('slow', function() { }); } if(data.active=="N") { jQuery('#bw_announce_user').fadeOut('slow', function() { }); } } // if div exists } else { if(document.getElementById('bw_announce_user')) { if(data.active=="N"){ jQuery('#bw_announce_user').fadeOut('slow', function() { }); } } } thehits=data.hits; currenthits=document.getElementById("bm-cclicks").innerHTML; if(thehits > currenthits) { caclosetimer = window.setTimeout(stopca, catimeout); document.getElementById("canime").src="/cmeter/meter2.gif"; document.getElementById("bm-cclicks").innerHTML=thehits; } if(thebeat > 1){ //update_state(); } }, error: function(resp, textStatus, errorThrown) { // alert(resp.responseText+" not cool"); } }); } function getwallcontent(doc,container) { jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{wid:wid}, success: function(data) { if(data.wid != wid){ firstrow=data.firstrow; jQuery('#recent_wall_post').fadeOut('slow', function() { document.getElementById('recent_wall_post').innerHTML=firstrow; }); jQuery('#recent_wall_post').fadeIn('slow', function() { }); } // if wid wid=data.wid; wallpost=data.thewall; document.getElementById(container).innerHTML=wallpost; }, error: function(e) { //alert(e); } }); } function getyoutubeform(theurl,thecontainer,thelabel) { if(typeof thelabel == 'undefined') {thelabel = '';} jQuery.ajax({ url: '/js/act/youtube_form.php', type: 'GET', cache: false, success: function(data) { //called when successful document.getElementById(thecontainer).innerHTML=data; document.getElementById('theformname').innerHTML=thelabel; document.getElementById('draggable_forms').style.display="block"; //$('.result').html(data); }, error: function(e) { //called when there is an error } }); } function getxtubeform(theurl,thecontainer,thelabel) { if(typeof thelabel == 'undefined') {thelabel = '';} jQuery.ajax({ url: '/js/act/xtube_form.php', type: 'GET', cache: false, success: function(data) { //called when successful //alert(data); document.getElementById(thecontainer).innerHTML=data; document.getElementById('theformname').innerHTML=thelabel; document.getElementById('draggable_forms').style.display="block"; //$('.result').html(data); }, error: function(e) { //called when there is an error } }); } function gettheform(theurl,thecontainer,thelabel) { if(typeof thelabel == 'undefined') {thelabel = '';} jQuery.ajax({ url: theurl, type: 'GET', cache: false, data:{}, success: function(data) { document.getElementById(thecontainer).innerHTML=data; document.getElementById('draggable_forms').style.display="block"; document.getElementById('theformname').innerHTML=thelabel; }, error: function(e) { } }); } var submitlock=0; function submit_form_item(therow,iid,theurl,rowid, thetable,emsg,enc,mn,mx) { submitlock=1; if(typeof emsg == 'undefined') {emsg = '';} if(typeof mn == 'undefined') {mn = '';} if(typeof mx == 'undefined') {mx = '';} if(typeof enc == 'undefined') {enc = 'Y';} if(typeof therow == 'undefined') {therow = '';} theinput=document.getElementById(iid); input_class=theinput.className; // input's className dtype=input_class; input_id=iid; //input's id patexist=theinput.getAttribute('pattern'); pat=new RegExp(theinput.getAttribute('pattern')); //input's pattern attribute if any req=theinput.getAttribute('required'); // inputs required attribute if any ivalue=theinput.value; ovalue="o_" + iid; ovalue=document.getElementById(ovalue).value; theid=document.getElementById(rowid).value; //if(ivalue==ovalue){return false;} if(input_class.search('text') != -1 || input_class.search('email') != -1 || input_class.search('password') != -1) { if(input_class.search('text') != -1){dtype="text";} if(ivalue=="") { //check to see if it is required and if it is display error message on field and set no go if(req != null) { theinput.style.backgroundColor="pink"; //display_error(iid); } else { theinput.style.backgroundColor="#f7f7f7"; //emf.style.display="none"; update_field(iid,ivalue,theid,ovalue,dtype,req,theurl,thetable,enc); }// req not eq null }//if ivalue blank else { if(ivalue != ovalue){ if(patexist != null) { if(validate_input(pat,ivalue)) { //emf.style.display="none"; theinput.style.backgroundColor="#f7f7f7"; update_field(iid,ivalue,theid,ovalue,dtype,req,theurl,thetable,enc); //no action required } else { theinput.style.backgroundColor="pink"; //display_error(iid); } // if validate } // if pat exists else { //emf.style.display="none"; theinput.style.backgroundColor="#f7f7f7"; update_field(iid,ivalue,theid,ovalue,dtype,req,theurl,thetable,enc); } // if no pat } // if ivalue != ovalue }// if has a value }//end if text //phone numbers us 10 digit with various formats - reformat if valid if(input_class.search('phone') != -1) { if(ivalue=="") { //check to see if it is required and if it is display error message on field and set no go if(req==1) { theinput.style.backgroundColor="pink"; //display_error(iid); } else { //emf.style.display="none"; theinput.style.backgroundColor="#f7f7f7"; //update_field(iid,ivalue,ovalue,dtype,req,theurl,thetable,enc); } } else { if(pat != null) { if(validate_input(pat,ivalue)) { rfvalue=ivalue.replace(pat, "($1) $2-$3"); theinput.value=rfvalue; //emf.style.display="none"; theinput.style.backgroundColor="#f7f7f7"; //update_field(iid,ivalue,ovalue,dtype,req,theurl,thetable,enc); } else { theinput.style.backgroundColor="pink"; //display_error(iid); } // if validate } // if pat exists } // if has value } // end if phone if(input_class.search('zip') != -1) { } if(input_class.search('int') != -1) { } if(input_class.search('radio') != -1) { radin=document.forms[0].elements[iid]; for(var i = 0; i < radin.length; i++) { if(radin[i].checked) { ivalue=radin[i].value; } } if(ovalue != ivalue) { dtype="radio"; //update_field(iid,ivalue,ovalue,dtype,req,theurl,thetable,enc); } }// end radio if(input_class.search('checkbox') != -1) { if(theinput.checked) { } else { ivalue="N"; } dtype="text"; update_field(iid,ivalue,theid,ovalue,dtype,req,theurl,thetable,enc); } } function update_field(field,fvalue,rowid,origvalue,dtype,req,doc,thetable,enc,mn,mx){ if(typeof thetable == 'undefined') { thetable = 'bate_blogs_links';} if(typeof mn == 'undefined') {mn = '';} if(typeof mx == 'undefined') {mx = '';} if(typeof rowid == 'undefined') {rowid = '';} jQuery.ajax({ url: doc, type: 'POST', data:{fieldname:field,fieldvalue:fvalue,rowid:rowid,origvalue:origvalue,dtype:dtype,req:req,thetable:thetable,min:mn,max:mx,ncrypt:enc}, success: function(data) { if(data.error != "") { //display_error_proccess_error(data.error); submitlock=1; } else { jQuery('.ytfeatured').each(function(i, obj) { if(this.id != field) { jQuery('#'+ this.id).attr('checked', false); //lert(this.id); } }); if(thetable=="bate_blogs_links"){ getbatelinks(); ovalue="o_" + field; document.getElementById(ovalue).value=fvalue; } submitlock=0; ovalue="o_" + field; document.getElementById(ovalue).value=fvalue; } }, error: function(resp, textStatus, errorThrown){ // alert(resp.responseText); //this will give you the json page output; } }); } function validate_input(pat,ivalue) { m = pat.exec(ivalue);if(m==null){return false;} else {return true;} } function display_error(iid) { iwidth=document.getElementById(iid).offsetWidth; ileft=document.getElementById(iid).offsetLeft; emf="e_" + iid; emf=document.getElementById(emf); // input's error message containter emf.style.width=(iwidth - 12) + "px"; emf.style.left=ileft + "px"; emf.style.display="block"; document.getElementById(iid).style.backgroundColor='pink'; } function del_batelink(blid){ theid=document.getElementById('id_' + blid).value; doc="/js/act/del_bateblog_links.php"; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{theid:theid}, success: function(data) { if(data.error=="") { document.getElementById('bl_link_cont_' + blid).style.display="none"; getbatelinks(); } }, error: function(e) { } }); } function getbatelinks() { theurl="/js/act/get_bateblog_links.php"; jQuery.ajax({ url: theurl, type: 'GET', cache: false, data:{}, success: function(data) { if(data.error=="") { document.getElementById('bate_blogs').innerHTML=data.thecontent; } }, error: function(e) { } }); } function hidetheform(val) { if(val=="pdp_blog_reader") { jQuery("#br_cont").attr("src","/include/analytics/pages/blank.html"); } document.getElementById(val).style.display="none"; } var minmax="min"; var minmax_left=""; var minmax_top=""; var minmax_height=""; var minmax_width=""; var mimmax_ifheight=""; function min_max_reader() { if(minmax=="min"){ brheight=jQuery(window).height(); brheight=brheight-30; brwidth=jQuery(window).width(); brwidth=(brwidth-40) + "px"; brsc=(brheight-64) + "px"; brmc=(brheight-10)+"px"; minmax_height=jQuery('#pdp_blog_reader').css('height'); minmax_left=jQuery('#pdp_blog_reader').css('left'); minmax_top=jQuery('#pdp_blog_reader').css('top'); minmax_width=jQuery('#pdp_blog_reader').css('width'); mimmax_ifheight=jQuery('#br_cont').css('height'); jQuery('#pdp_blog_reader').css('top','5px'); jQuery('#pdp_blog_reader').css('left','5px'); jQuery('#pdp_blog_reader').css('width',brwidth); jQuery('#br_cont').css('width',brwidth); jQuery('#pdp_blog_reader').css('height',brmc); jQuery('#br_cont').css('height',brsc); jQuery('#br_min_max').css('backgroundPosition', 'left top'); minmax="max"; } else { jQuery('#br_min_max').css('backgroundPosition', 'left bottom'); jQuery('#pdp_blog_reader').css('top',minmax_top); jQuery('#pdp_blog_reader').css('left',minmax_left); jQuery('#pdp_blog_reader').css('width',minmax_width); jQuery('#pdp_blog_reader').css('height',minmax_height); jQuery('#br_cont').css('width',minmax_width); jQuery('#br_cont').css('height',mimmax_ifheight); minmax="min"; } } var onesub=0; function add_batelinks() { if(onesub==0) { onesub=1; thetext=document.getElementById('thetext').value; thelink=document.getElementById('thelink').value; if(thetext==""){document.getElementById('thetext').style.backgroundColor="pink";onesub=0;return false;} document.getElementById('thetext').style.backgroundColor="#f7f7f7"; if(thelink==""){document.getElementById('thelink').style.backgroundColor="pink";onesub=0;return false;} document.getElementById('thelink').style.backgroundColor="#f7f7f7"; pat=new RegExp(document.getElementById('thelink').getAttribute('pattern')); if(validate_input(pat,thelink)) { document.getElementById('thelink').style.backgroundColor="#f7f7f7"; } else { document.getElementById('thelink').style.backgroundColor="pink"; onesub=0; return false; } add_batelinks_act(thetext,thelink); } } function add_batelinks_act(thetext,thelink) { doc="/js/act/insert_blog_link.php"; jQuery.ajax({ url: doc, type: 'POST', data:{thetext:thetext,thelink:thelink}, success: function(data) { if(data.error == "") { gettheform('/js/act/bate_blog_links.php','df_form','Bate Links'); getbatelinks(); onesub=0; } else { onesub=0; } }, error: function(e) { } }); } function edit_wall_post(val) { jQuery('#wmsg_'+val+'').attr('contenteditable','true'); jQuery('#wmsg_'+val+'').css("color","#EDA800"); } function update_wall_post(val) { themsg=jQuery('#wmsg_'+val+'').html(); doc="/js/act/update_wall_post.php"; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{wid:val,thecontent:themsg}, success: function(data) { if(data.error=="") { jQuery('#wmsg_'+val+'').css("color","lightgreen"); } }, error: function(e) { // alert("not cool"); } }); } function del_wall_post(wid,therow) { doc="/js/act/trash_wall_post.php"; thepost="wall_post_" + wid; thepost=document.getElementById(thepost); jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{wid:wid}, success: function(data) { if(data.error=="") { thepost.innerHTML="
DELETED
"; // checkwall('1'); } }, error: function(e) { } }); } var showmore="no"; function getmemberservices() { theurl="/include/analytics/member_services.php"; jQuery.ajax({ url: theurl, datatype:'json', type: 'GET', cache: false, data:{}, success: function(data) { showmore=data.showmore; thehtml=data.theads; if(data.morelink != "") { thehtml=thehtml+data.morelink; } jQuery('#member_services').html(thehtml); jQuery('#userads_tab tbody').html(data.userads); if(data.userads !="") { document.getElementById('userads').style.display='block'; } }, error: function(resp, textStatus, errorThrown){ // alert(resp.responseText); //this will give you the json page output; } }); } function getmemberservices_more(theoffset) { theurl="/include/analytics/member_services_more.php"; jQuery.ajax({ url: theurl, datatype:'json', type: 'GET', cache: false, data:{offset:theoffset}, success: function(data) { showmore=data.showmore; jQuery('#ms_showmore').remove(); currenthtml=jQuery('#member_services').html(); currenthtml=currenthtml+data.theads; morelink=data.morelink; if(data.morelink !="") { currenthtml=currenthtml+morelink; } jQuery('#member_services').html(currenthtml); }, error: function(resp, textStatus, errorThrown){ // alert(resp.responseText); //this will give you the json page output; } }); } function getadholder() { theurl="/js/act/get_ad_holder.php"; jQuery.ajax({ url: theurl, type: 'GET', cache: false, data:{}, success: function(data) { document.getElementById('ad_holder').innerHTML=data; }, error: function(e) { } }); } function getbwblog() { theurl="/js/act/get_bwblog.php"; jQuery.ajax({ url: theurl, type: 'GET', cache: false, data:{}, success: function(data) { document.getElementById('bwblog-pad').innerHTML=data; }, error: function(e) { } }); } function validate_input(pat,ivalue) { m = pat.exec(ivalue);if(m==null){return false;} else {return true;} } function display_error(iid) { document.getElementById(iid).style.backgroundColor='pink'; } function clear_error(iid) { document.getElementById(iid).style.backgroundColor='white'; } function add_youtube() { vidid=document.getElementById('vid_id').value; vidtitle=document.getElementById('vid_title').value; viddesc=document.getElementById('desc').value; vidsort=document.getElementById('thesort').value; pat=new RegExp(document.getElementById('vid_id').getAttribute('pattern')); pat2=new RegExp(document.getElementById('thesort').getAttribute('pattern')); dosub=1; if(!validate_input(pat,vidid)) { display_error('vid_id'); dosub=0; } else { clear_error('vid_id'); } if(!validate_input(pat,vidtitle)) { display_error('vid_title'); dosub=0; } else { clear_error('vid_title'); } if(!validate_input(pat,viddesc)) { display_error('desc'); dosub=0; } else { clear_error('desc'); } if(!validate_input(pat2,vidsort)) { display_error('thesort'); dosub=0; } else { clear_error('thesort'); } vidactive="N"; if(document.getElementById("vid_active").checked) { vidactive="Y"; } if(dosub==0){return false;} else { add_youtube_act(vidid,vidtitle,viddesc,vidsort,vidactive); } } function add_xtube() { vidid=document.getElementById('vid_id').value; vidimg=document.getElementById('imgurl').value; vidsort=document.getElementById('thesort').value; pat=new RegExp(document.getElementById('vid_id').getAttribute('pattern')); pat2=new RegExp(document.getElementById('thesort').getAttribute('pattern')); dosub=1; if(!validate_input(pat,vidid)) { display_error('vid_id'); dosub=0; } else { clear_error('vid_id'); } if(!validate_input(pat,vidimg)) { display_error('imgurl'); dosub=0; } else { clear_error('imgurl'); } if(!validate_input(pat2,vidsort)) { display_error('thesort'); dosub=0; } else { clear_error('thesort'); } vidactive="N"; if(document.getElementById("vid_active").checked) { vidactive="Y"; } if(dosub==0){return false;} else { add_xtube_act(vidid,vidimg,vidsort,vidactive); } } var aytonesub=0; function add_youtube_act(vidid,vidtitle,viddesc,vidsort,vidactive) { if(aytonesub==0){ aytonesub=1; jQuery.ajax({ url: '/js/act/youtube_form_act.php', type: 'POST', data:{vidid:vidid,vidtitle:vidtitle,viddesc:viddesc,vidsort:vidsort,vidactive:vidactive}, success: function(data) { //called when successful document.getElementById('vid_id').value=""; document.getElementById('vid_title').value=""; document.getElementById('desc').value=""; document.getElementById('thesort').value=""; document.getElementById('vid_active').checked=false; aytonesub=0; getyoutubeform('/js/act/youtube_form.php','df_form','Youtube'); //$('.result').html(data); }, error: function(e) { //called when there is an error } }); } } var axtonesub=0; function add_xtube_act(vidid,vidimg,vidsort,vidactive) { if(axtonesub==0){ axtonesub=1; jQuery.ajax({ url: '/js/act/xtube_form_act.php', type: 'POST', data:{vidid:vidid,vidimg:vidimg,vidsort:vidsort,vidactive:vidactive}, success: function(data) { //called when successful //alert(data); document.getElementById('vid_id').value=""; document.getElementById('imgurl').value=""; document.getElementById('thesort').value=""; document.getElementById('vid_active').checked=false; axtonesub=0; //$('.result').html(data); }, error: function(e) { //called when there is an error } }); } } var positionytonce=0; function preview_youtube(row) { if(row==""){vidcont="vid_id"} else {vidcont="vid_id_" + row;} vid=document.getElementById(vidcont).value; if(vid != "") { if(positionytonce==0){ thetube=jQuery('#ytcp_player'); winwidth=jQuery(window).width(); halfwidth=(winwidth/2)-350; if(halfwidth > 0){ jQuery('#ytcp_player').css('left', halfwidth); } positionytonce=1; } ifurl="http://www.youtube.com/embed/" + vid +"?autoplay=1&wmode=transparent"; jQuery("#ytcp_frame").attr("src", ifurl); jQuery('#ytcp_player').css('display','block'); } } function view_youtube(vid) { if(positionytonce==0){ thetube=jQuery('#ytcp_player'); winwidth=jQuery(window).width(); halfwidth=(winwidth/2)-350; if(halfwidth > 0){ jQuery('#ytcp_player').css('left', halfwidth); } positionytonce=1; } ifurl="http://www.youtube.com/embed/" + vid +"?autoplay=1&wmode=transparent"; jQuery("#ytcp_frame").attr("src", ifurl); jQuery('#ytcp_player').css('display','block'); pdp_youtube_stats(vid); } function pdp_youtube_stats(thevidid) { url="/include/analytics/youtube_clicks.php"; jQuery.ajax({ url: url, type: 'GET', data:{thevidid:thevidid}, cache: false, success: function(data) { //alert(data.error); }, error: function(e) { //called when there is an error } }); } function hideyoutube() { document.getElementById("ytframe").src=""; document.getElementById("tube_container").style.display="none"; } function hideyoutube2() { jQuery("#ytcp_frame").attr("src", "http://bateworld.com/blog_reader.php?user=shakenbate&blogentry_id=1546"); jQuery("#ytcp_player").css('display','none'); } function del_youtube(theid,therow) { url="/include/analytics/del_youtube.php"; jQuery.ajax({ url: url, type: 'GET', data:{theid:theid}, cache: false, success: function(data) { ytitem="youtube_info_"+theid; jQuery('#'+ytitem+"").css("display","none"); //called when successful //alert(data.error); }, error: function(e) { //called when there is an error } }); } function getyoutube(url) { if(typeof url == 'undefined') { url = '/js/act/get_youtube.php';} jQuery.ajax({ url: url, type: 'GET', data:{}, async: false, cache: false, success: function(data) { //called when successful //alert(data.error); document.getElementById("thetubes").innerHTML=data.thecontent; }, error: function(e) { //called when there is an error } }); } function getxtube(url) { if(typeof url == 'undefined') { url = '/js/act/get_xtube.php';} jQuery.ajax({ url: url, type: 'GET', data:{}, cache: false, success: function(data) { //called when successful //document.getElementById("xtube_wrap").innerHTML=data.thecontent; }, error: function(e) { //called when there is an error } }); } var fadear=""; function save_announcement() { doc="/js/act/announce_act.php"; if(htmlon != 0) { toggle_html(); } announce=document.getElementById("site_message_text").innerHTML; if(announce.length < 20){deactivate="Y";} else {deactivate="N";} document.getElementById("announce_result").innerHTML="Saving..."; jQuery('#announce_result').fadeIn('slow', function() { }); jQuery.ajax({ url: doc, type: 'POST', data:{announce:announce,uid:userid,deactivate:deactivate}, success: function(data) { //called when successful if(deactivate=="Y"){ document.getElementById("announce_result").innerHTML="Saved, but message deactivated. Less than 20 characters long!"; document.getElementById("activate").checked=false; fadear=setTimeout(clearar,5000); } else { document.getElementById("announce_result").innerHTML="Saved"; } fadear=setTimeout(clearar,2000); }, error: function(e) { //called when there is an error } }); } function clearar() { jQuery('#announce_result').fadeOut('slow', function() { }); clearTimeout(fadear); fadear=0; } function activate_annoucement() { doc="/js/act/activate_annoucement.php"; announce=document.getElementById("site_message_text").innerHTML; autodeactivate=false; if(announce.length < 20){ document.getElementById("activate").checked=false; autodeactivate=true; } if(document.getElementById("activate").checked) { activate="Y"; } else { activate="N"; } jQuery.ajax({ url: doc, type: 'GET', data:{activate:activate}, cache: false, success: function(data) { //called when successful if(data.autodeactivate=="Y"){autodeactivate=true;activate="N";document.getElementById("activate").checked=false;} if(activate=="N") { if(autodeactivate) { document.getElementById("announce_result").innerHTML="Message deactivated. Less than 20 characters long!"; } else { document.getElementById("announce_result").innerHTML="Message deactivated."; } } if(activate=="Y") { document.getElementById("announce_result").innerHTML="Message activated."; } jQuery('#announce_result').fadeIn('slow', function() { }); fadear=setTimeout(clearar,5000); }, error: function(e) { //called when there is an error } }); } function add_url() { str1=prompt("Please insert URL ",""); if(str1 != null && str1 != "") { document.execCommand('createlink', false, str1) bwm_cont = document.getElementById("site_message_text"); bwm_link = bwm_cont.getElementsByTagName("a"); for (var i = 0; i < bwm_link.length; i++) { chref=bwm_link[i].href; if(chref.indexOf(str1) != -1) { bwm_link[i].setAttribute("target","_blank"); } } } else{ if(str1 != null){alert("Please insert a URL!");} } } var htmlon=0; function toggle_html() { if(htmlon==0) { whtml=document.getElementById("site_message_text").innerHTML; document.getElementById("site_message_text").textContent=whtml; htmlon=1; document.getElementById("btn_html").value="Visual"; } else { whtml=document.getElementById("site_message_text").textContent; document.getElementById("site_message_text").innerHTML=whtml; htmlon=0; document.getElementById("btn_html").value="HTML"; } } var killmouseout=0; var profileopen=""; function hl_profile(photo,profilename,uage,uregion,uso,ucs,uhair,puid){ if(killmouseout==0){ if(uso=="Rather Not Say"){uso="Sexual Orientation: ";} else{uso="Sexual Orientation: "+uso+"";} if(uage==""){uage="Age: NL";} else {uage=uage + " Years Old";} profileimage="
"+uage+"
Region: "+uregion+"
"+uso+"
Cock Size: "+ucs+"
Body Hair: "+uhair+"
"; document.getElementById('profile_name').innerHTML=profilename; document.getElementById('rl_profile').innerHTML=profileimage; document.getElementById('mo_profile').style.display="block"; } } function hl_profile2(photo,profilename,uage,uregion,uso,ucs,uhair,puid){ if(uso=="Rather Not Say"){uso="Sexual Orientation: ";} else{uso="Sexual Orientation: "+uso+"";} if(uage==""){uage="NL";} else {uage=uage + " Years Old";} profileimage="
"+uage+"
Region: "+uregion+"
"+uso+"
Cock Size: "+ucs+"
Body Hair: "+uhair+"
";; document.getElementById('profile_name').innerHTML=profilename; document.getElementById('rl_profile').innerHTML=profileimage; document.getElementById('mo_profile').style.display="block"; dokillmouse=1; if(killmouseout==0){dokillmouse=1;} if(killmouseout==1 && profileopen==profilename){dokillmouse=0;} killmouseout=dokillmouse; profileopen=profilename; } function hl_profile_out() { if(killmouseout==0) {document.getElementById('mo_profile').style.display="none";} } function hl_profile_kill() { killmouseout==0; document.getElementById('mo_profile').style.display="none"; } function hl_profile_keep_open() { document.getElementById('mo_profile').style.display="block"; killmouseout=0; } function turnoffkill(){ if(killmouseout==0){ killmouseout=1;document.getElementById('mo_profile').style.display="block"; } else { //killmouseout=0; } } // display the edit url for user member sevices section community page function ed_msad(val){ theefid="uef_"+val; theef=document.getElementById(theefid); if(theef.style.display == "none" || theef.style.display=="") {theef.style.display="table-row";} else{theef.style.display="none";} } // record ad click function update_ct(theadid){ theurl="/include/analytics/update_ct.php"; jQuery.ajax({ url: theurl, datatype:'json', type: 'GET', cache: false, data:{theadid:theadid}, success: function(data) { //do nothing }, error: function(resp, textStatus, errorThrown){ //alert(resp.responseText); do nothing } }); } // user edit url form for community page member services function subuef(val) { adid=val; errorid="aeem_"+adid; inputid="url_"+adid; jQuery('#'+errorid+'').css( "display", "none" ); jQuery('#'+errorid+'').html(" "); theadlink=document.getElementById(inputid).value; if(document.getElementById(inputid).value != "") { var checkurl = RegExp(/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!-\/]))?/); var adlink = jQuery('#'+inputid+'').val(); if (!checkurl.test(adlink) ){ jQuery('#'+errorid+'').fadeIn('slow',function(){ jQuery(this).html('Please provide a valid URL, http://www.example.com !'); jQuery('#'+inputid+'').focus(); });return false; } } else { jQuery('#'+errorid+'').fadeIn('slow',function(){ jQuery(this).html('Please enter a URL for a website or page !'); jQuery('#'+inputid+'').focus(); }); return false; } theurl="/include/analytics/user_update_ad.php"; jQuery.ajax({ url: theurl, datatype:'json', type: 'GET', cache: false, data:{theadid:val,theadlink:theadlink}, success: function(data) { jQuery('#'+errorid+'').fadeIn('slow',function(){ jQuery(this).html('Update Successful !'); jQuery('#'+inputid+'').focus(); }); }, error: function(resp, textStatus, errorThrown){ //alert(resp.responseText); // do nothing } }); } // member services user delete ad with confirm prompt function del_ad(val) { confirmdel=confirm("Please confirm ad deletion"); theadid=val; tre="uef_"+theadid; dad="dad_"+theadid; adcont="display_ad_container_"+theadid; if(confirmdel) { if(jQuery('#'+adcont+'')) { jQuery('#'+adcont+'').fadeOut('fast',function(){ }); } theurl="/include/analytics/user_delete_ad.php"; jQuery.ajax({ url: theurl, datatype:'json', type: 'GET', cache: false, data:{theadid:theadid}, success: function(data) { jQuery('#'+tre+'').fadeOut('fast',function(){ }); jQuery('#'+dad+'').fadeOut('fast',function(){ }); jQuery('#'+tre+'').remove(); jQuery('#'+dad+'').html("Ad deleted."); jQuery('#'+dad+'').fadeIn('fast',function(){ }); // jQuery("#userads_tab tbody").prepend("new row on top"); // alert(data.error+ "cool"); //do nothing }, error: function(resp, textStatus, errorThrown){ //alert(resp.responseText); //do nothing } }); } } var admin_tab="pending"; function ad_admin(theurl,thecontainer,thelabel,admin_tab) { if(typeof thelabel == 'undefined') {thelabel = '';} if(typeof admin_tab == 'undefined') {admin_tab = 'pending';} jQuery.ajax({ url: theurl, datatype:'json', type: 'GET', cache: false, data:{admin_tab:admin_tab}, success: function(data) { if(data.status==""){ //alert(data.theform); jQuery('#theformname').html(thelabel); jQuery('#draggable_forms').css('display','block'); jQuery('#'+thecontainer+'').html(data.theform); } }, error: function(resp, textStatus, errorThrown){ // alert(resp.responseText+" not cool"); } }); } var deladid=""; var delimagename=""; var deluid=""; function ad_admin_del_ad(adid,dimg,duid) { if(jQuery('#theprompt').css('display')=="none" || jQuery('#theprompt').css('display')=="") { thepop=jQuery('#ad_admin_cont_'+adid+''); tposition=thepop.position(); alerttop=tposition.top + 23; jQuery('#theprompt').css('top', alerttop); jQuery('#theprompt').fadeIn('fast',function(){ }); deladid=adid; delimagename=dimg; deluid=duid; } else {jQuery('#del_ad_'+adid+'').attr('checked',false);} } function admin_del_ad() { theurl="/include/analytics/admin_del_ad.php"; adid=deladid;imgname=delimagename;deladid="";delimagename="";uid=deluid;deluid=""; jQuery.ajax({ url: theurl, datatype:'json', type: 'GET', cache: false, data:{adid:adid,imgname:imgname,uid:uid}, success: function(data) { if(data.error =="") { jQuery('#theprompt').fadeOut('fast',function(){ }); jQuery('#ad_admin_cont_'+adid+'').fadeOut('fast',function(){}); } }, error: function(resp, textStatus, errorThrown){ // alert(resp.responseText+" not cool"); } }); } function kill_del_ad_prompt() { jQuery('#theprompt').fadeOut('fast',function(){ }); jQuery('#del_ad_'+deladid+'').attr('checked',false); deladid=""; delimagename=""; deluid=""; } function ad_admin_update_field(fname,frid,thetype,dtype) { if(typeof emsg == 'undefined') {emsg = '';} if(typeof mn == 'undefined') {mn = '';} if(typeof mx == 'undefined') {mx = '';} thefieldname=fname+"_"+frid; theinput=jQuery('#'+thefieldname+''); theregex=theinput.attr('pattern'); //thetype=theinput.get(0).tagName; //thetype=thetype.toLowerCase(); isselect=thetype.indexOf("select"); istext=thetype.indexOf("text"); if(thetype == "select"){ thevalue=theinput.val(); ad_admin_update_field_act(fname,thevalue,dtype,'community_user_ads',frid); } if(thetype == "text"){ if(theregex != 'undefined'){ theregex=RegExp(theregex); thereq=theinput.attr('required'); thevalue=jQuery('#'+thefieldname+'').val(); if(theregex.test(thevalue)) { theinput.css('background-color','#ffffff'); ad_admin_update_field_act(fname,thevalue,dtype,'community_user_ads',frid); } else { theinput.css('background-color','pink'); } } else { theinput.css('background-color','#ffffff'); ad_admin_update_field_act(fname,thevalue,dtype,'community_user_ads',frid) }} } function ad_admin_update_field_act(fn,fv,dtype,tab,frid) { theurl="/include/analytics/admin_update_ad.php"; jQuery.ajax({ url: theurl, type: 'POST', data:{fieldname:fn,fieldvalue:fv,dtype:dtype,thetable:tab,therowid:frid}, success: function(data) { if(data.error =="") { } }, error: function(resp, textStatus, errorThrown){ //alert(resp.responseText+" not cool"); } }); } var brpositiononce=0; function theblogreader(val) { brurl="http://bateworld.com/blog_reader.php?user=shakenbate&blogentry_id=1546"; jQuery('#pdp_blog_reader').css('display','block'); bst=jQuery('html body').scrollTop(); //bst=bst; //bst=bst+"px"; //alert(bst); //jQuery('#pdp_blog_reader').css('top',bst); wh=jQuery(window).height(); brh=jQuery('#pdp_blog_reader').height(); if(brh > wh) { brf=wh-64; brf=brf+"px"; brh=(wh-10)+"px"; jQuery('#pdp_blog_reader').css('height',brh); jQuery('#br_cont').css('height',brf); } jQuery.ajax({ url: brurl, type: 'GET', cache: false, data:{}, success: function(data) { //jQuery('#br_cont').html(data); jQuery("#br_cont").attr("src", "http://bateworld.com/blog_reader.php?user=shakenbate&blogentry_id=1546"); }, error: function(resp, textStatus, errorThrown){ } }); } function pdp_blog_reader() { jQuery('#pdp_blog_reader').css('display','block'); } function get_page(val) { jQuery("#br_cont").attr("src", val); pdp_blog_reader(); } function get_the_form(thedoc,thecontainer,thetitle) { jQuery('#theformname').html(thetitle); jQuery('#'+thecontainer+'').html(''); doc=thedoc; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{}, success: function(data) { jQuery('#'+thecontainer+'').html(data); jQuery('#draggable_forms').css('display','block'); }, error: function(e) { } }); } function check_form_value(fe) { theregex=fe.attr('pattern'); if(theregex != 'undefined') { theregex=RegExp(theregex); thevalue=fe.val(); return theregex.test(thevalue); } return true; } function preview_article(val) { theart="thelink_"+val; theart=jQuery('#'+theart+''); theart=theart.val(); if(theart != ""){ theart=theart.replace('http://bateworld.com/blog.php', 'http://bateworld.com/ask_dr_bate.php'); get_page(theart); } else {alert("Please enter the standard blog url for the article");} } function insert_dr_bate(adb_d,adb_t,adb_l,ac) { doc="/include/analytics/ask_dr_bate_insert.php"; jQuery.ajax({ url: doc, type: 'POST', cache: false, data:{thedesc:adb_d,thetype:adb_t,thelink:adb_l,isactive:ac}, success: function(data) { if(data.error == "") { adb_d=jQuery('#thedescription').val(''); adb_t=jQuery('#thetype').val(''); adb_l=jQuery('#thelink_0').val(''); jQuery('#adb_imsg').css('display','block'); adb_active=jQuery('#active').attr('checked', false); adb_up_after_ins('/include/analytics/ask_dr_bate_up_after_ins.php','update_form'); } else { alert(data.error); } }, error: function(e) { } }); } function add_ask_dr_bate() { jQuery('#adb_imsg').css('display','none'); adb_d=jQuery('#thedescription'); adb_t=jQuery('#thetype'); adb_l=jQuery('#thelink_0'); adb_active=jQuery('#active').is(':checked'); adb_l.css('background-color','white'); adb_t.css('background-color','white'); adb_d.css('background-color','white'); cva=check_form_value(adb_d); if(cva==false){adb_d.css('background-color','pink');} cvb=check_form_value(adb_t); if(cvb==false){adb_t.css('background-color','pink');} cvc=check_form_value(adb_l); if(cvc==false){adb_l.css('background-color','pink');} if(cvc==false || cvb == false || cva == false) { false; } else { thelink=adb_l.val().replace('http://bateworld.com/blog.php', 'http://bateworld.com/ask_dr_bate.php'); if(adb_active){adb_active=1;} else {adb_active=0;} insert_dr_bate(adb_d.val(),adb_t.val(),thelink,adb_active); } } function ask_dr_bate_active(val) { adb_active="active_"+val; adb_active=jQuery('#active_'+val+'').is(':checked'); if(adb_active){adb_active="Y";} else {adb_active="N";} doc="/include/analytics/ask_dr_bate_active.php"; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{isactive:adb_active,theaid:val}, success: function(data) { }, error: function(e) { } }); } function update_dr_bate(adb_d,adb_t,adb_l,val) { doc="/include/analytics/ask_dr_bate_update.php"; jQuery.ajax({ url: doc, type: 'POST', cache: false, data:{thedesc:adb_d,thetype:adb_t,thelink:adb_l,theaid:val}, success: function(data) { if(data.error == "") { jQuery('#adb_imsg_'+val+'').css('display','block'); } else { alert(data.error); } }, error: function(resp, textStatus, errorThrown){ alert(resp); } }); } function ask_dr_bate_update(val) { adb_l="thelink_"+val+""; adb_d="thecontent_"+val+""; adb_t="thetype_"+val+""; adb_d=jQuery('#'+adb_d+''); adb_t=jQuery('#'+adb_t+''); adb_l=jQuery('#'+adb_l+''); cva=adb_d.html(); cvb=adb_t.html(); if(cva==""){cva=false;} else {cva=true;} if(cvb==""){cvb=false;} else {cvb=true;} cvc=check_form_value(adb_l); if(cvc==false || cva == false || cvb == false) { false; } else { thelink=adb_l.val(); update_dr_bate(adb_d.html(),adb_t.html(),thelink,val); } } function adb_menu(val) { jQuery('#update_form').css('display','none'); jQuery('#theform').css('display','none'); jQuery('#adb_help').css('display','none'); jQuery('#adb_a_question').css('display','none'); jQuery('#'+val+'').css('display','block'); } function adb_up_after_ins(thedoc,thecontainer) { jQuery('#'+thecontainer+'').html(''); doc=thedoc; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{}, success: function(data) { jQuery('#'+thecontainer+'').html(data); }, error: function(e) { } }); } var adb_rc=0; function get_ask_dr_bate() { doc="/include/analytics/ask_dr_bate.php"; jQuery.ajax({ url: doc, type: 'GET', cache: false, data:{rc:adb_rc}, success: function(data) { if(data.error == "") { jQuery('#ask_dr_bate_ajax').html(data.adb); } else { } }, error: function(resp, textStatus, errorThrown){ } }); } function ask_bate_question() { doc="/include/analytics/ask_bate_question.php"; var qcontent = jQuery('textarea#adb_question').val(); jQuery('#adb_submsg').css('display','none'); if(qcontent=="") { jQuery('#adb_submsg').html('Please enter your question.'); jQuery('#adb_submsg').css('display','block'); } else { jQuery('textarea#adb_question').css('visibility','hidden'); jQuery('textarea#adb_question').val(''); jQuery('#adb_subut').css('visibility','hidden'); jQuery('#adb_loader').css('display','block'); jQuery.ajax({ url: doc, type: 'POST', cache: false, data:{quid:userid,quname:username,qcontent:qcontent}, success: function(data) { if(data.error == "") { jQuery('#adb_loader').css('display','none'); jQuery('#adb_thankyou').css('display','block'); jQuery('#adb_subut').css('display','none'); } else { jQuery('#adb_loader').css('display','none'); jQuery('textarea#adb_question').css('visibility','visible'); jQuery('#adb_subut').css('visibility','visible'); } }, error: function(resp, textStatus, errorThrown){ jQuery('#adb_loader').css('display','none'); jQuery('textarea#adb_question').css('visibility','visible'); jQuery('#adb_subut').css('visibility','visible'); } }); } } function blogroll_hs(val) { jQuery('#batelinks').css('display', 'none'); jQuery('#blogrecommendations').css('display', 'none'); jQuery('#'+val).css('display', 'block'); } function rec_blogroll() { doc="/include/analytics/rec_blogroll.php"; var blr_url = jQuery('#blogroll_rec').val(); jQuery('#blr_error').html(''); jQuery('#blr_error').css("display", "none"); jQuery('#blr_error').attr('class', "blr-error"); if(blr_url=="") { jQuery('#blr_error').css("display", "block"); jQuery('#blr_error').html('Please enter the url for the blog.'); } else { jQuery.ajax({ url: doc, type: 'POST', cache: false, data:{blr_uid:userid,blr_uname:username,blr_url:blr_url}, success: function(data) { if(data.error == "") { jQuery('#blogroll_rec').val(''); jQuery('#blr_error').attr('class', 'blr-success'); jQuery('#blr_error').css("display", "block"); jQuery('#blr_error').html('Thanks for the blogroll recommendation.'); } else { jQuery('#blr_error').css("display", "block"); jQuery('#blr_error').html('Error: Please try again.'); } }, error: function(resp, textStatus, errorThrown) { jQuery('#blr_error').css("display", "block"); jQuery('#blr_error').html('Error: Please try again.'); } }); } }