Files
Testing/js/community_fix.js
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

1015 lines
27 KiB
JavaScript

function donothing(){a=1;}
function gts(){
var d = new Date();
var n = d.getTime();
return n;
}
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;
},
error: function(e) {
}
});
}
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="";
}
if(thepost=="")
{
document.getElementById('comm_post').style.backgroundColor="#000000";
document.getElementById('comm_post').style.color="#fff";
document.getElementById('comm_post').value="Message";
}
}
function clearmsg()
{
jQuery('#wp_emsg').fadeOut('slow', function() { });
clearTimeout(toprocess);
toprocess=0;
}
var toprocess="";
function wallpost(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) {
document.getElementById("wps_progress").style.display="none";
if(data.error == ""){
document.getElementById("comm_post").value="Message";
jQuery('#wp_emsg').fadeIn('slow', function() {
});
document.getElementById('comm_post').style.display="block";
document.getElementById('comm_post_sub').style.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=10000;
var wid;
var thebeat=0;
function update_state()
{
doc="/cmeter/update_state2.php";
var oXMLHttpRequest = new XMLHttpRequest;
nc=gts();
oXMLHttpRequest.open("GET", doc + "?loginid=" + userid + "&pagename=" + pagename + "&username=" + username + "&useremail=" + useremail + "&userlevel=" + userlevel + "&userinvisible=" + userinvisible + "&nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
//alert(oXMLHttpRequest.responseText);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
if(ct=="application/json")
{
} //if json
} //if done
} // on change
oXMLHttpRequest.send(null);
}
function checkwall()
{
if(typeof uid == 'undefined') {uid = '';}
doc="/js/act/checkwall.php";
thebeat=thebeat+1;
var oXMLHttpRequest = new XMLHttpRequest;
//document.getElementById(container).innerHTML="<div style=\"text-align:center;\">Loading...</div>";
nc=gts();
oXMLHttpRequest.open("GET", doc + "?uid=" + uid + "&nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
//alert(oXMLHttpRequest.responseText);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
if(ct=="application/json")
{
jsonT = eval("("+ oXMLHttpRequest.responseText +")");
thehits=jsonT["hits"];
currenthits=document.getElementById("bm-cclicks").innerHTML;
if(thehits > currenthits)
{
caclosetimer = window.setInterval(stopca, catimeout);
document.getElementById("canime").src="/cmeter/meter2.gif";
document.getElementById("bm-cclicks").innerHTML=thehits;
}
if(jsonT['wid'] != wid){
firstrow=jsonT['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=jsonT['wid'];
if(thebeat > 1){
update_state();
}
} //if json
} //if done
} // on change
oXMLHttpRequest.send(null);
}
function getwallcontent(doc,container)
{
var oXMLHttpRequest = new XMLHttpRequest;
nc=gts();
oXMLHttpRequest.open("GET", doc + "&wid=" + wid + "&nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
//alert(oXMLHttpRequest.responseText);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
if(ct=="application/json")
{
jsonT = eval("("+ oXMLHttpRequest.responseText +")");
if(jsonT['wid'] != wid){
firstrow=jsonT['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=jsonT['wid'];
wallpost=jsonT['thewall'];
document.getElementById(container).innerHTML=wallpost;
} //if json
} //if done
} // on change
oXMLHttpRequest.send(null);
}
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
//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 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 = '';}
nc=gts();
var oXMLHttpRequest = new XMLHttpRequest;
oXMLHttpRequest.open("GET", theurl + "?nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
thecontent=oXMLHttpRequest.responseText;
//alert(thecontent);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
document.getElementById(thecontainer).innerHTML=thecontent;
document.getElementById('draggable_forms').style.display="block";
document.getElementById('theformname').innerHTML=thelabel;
} //if done
} // on change
oXMLHttpRequest.send(null);
}
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: theurl,
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
{
if(thetable=="bate_blogs_links"){
getbatelinks();
ovalue="o_" + field;
document.getElementById(ovalue).value=fvalue;
}
submitlock=0;
ovalue="o_" + field;
document.getElementById(ovalue).value=fvalue;
alert(ovalue);
}
},
error: function(e) {
}
});
}
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";
var oXMLHttpRequest = new XMLHttpRequest;
nc=gts();
oXMLHttpRequest.open("GET", doc + "?theid=" + theid + "&nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
// alert(oXMLHttpRequest.responseText);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
if(ct=="application/json")
{
jsonT = eval("("+ oXMLHttpRequest.responseText +")");
if(jsonT["error"]=="")
{
document.getElementById('bl_link_cont_' + blid).style.display="none";
getbatelinks();
}
} //if json
} //if done
} // on change
oXMLHttpRequest.send(null);
}
function getbatelinks()
{
nc=gts();
theurl="/js/act/get_bateblog_links.php";
var oXMLHttpRequest = new XMLHttpRequest;
oXMLHttpRequest.open("GET", theurl + "?nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
// alert(oXMLHttpRequest.responseText);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
if(ct=="application/json")
{
jsonT = eval("("+ oXMLHttpRequest.responseText +")");
if(jsonT["error"]=="")
{
document.getElementById('bate_blogs').innerHTML=jsonT["thecontent"];
}
} //if json
} //if done
} // on change
oXMLHttpRequest.send(null);
}
function hidetheform(val)
{
document.getElementById(val).style.display="none";
}
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)
{
var oXMLHttpRequest = new XMLHttpRequest;
doc="/js/act/insert_blog_link.php";
nc=gts();
params="thetext=" + thetext + "&thelink=" + thelink;
oXMLHttpRequest.open("POST", doc + "?nc=" + nc + "", true);
oXMLHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
oXMLHttpRequest.setRequestHeader("Content-length", params.length);
oXMLHttpRequest.setRequestHeader("Connection", "close");
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
//alert(oXMLHttpRequest.responseText);
// thearray=oXMLHttpRequest.responseText;
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
if(ct=="application/json")
{
jsonT = eval("("+ oXMLHttpRequest.responseText +")");
if(jsonT["error"] == "")
{
gettheform('/js/act/bate_blog_links.php','df_form','Bate Links');
getbatelinks();
onesub=0;
}
else
{
onesub=0;
}
}//end ct
onesub=0;
} // ready state done
} // readystatechange
oXMLHttpRequest.send(params);
}
function del_wall_post(wid,therow)
{
doc="/js/act/trash_wall_post.php";
nc=gts();
var oXMLHttpRequest = new XMLHttpRequest;
oXMLHttpRequest.open("GET", doc + "?wid=" + wid + "&nc=" + nc + "", true);
thepost="wall_post_" + therow;
thepost=document.getElementById(thepost);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
//alert(oXMLHttpRequest.responseText);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
if(ct=="application/json")
{
jsonT = eval("("+ oXMLHttpRequest.responseText +")");
if(jsonT["error"]=="")
{
//alert(thepost);
thepost.innerHTML="<div style=\"text-align:center;font-weight:bold;color:red;\">DELETED</div>";
}
} //if json
} //if done
} // on change
oXMLHttpRequest.send(null);
}
function getmemberservices()
{
theurl="/js/act/get_member_services.php"
nc=gts();
var oXMLHttpRequest = new XMLHttpRequest;
oXMLHttpRequest.open("GET", theurl + "?nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
thecontent=oXMLHttpRequest.responseText;
// alert(thecontent);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
document.getElementById('member_services').innerHTML=thecontent;
} //if done
} // on change
oXMLHttpRequest.send(null);
}
function getadholder()
{
theurl="/js/act/get_ad_holder.php"
nc=gts();
var oXMLHttpRequest = new XMLHttpRequest;
oXMLHttpRequest.open("GET", theurl + "?nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
thecontent=oXMLHttpRequest.responseText;
//alert(thecontent);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
document.getElementById('ad_holder').innerHTML=thecontent;
} //if done
} // on change
oXMLHttpRequest.send(null);
}
function getbwblog()
{
theurl="/js/act/get_bwblog.php"
nc=gts();
var oXMLHttpRequest = new XMLHttpRequest;
oXMLHttpRequest.open("GET", theurl + "?nc=" + nc + "", true);
oXMLHttpRequest.onreadystatechange = function() {
if (this.readyState == XMLHttpRequest.DONE) {
thecontent=oXMLHttpRequest.responseText;
//alert(thecontent);
var ct=oXMLHttpRequest.getResponseHeader('Content-Type');
document.getElementById('bwblog-pad').innerHTML=thecontent;
} //if done
} // on change
oXMLHttpRequest.send(null);
}
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;
alert(vidid);
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
alert(data.error);
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;
//$('.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);
alert(data.error);
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
}
});
}
}
function preview_youtube(row)
{
document.getElementById("xtframe").src="";
document.getElementById("xtube_container").style.display="none";
if(row==""){
vidcont="vid_id"
}
else
{
vidcont="vid_id_" + row;
}
vid=document.getElementById(vidcont).value;
ifurl="http://www.youtube.com/embed/" + vid +"?autoplay=1&wmode=transparent";
document.getElementById("ytframe").src=ifurl;
document.getElementById("tube_container").style.display="block";
}
function preview_xtube(row)
{
document.getElementById("ytframe").src="";
document.getElementById("tube_container").style.display="none";
if(row==""){
thecode="vid_id"
}
else
{
thecode="vid_id_" + row;
}
thecode=document.getElementById(thecode).value;
thecode="http://bateworld.com/js/act/xtube_iframe.php?bwv=" +thecode+"";
document.getElementById("xtframe").src=thecode;
document.getElementById("xtube_container").style.display="block";
document.getElementById("xtframe").click();
}
function view_youtube(vid)
{
document.getElementById("xtframe").src="";
document.getElementById("xtube_container").style.display="none";
ifurl="http://www.youtube.com/embed/" + vid +"?autoplay=1";
document.getElementById("ytframe").src=ifurl;
document.getElementById("tube_container").style.display="block";
}
function view_xtube(vid)
{
document.getElementById("ytframe").src="";
document.getElementById("tube_container").style.display="none";
ifurl="http://bateworld.com/js/act/xtube_iframe.php?bwv=" +vid+ "";
document.getElementById("xtframe").src=ifurl;
document.getElementById("xtube_container").style.display="block";
}
function hideyoutube()
{
document.getElementById("ytframe").src="";
document.getElementById("tube_container").style.display="none";
}
function hidextube()
{
document.getElementById("xtube_container").style.display="none";
document.getElementById("xtframe").src="";
}
function getyoutube(url)
{
if(typeof url == 'undefined') { url = '/js/act/get_youtube.php';}
jQuery.ajax({
url: url,
type: 'GET',
data:{},
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
}
});
}
jQuery.ajax({
url: doc,
type: 'GET',
cache: false,
data{},
success: function(data) {
},
error: function(e) {
}
});