// Ryan Gralinski's Bongsoft Main Javascript Loader

var nopoz=0;

function ValidateEmail(addy)
{
	
var eparts=addy.split('@');
	if(eparts.length < 2){return 0;}
	var eeparts=eparts[1].split('.');
	if(eeparts.length <2){return 0;}
	return 1;
}
Array.prototype.remove = function(obj) {
  var a = [];
  for (var i=0; i<this.length; i++) {
    if (this[i] != obj) {
      a.push(this[i]);
    }
  }
  return a;
}
function viewProfile(uid)
{
	window.location.href='/profile.bng?u='+uid;	
}
function highlightClass(objn,classs){
        if(objn != undefined){
                objn.className=classs;
        }
}
function postsignup()
	{
		document.getElementById("postsignup").disabled="true";
//		document.getElementById("postsignup").style.border="solid red 2px";
		document.getElementById("subarch").value="Signup";
		document.getElementById("page").value="postSignup";
		document.getElementById("unauth").value="1";
		//document.getElementById("signupdiv").style.background="#cccc00";
		
		
showup(["subarch","page","unauth","email1","email2","password1","password2","firstname","lastname","displayname","invite","NO_CACHE"],["processdiv"],["POST"]);
	}
shuffle = function(o){ //v1.0
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
};
function switchImage2(imgEl,imgsrc)
{
	imgEl.src=imgsrc;	
}
function switchImage(imgEl,newel)
{
	imgEl.src=newel.src;	
}


function ungrey(ffff)
{
        ffff.style.backgroundImage='';
}
function greyout(ffff)
{

        ffff.style.backgroundImage="url('/bongsoft/images/overlay.gif')";
}
function getHW(){
	
var winW = 630, winH = 460;

 if (navigator.appName=="Netscape") {
 winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
 }

}
var nextz=20000;
var tempX = 0;
var tempY = 0;
document.onmousemove = getMouseXY;
function checkPassinput2(e)
{
	    var keynum   

        //alert(e.type); 
        if(window.event) // IE
        {
        keynum = e.keyCode
        }
        else if(e.which) // Netscape/Firefox/Opera
        {
        keynum = e.which
        }
        if(keynum ==13){
               // TheForm.submit();
			Authenticate2();
			
        }

	
}
function checkPassinput(e)
{
	    var keynum   

        //alert(e.type); 
        if(window.event) // IE
        {
        keynum = e.keyCode
        }
        else if(e.which) // Netscape/Firefox/Opera
        {
        keynum = e.which
        }
        if(keynum ==13){
               // TheForm.submit();
			Authenticate();
			
        }

	
}
function getScroll(){
var myy=0; 
if(window.pageYOffset) {
myy = window.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop){myy=document.documentElement.scrollTop;}else if(document.body){myy=document.body.scrollTop;}return myy;}
function getMouseXY(e) {
 

 
  if (navigator.appName !='Netscape') {
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }
//  alert(tempX+'-'+tempY);

  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}

  return true
} 




function Goto(myarg)
{
	document.location.href=myarg;	
}
function hideflash()
{
	var e = document.getElementsByTagName("object");
	for(var i=0;i<e.length;i++)
	{
		e[i].style.display='none';
	}
	var e = document.getElementsByTagName("embed");
	for(var i=0;i<e.length;i++)
	{
		e[i].style.display='none';
	}
	
}
function showflash()
{
	var e = document.getElementsByTagName("object");
	for(var i=0;i<e.length;i++)
	{
		e[i].style.display='block';
	}
	var e = document.getElementsByTagName("embed");
	for(var i=0;i<e.length;i++)
	{
		e[i].style.display='block';
	}


}

function modall(myarg)
{

	var newdiv;
	if(document.getElementById('modaldiv')) 
	{
		newdiv=document.getElementById('modaldiv');	
	}else{
	
    	newdiv=document.createElement("DIV");
		newdiv.id='modaldiv';	
		document.body.appendChild(newdiv);
	}
   	
	newdiv.style.left=0;
    newdiv.style.top=getScroll();
    newdiv.style.height='100%';
    newdiv.style.width='100%';
    newdiv.style.background='url(/bongsoft/images/overlay.gif)';
    newdiv.style.zIndex=500;
    newdiv.style.position='Absolute';
    if(myarg ==0){ 
		newdiv.style.visibility='hidden';
        newdiv.style.display='none';
    showflash();
		}else{
        newdiv.style.visibility='visible';
        newdiv.style.display='inline';
	hideflash();	
	}
}

function S4() {
  return (((1+Math.random())*0x10000)|0).toString(16).substring(1) }
function GUID()
{
	return (S4()+"-" +S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()).toUpperCase() 
}

function makediv(Left,Top,Width,Height,showclose)
{
	var newguid = GUID();
	var newdiv=document.createElement("DIV");
	newdiv.id=newguid;
	newdiv.style.width=Width;
	newdiv.style.height=Height;
	newdiv.style.left=Left;
	newdiv.style.top=Top;
	newdiv.style.background='red';
	newdiv.style.display='inline';
	newdiv.style.zIndex=20000;
	newdiv.style.visibility='visible';
	newdiv.style.position='Absolute';
	newdiv.style.border='solid black 1px';
//	if(showclose){newdiv.innerHTML="<a href=closediv>Close</a>";}

document.body.appendChild(newdiv);
	return newguid;
	
}
var confirmreturn=-1;
function cancelAlert()
{
		showflash();
		confirmreturn=0;
		new Effect.Fade('alertdiv');
		modall(0);

	
}	
function confirmAlert()
{
	showflash();
	confirmreturn=1;
	new Effect.Fade('alertdiv');
	modall(0);
}
function gotoalbums(uid)
{
	document.location.href="http://fl.bong.net/cgi-bin/pictures.fl?u="+uid;
}
var cmod=0;
function showLogin2()
{
//	document.getElementById('divLoginReq').innerHTML=document.getElementById('divMiniLogin').innerHTML;
	document.getElementById('divMiniLogin').style.display='inline';
	document.getElementById('divMiniLogin').style.visibility='visible';
	document.getElementById('divMiniLogin').style.position='absolute';
	document.getElementById('divMiniLogin').style.background='#99cc00';
	document.getElementById('divMiniLogin').style.border='solid white 1px';
	document.getElementById('divMiniLogin').style.left='-550';
	document.getElementById('divMiniLogin').style.top='+165';
	
	
}
function showLogin()
{
	new TagToTip('divMiniLogin',STICKY,true,DELAY,0,CLOSEBTN,true,TITLE,"Login here");	
}
function centeredmodalert(v1,v2,v3,v4,v5)
{
	cmod=1;
	modalertShow(v1,v2,v3,v4,v5);
}
function modalert(v1,v2,v3,v4,v5)
{
	cmod=0;
	modalertShow(v1,v2,v3,v4,v5);
}
function modalertShow(string,modal,cancel,confirmfunction,cancelfunction)
{
	confirmreturn=-1;
	var cancelbut='';

if(modal == 1){modall(1);}

if(cancel == 1){cancelbut='<input onClick="'+cancelfunction+'" type="button" id="cancelbutton" name="cancelbutton" value="Cancel!" />';}
	
	
	if(!document.getElementById('alertdiv'))
	{
		var newdiv = document.createElement("DIV");
		newdiv.style.height=75;
		newdiv.style.width=300;
//		newdiv.style.background='url("/bongsoft/images/alertbg1.gif")';
//		newdiv.style.border='solid black 2px';
		newdiv.style.position='absolute';
		if(cmod == 0){
		newdiv.style.left=tempX-150;
		newdiv.style.top=tempY;
		}else{
			
			newdiv.style.left='50%';
			newdiv.style.top=250+getScroll();
			newdiv.style.marginLeft=-150;

}
		
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='20000000';		
		newdiv.id='alertdiv';
		newdiv.name='alertdiv';
		newdiv.style.display='none';
		document.body.appendChild(newdiv);
		//new Draggable('alertdiv');	
		
	}else{
		var newdiv=document.getElementById('alertdiv');}
		
if(cmod == 0){
		newdiv.style.left=tempX-150;
		newdiv.style.top=tempY;
		}else{
			
			newdiv.style.left='50%';
			newdiv.style.top=250+getScroll();
			newdiv.style.marginLeft=-150;

}
	newdiv.innerHTML='	<table class="alerttable" width="300" cellpadding="0" cellspacing="0" align="center">	<TR><TD style="background:url(\'/bongsoft/images/modalert/roundtop.gif\');height:13px;"></TD></TR><TR><TD style="padding-left:10px; padding-right:10px;background:#FF6600;border-left:solid black 1px;border-right:solid black 1px;height:50px" valign="top">'+string+'</TD></TR><TR><TD style="padding-left:10px; padding-bottom:8px;padding-right:10px;background:#FF6600;border-left:solid black 1px;border-right:solid black 1px;height:50px" valign="bottom"><input onClick="'+confirmfunction+'" type="button" id="alertbutton" name="alertbutton" value="OK" />'+cancelbut+'</TD></TR><TR><TD style="background:url(\'/bongsoft/images/modalert/roundbottom.gif\');height:13px;"></TD></TR></table>';
	
//<TR><TD height="50" valign="top">'+string+'</TD></TR><TR><TD valign="bottom" align="center">		<input onClick="'+confirmfunction+'" type="button" id="alertbutton" name="alertbutton" value="OK" />	&nbsp;'+cancelbut+'</TD></TR>		</table>';
	setTimeout("new Effect.Appear('alertdiv');",100);
	
}
function oset(obj)
{
	//obj.style.border='outset 1px;';	
	obj.style.borderLeft='solid white 1px';
	obj.style.borderTop='solid white 1px';
	obj.style.borderBottom='solid black 1px';
	obj.style.borderRight='solid black 1px';
}
function iset(obj)
{
//	obj.style.border='inset 1px;';	
	obj.style.borderLeft='solid black 1px';
	obj.style.borderTop='solid black 1px';
	obj.style.borderBottom='solid white 1px';
	obj.style.borderRight='solid white 1px';

}
function confirmAddFriend(id1,id2)
{
	var alertdiv=document.getElementById('alertdiv');
	alertdiv.innerHTML='<img src="/bongsoft/images/loadingbar1.gif" /><br><DIV style="display:inline" ID="friendstatus"></div>';
	
	//alert('Adding friend');
	document.getElementById('subarch').value='friends';
	document.getElementById('page').value='addfriend';
	document.getElementById('unauth').value='0';
	document.getElementById('xargs').value=id1+','+id2;
		
	showup(['page','subarch','unauth','xargs','NO_CACHE'],['friendstatus']);
	
	
}
function sendmessage(uid)
{
	Goto('Messaging.bng?f=Compose&ui='+uid);
//	modalert('Messages are not working yet, try leaving a comment. ',1,0,'confirmAlert()');	
}
function addtofriends(ui)
{
	
	if(userid >0){
		if(arefriends > 0){
			modalert('You are already my friend!',1,0,'confirmAlert()');
		}
		else
		{
			modalert('Are you sure you want to add this person to your friends?',1,1,'confirmAddFriend(thisid,userid)','cancelAlert()');								
			
		}
	}else{
		modalert('You must be Logged in to add friends!',1,0,'confirmAlert()');
	}
}
function closeViewImg()
{document.body.removeChild(document.getElementById('divViewImg'));}

function hide_image()
{closeViewImg();}


function click_image(myel,bg,opheight,opnobreak)
{
		if(opheight == undefined){opheight=300;}
		
		if(!document.getElementById('divViewImg'))
		{
		var newdiv = document.createElement("DIV");
		newdiv.style.height=opheight;
		newdiv.style.width=400;
		
		
	newdiv.style.border='none';
		newdiv.style.position='absolute';
		
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='11000';		
		newdiv.id='divViewImg';
		newdiv.name='divViewImg';
		newdiv.style.display='none';
		document.body.appendChild(newdiv);
		}//
		else{var newdiv=document.getElementById('divViewImg');}
		newdiv.style.background="black";
		newdiv.style.background="url('/bongsoft/images/"+bg+"')";
		newdiv.style.left='50%';
		newdiv.style.top=tempY+15;////
		newdiv.style.marginLeft=-300;//
			
//		newdiv.style.left=tempX;
//		newdiv.style.top=tempY+10;
	var abortlink='<a href="javascript:closeViewImg();">Abort</a>';
	document.getElementById('divViewImg').innerHTML='<BR><BR><BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;<img src="/bongsoft/images/loading9.gif" width="30" />  <font color="white"> Loading..</font>' + abortlink;

	document.getElementById('divViewImg').style.display='inline';
	document.getElementById('subarch_2').value='Media';	
	document.getElementById('page_2').value='viewimg';
	document.getElementById('unauth_2').value='1';
	document.getElementById('xargs_2').value=myel.src;
	document.getElementById('xargs2').value=bg;
	if(opnobreak == undefined){opnobreak = 0;}
	document.getElementById('xargs3').value=opnobreak;
		document.getElementById('xargs4').value=opheight;
	showup(['page_2','subarch_2','xargs2','xargs3','xargs4','unauth_2','xargs_2','NO_CACHE'],['divViewImg']);	
}
function trylater()
{
	centeredmodalert("Try this later!",1,0,'confirmAlert()','confirmAlert()');		
}




function _hide_load()
{
		modall(0);
		var mdiv=document.getElementById('loadingdiv');
		if(mdiv != undefined){
			document.body.removeChild(mdiv);	
		}
}

function _load()
{
		modall(1);
		var newdiv = document.createElement("DIV");
		newdiv.style.height=142;
		newdiv.style.width=214;
		newdiv.style.background='url("/bongsoft/images/loadinghuge2.gif")';
//		newdiv.style.border='solid black 2px';
		newdiv.style.position='absolute';
			newdiv.style.left='50%';
			newdiv.style.top=250+getScroll();
			newdiv.style.marginLeft=-107;

		
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='20000000';		
		newdiv.id='loadingdiv';
		newdiv.name='loadingdiv';
		newdiv.style.display='none';
		document.body.appendChild(newdiv);
		newdiv.style.left='50%';
		newdiv.style.top=250+getScroll();
		newdiv.style.marginLeft=-107;


	newdiv.innerHTML='&nbsp;';
	setTimeout("new Effect.Appear('loadingdiv');",100);
	
	
	
}


function hide_load()
{
		modall(0);
		var mdiv=document.getElementById('loadingdiv');
		if(mdiv != undefined){
			document.body.removeChild(mdiv);	
		}
}

function load_main()
{
		modall(1);
		var newdiv = document.createElement("DIV");
		newdiv.style.height=142;
		newdiv.style.width=214;
		newdiv.style.background='url("/bongsoft/images/loadinghuge.gif")';
//		newdiv.style.border='solid black 2px';
		newdiv.style.position='absolute';
			newdiv.style.left='50%';
			newdiv.style.top=250+getScroll();
			newdiv.style.marginLeft=-107;

		
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='20000000';		
		newdiv.id='loadingdiv';
		newdiv.name='loadingdiv';
		newdiv.style.display='none';
		document.body.appendChild(newdiv);
		newdiv.style.left='50%';
		newdiv.style.top=250+getScroll();
		newdiv.style.marginLeft=-107;


	newdiv.innerHTML='&nbsp;';
	setTimeout("new Effect.Appear('loadingdiv');",100);
	
	
	
}// JavaScript Document

var _LoginRedirect='/profileU.bng';

function SignOut()
{


	document.getElementById('page').value='Logoff';
	document.getElementById('subarch').value='Login';
	document.getElementById('unauth').value=1;
	document.getElementById('loginstatustext').innerHTML='Logging out';
	document.getElementById('loginstatusicon').src='/bongsoft/images/spinningrim.gif';
//	document.getElementById('MiniLoginTable').id='MiniLoginLoggingIn';
//	document.getElementById('MiniLoginTable').style.className='MiniLoginLoggingIn';
	
//	document.getElementById('loginEmail').disabled=true;
//	document.getElementById('loginPassword').style.className='DisabledInput';
//	document.getElementById('xargs3').value='fuck';
	
	showup(['page','subarch','unauth','loginEmail','NO_CACHE'],['processdiv'],['POST']);
	

	
}
function Authenticate2()
{
	document.getElementById('loginEmail').value=document.getElementById('loginEmail2').value;
	document.getElementById('loginPassword').value=document.getElementById('loginPassword2').value;
	Authenticate();
	return 1;	
}
function Authenticate()
{
	
//	alert('Authenticating');
	
	document.getElementById('page').value='Authenticate';
	document.getElementById('subarch').value='Login';
	document.getElementById('unauth').value=1;
	document.getElementById('xargs3').value=_LoginRedirect;
	document.getElementById('loginstatustext').innerHTML='Logging in...';
	document.getElementById('loginstatusicon').src='/bongsoft/images/spinningrim.gif';
//	document.getElementById('MiniLoginTable').id='MiniLoginLoggingIn';
//	document.getElementById('MiniLoginTable').style.className='MiniLoginLoggingIn';
	
//	document.getElementById('loginEmail').disabled=true;
//	document.getElementById('loginPassword').style.className='DisabledInput';
	
	showup(['xargs3','page','subarch','unauth','loginEmail','loginPassword','NO_CACHE'],['processdiv'],['POST']);
	
	return 1;	
}// JavaScript Document
function saveNickname()
{
	
	
	document.getElementById('subarch').value='node';	
	document.getElementById('page').value='getNick';
	document.getElementById('unauth').value='1';
	document.getElementById('xargs2').value=1;
	document.getElementById('xargs').value=selectedavatar;
	document.getElementById('xargs3').value=rememberme;
	showup(['xargs3','xargs2','txtnickname','page','subarch','xargs','unauth','NO_CACHE'],['processdiv']);
	//closeFolderDesc();
	
	
}
var maxavatars=-1;
var myavatar = -1;
var avatars = new Array(100);
var selectedavatar = -1;
var origavatar=-1;

function scrollSlot(arg)
{

	var diff=arg-3;
	var newav=selectedavatar+diff;
	if(arg == 1){
		scrollAvatar(avatars,-1);
		setTimeout("scrollAvatar(avatars,-1);",100);
	}
	if(arg == 2){
		scrollAvatar(avatars,-1);
	}
	if(arg == 5){
		scrollAvatar(avatars,-2);
		setTimeout("scrollAvatar(avatars,-2);",100);
	}
	if(arg == 4){
		scrollAvatar(avatars,-2);
	}



}
function randomAvatar()
{
	for(x=0;x<150;x++)
	{
		setTimeout("randomAvatar2();",10*x);	
	}
}
function clearav()
{

	
}
function randomAvatar2()
{

	myavatar=-1;
	selectedavatar=-1;
	origavatar=-1;
	var sn = 0;	
	sn = Math.floor(Math.random()*maxavatars);
	scrollAvatar(avatars,sn);


}

function scrollAvatar(avarray,myav)
{
//	alert(myav);
	if(myav == -2 && selectedavatar < maxavatars-1){selectedavatar++;}
	if(myav==-1 && selectedavatar >0){selectedavatar--;}
	
	var slot1=document.getElementById('slot1');
	var slot2=document.getElementById('slot2');
	var slot3=document.getElementById('slot3');
	var slot4=document.getElementById('slot4');
	var slot5=document.getElementById('slot5');


	if(myavatar == -1){
		myavatar=myav; selectedavatar=myav;origavatar=myav
		}

if(selectedavatar >= 0)
	{
		if(selectedavatar <2){
			slot1.src='/bongsoft/images/avatars/blank.gif';
			slot1.style.cursor='default';
		}else
		{
			slot1.style.cursor='pointer';
			slot1.src=avatars[selectedavatar-2].src;

		}
//		alert(selectedavatar);
		if(selectedavatar <1){
			slot2.src='/bongsoft/images/avatars/blank.gif';
			slot2.style.cursor='default';
		}
		else{
			slot2.style.cursor='pointer';
			slot2.src=avatars[selectedavatar-1].src;
		}
	}
	
	slot3.src=avarray[selectedavatar].src;
	if(selectedavatar < maxavatars)
	{
		if(selectedavatar < maxavatars-2)
		{
			slot5.style.cursor='pointer';
			slot5.src=avarray[selectedavatar+2].src;	
		}
		else
		{
			slot5.style.cursor='default';
			slot5.src='/bongsoft/images/avatars/blank.gif';
		}
		if(selectedavatar < maxavatars-1)
		{
			slot4.style.cursor='pointer';
			slot4.src=avarray[selectedavatar+1].src;				
			
		}
		else{
			slot4.style.cursor='default';
			slot4.src='/bongsoft/images/avatars/blank.gif';

		}
		
	}


	//alert(avarray[selectedavatar]);
	
	return 1;	
}
var rememberme=1;
function setremember(arg)
{
	if(arg == 1)
	{
		rememberme=0;
		toggleRemember();
	}
	else{
		rememberme=1;
		toggleRemember();
	}
}
function toggleRemember()
{
	var myi=document.getElementById('checkboxa');
	if(rememberme == 1)
	{
		switchImage(myi,checkbox2);	
		rememberme = 0;
	}
	else{
			switchImage(myi,checkbox1);	
			rememberme=1;
	}
}
var checkbox1=new Image();
checkbox1.src="bongsoft/images/checkbox1.gif";
var checkbox2=new Image();
checkbox2.src="bongsoft/images/checkbox2.gif";

var save1=new Image();
save1.src="bongsoft/images/save3.gif";
var save2=new Image();
save2.src="bongsoft/images/save4.gif";
function GetNickname()
{
	
	modall(1);

	
	if(!document.getElementById('divGetNick'))
	{
		var newdiv = document.createElement("DIV");
		newdiv.style.height=400;
		newdiv.style.width=500;
		newdiv.style.background='url("/bongsoft/images/getnickback2.gif")';
		//newdiv.style.border='solid white 1px';
		newdiv.style.position='absolute';
		newdiv.style.left='50%';
		newdiv.style.top=70+getScroll();
		newdiv.style.marginLeft=-250;
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='11000';		
		newdiv.id='divGetNick';
		newdiv.name='divGetNick';
		newdiv.style.display='none';
		
		document.body.appendChild(newdiv);
		//new Draggable('divGetNick');	
		
		
	}	
	var abortlink='<a href="javascript:closeGetNick();">Abort</a>';
	document.getElementById('divGetNick').innerHTML='<BR><BR><BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;<img src="/bongsoft/images/loadingtiny.gif" />  <font color="white"> Loading..</font>' + abortlink;
	//setTimeout("new Effect.Appear('divGetNick');",100);
	document.getElementById('divGetNick').style.display='inline';
	document.getElementById('subarch_2').value='node';	
	document.getElementById('page_2').value='getNick';
	document.getElementById('unauth_2').value='1';

showup(['page_2','subarch_2','unauth_2','NO_CACHE'],['divGetNick']);
	

	
}
function closegn2()
{
	document.body.removeChild(document.getElementById('divGetNick'));
	
}
function closeGetNick()
{
	myavatar=-1;
	//new Effect.BlindUp('divGetNick');
	closegn2();
//	setTimeout("closegn2()",1000);
modall(0);
		
}
function docknodeinfo(node)
{
	var ddiv = document.getElementById('nodeinfodiv'+node);
	ddiv.style.height=400;

}
dockednodes = new Array(25);
function hide_popup_who_1(element,node)
{
		//alert(node);
		element.className='';
	document.body.removeChild(document.getElementById('nodeinfodiv'+node));	
}
function highlightnode(element)
{
	element.className='highlightednode';
	
}
function show_popup_who_1(element,node)
{
	highlightnode(element);
	if(!document.getElementById('nodeinfodiv'+node)){
		
	var newdiv=document.createElement("DIV");
	newdiv.id='nodeinfodiv'+node;
	newdiv.innerHTML='Click to Send an instant message';
	newdiv.style.zIndex=15000;

	document.body.appendChild(newdiv);		
	
	document.getElementById('nodeinfodiv'+node).style.height='40px';
	document.getElementById('nodeinfodiv'+node).style.width='200px';
	document.getElementById('nodeinfodiv'+node).style.left=tempX + 20;
	document.getElementById('nodeinfodiv'+node).style.top=tempY + 20;
	document.getElementById('nodeinfodiv'+node).style.bottom='0';
	document.getElementById('nodeinfodiv'+node).style.position='Absolute';
	document.getElementById('nodeinfodiv'+node).style.visibility='visible';
	document.getElementById('nodeinfodiv'+node).className='nodeinfodiv';	
	document.getElementById('nodeinfodiv'+node).style.border='solid black 1px;';
	movenodediv(node);
	
	}

}

function movenodediv(node)
{
	/*
	document.getElementById('nodeinfodiv'+node).style.left=tempX+20;
	document.getElementById('nodeinfodiv'+node).style.top=tempY+20;
*/
}
function setNode()
{
	
document.getElementById('subarch').value='node';
	document.getElementById('page').value='setNode';
	document.getElementById('unauth').value='1';
//	document.getElementById('xargs').value=id1+','+id2;
		
	showup(['page','subarch','unauth','NO_CACHE'],['nodediv'],['POST']);
	
}
// JavaScript Document
//<![CDATA[

function pjx(args,fname,method,indicator) {
  this.target=args[1];
  this.args=args[0];
  method=(method)?method:'GET';
  if(method=='post'){method='POST';}
  this.method = method;
	this.r=ghr();
  this.url = this.getURL(fname);
}



function formDump(){

  var all = [];
  var fL = document.forms.length;
  for(var f = 0;f<fL;f++){
    var els = document.forms[f].elements;
    for(var e in els){
      var tmp = (els[e].id != undefined)? els[e].id : els[e].name;
      if(typeof tmp != 'string'){continue;}
      if(tmp){ all[all.length]=tmp}
    }

  }
  return all;
}
function getVal(id) {

  if (id.constructor == Function ) { return id(); }
  if (typeof(id)!= 'string') { return id; }
  var element = document.getElementById(id) || document.forms[0].elements[id];
 
  if(!element){
	if(typeof(id) == 'string')
	{
		return id;	
		
	}
	alert('ERROR: Cant find HTML element with id or name: ' +
     id+' -'+typeof(id) +'-');
     return 0;
  }
   if(element.type == 'select-one') { 
      if(element.selectedIndex == -1) return;
      var item = element[element.selectedIndex]; 
      return  item.value || item.text
   } 
  if (element.type == 'select-multiple') {
  var ans = [];
  var k =0;
    for (var i=0;i<element.length;i++) {
      if (element[i].selected || element[i].checked ) {
        ans[k++]= element[i].value || element[i].text;
      }
    }
    return ans;
  }
    
  if(element.type == 'radio' || element.type == 'checkbox'){
    var ans =[];
    var elms = document.getElementsByTagName('input');
    var endk = elms.length;
    var i =0;
    for(var k=0;k<endk;k++){
      if(elms[k].type== element.type && elms[k].checked && elms[k].id==id){
        ans[i++]=elms[k].value;
      }
    }
    return ans;
  }
  if( element.value == undefined ){
    return element.innerHTML;
  }else{
    return element.value;
  }
}
function fnsplit(arg) {
  var url="";
  if(arg=='NO_CACHE'){return '&pjxrand='+Math.random()}
  if((typeof(arg)).toLowerCase() == 'object'){
      for(var k in arg){
         url += '&' + k + '=' + arg[k];
      }
  }else if (arg.indexOf('__') != -1) {
    arga = arg.split(/__/);
    url += '&' + arga[0] +'='+ escape(arga[1]);
  } else {
    var res = getVal(arg) || '';
    if(res.constructor != Array){ res = [res] }
    for(var i=0;i<res.length;i++) {
      url += '&args=' + escape(res[i]) + '&' + arg + '=' + escape(res[i]);
    }
  }
  return url;
}

pjx.prototype =  {
  send2perl : function(){
    var r = this.r;
    var dt = this.target;
    this.pjxInitialized(dt);
    var url=this.url;
    var postdata;
    if(this.method=="POST"){
      var idx=url.indexOf('?');
      postdata = url.substr(idx+1);
      url = url.substr(0,idx);
    }
    r.open(this.method,url,true);
    ;
    if(this.method=="POST"){
      r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      r.send(postdata);
    }
    if(this.method=="GET"){
      r.send(null);
    }
    r.onreadystatechange = handleReturn;
 },
 pjxInitialized : function(){},
 pjxCompleted : function(){},
 readyState4 : function(){
    var rsp = unescape(this.r.responseText);  /* the response from perl */
    var splitval = '__pjx__';  /* to split text */
    /* fix IE problems with undef values in an Array getting squashed*/
    rsp = rsp.replace(splitval+splitval+'g',splitval+" "+splitval);
    var data = rsp.split(splitval);  
    dt = this.target;
    if (dt.constructor != Array) { dt=[dt]; }
    if (data.constructor != Array) { data=[data]; }
	 if (typeof(dt[0])!='function') {
      for ( var i=0; i<dt.length; i++ ) {
        var div = document.getElementById(dt[i]);
		if(div == undefined){
			div = document.createElement("DIV");
			div.type='hidden';
		}
        if (div.type =='text' || div.type=='textarea' || div.type=='hidden' ) {
          div.value=data[i];
        } else{
          div.innerHTML = data[i];
        }
      }
    } else if (typeof(dt[0])=='function') {
       dt[0].apply(this,data);
    }

    this.pjxCompleted(dt);
	var mystr=div.innerHTML;
	var e = div.getElementsByTagName("script");
	for(var i=0;i<e.length;i++)
	{
		if(e[i].src){		
			var mysc=document.createElement("script");
			mysc.src=e[i].src;
			document.body.appendChild(mysc);
		}
	
		if(e[i].innerHTML){
			eval(e[i].innerHTML);	
		}
	}
	var d = div.getElementsByTagName("link");
	for(var i=0;i<d.length;i++){

			var mysc=document.createElement("link");
			mysc.href=d[i].href;
			mysc.rel=d[i].rel;
			mysc.type=d[i].type;
			document.body.appendChild(mysc);


	}
	

},

  getURL : function(fname) {
      var args = this.args;
      var url= 'fname=' + fname;
      for (var i=0;i<args.length;i++) {
        url=url + args[i];
      }
      return url;
  }
};

handleReturn = function() {
  for( var k=0; k<ajax.length; k++ ) {
    if (ajax[k].r==null) { ajax.splice(k--,1); continue; }
    if ( ajax[k].r.readyState== 4) { 
      ajax[k].readyState4();
      ajax.splice(k--,1);
      continue;
    }
  }
};
var ghr=getghr();
function getghr(){
 if(typeof XMLHttpRequest != "undefined")
    {
        return function(){return new XMLHttpRequest();}
    }
    var msv= ["Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0",
    "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0",
    "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
    for(var j=0;j<=msv.length;j++){
        try
        {
            A = new ActiveXObject(msv[j]);
            if(A){ 
              return function(){return new ActiveXObject(msv[j]);}
            }
        }
        catch(e) {}
     }
     return false;

}


function jsdebug(){
    var tmp = document.getElementById('pjxdebugrequest').innerHTML = "<br><pre>";
    for( var i=0; i < ajax.length; i++ ) {
      tmp += '<a href= '+ ajax[i].url +' target=_blank>' +
      decodeURI(ajax[i].url) + ' </a><br>';
    }
    document.getElementById('pjxdebugrequest').innerHTML = tmp + "</pre>";
}

function showup() {
  var args = showup.arguments;
  for( var i=0; i<args[0].length;i++ ) {
    args[0][i] = fnsplit(args[0][i]);
  }
  var l = ajax.length;
  ajax[l]= new pjx(args,"showup",args[2],args[3]);
  ajax[l].url = '/process.bng?' + ajax[l].url;
  ajax[l].send2perl();
  ;
}
//]]>// JavaScript Document
var currentsbutton;
function HideCar(){
	pbut($('sbut1'));
	Main(1);
}
function pbut(obj)
{

//if(!currentsbutton ){currentsbutton=$('sbut1');}
	//curentsbutton.className='buttons1';

if(!currentsbutton){
		currentsbutton=$('sbut1');
	}
	currentsbutton.className='buttons1';
	currentsbutton=obj;


}


function hideHistory()
		{
			new Effect.Fade('historydiv');
			
			
		}
		function Main(myarg)
		{

			
		if($('extrainfo').style.display != 'inline' || myarg == 1){
			$('lastcomment').style.display='inline';
			$('extrainfo').style.display='none';
						$('sbut1').className='buttons2';
			
		}
		$('subarch').value='HaveSeen';
			$('page').value='lastcomment';
			$('unauth').value='1';			
			showup(['page','subarch','unauth','NO_CACHE'],['lastcomment']);
		
		}
		function getInfo(myarg)
		{
			$('extrainfo').innerHTML="<font style=\"background:#ffcc00;color:black;font-size:21px;\"> Loading.....</font>";

			$('lastcomment').style.display='none';
			$('extrainfo').style.display='inline';
			$('subarch').value='HaveSeen';
			$('page').value='About'+myarg;
			$('unauth').value='1';			
			showup(['page','subarch','unauth','think','NO_CACHE'],['extrainfo']);
			
		}
		function seenHistory()
		{
		
			//alert('try later');
			if(			$('historydiv').style.display=='inline')
			{
				new Tip('You are already viewing the history');

				return 1;
			}

			$('subarch').value='HaveSeen';
			$('page').value='viewhistory';
			$('unauth').value='1';			
			showup(['page','subarch','unauth','think','NO_CACHE'],['historydiv']);
			//new Effect.BlindDown('historydiv');
			$('historydiv').innerHTML='<img src="/bongsoft/images/spotting/loading.gif" />';
			$('historydiv').style.display='inline';

			
		}
		function SaveHaveYou()
		{
			
			$('subarch').value='HaveSeen';
			$('page').value='savecomment';
			$('unauth').value='1';			
			showup(['page','subarch','unauth','yourname','dateseen','locationseen','think','NO_CACHE'],['processdiv']);
			
		}
		function CancelHaveYou()
		{
				
					Effect.Fade('whereseen');
					
		}
		function SeenCar()
		{
			

			Effect.Appear('whereseen');//$('whereseen').style.display='block';
		}	
		/* Ryans Car Spotting Program... fuck yall haters
*/
var thumbs = new Array();
var realim = new Array();

thumbs[0]="http://a348.ac-images.myspacecdn.com/images01/11/m_7547dac20afabed0becde5f568dae1ab.jpg";

thumbs[1]="http://a923.ac-images.myspacecdn.com/images01/37/m_72498ec0dfe996aeb601105777bb23da.jpg";
thumbs[2]="http://a100.ac-images.myspacecdn.com/images01/45/m_2b6e8b109a3fadb04553bd94b76937e3.jpg";
thumbs[3]="http://a722.ac-images.myspacecdn.com/images01/37/m_335dd6c3aebb1d5f149eb7b46246ca39.jpg";
thumbs[4]="http://a709.ac-images.myspacecdn.com/images01/64/m_2889f940add664384524b8a9de55eadc.jpg";
thumbs[5]="http://a914.ac-images.myspacecdn.com/images01/56/m_1de7984a930c7a40a39061dffd43d3b1.gif";
thumbs[6]="http://a124.ac-images.myspacecdn.com/images01/79/m_839d6e648a8cb024106438be4752fc93.jpg";
thumbs[7]="http://a120.ac-images.myspacecdn.com/images01/9/m_b393476bf3c4c1ef609e89cf6f37577f.jpg";

realim[0]="http://a348.ac-images.myspacecdn.com/images01/11/l_7547dac20afabed0becde5f568dae1ab.jpg";
realim[1]="http://a923.ac-images.myspacecdn.com/images01/37/l_72498ec0dfe996aeb601105777bb23da.jpg";
realim[2]="http://a100.ac-images.myspacecdn.com/images01/45/l_2b6e8b109a3fadb04553bd94b76937e3.jpg";
realim[3]="http://a722.ac-images.myspacecdn.com/images01/37/l_335dd6c3aebb1d5f149eb7b46246ca39.jpg";
realim[4]="http://a709.ac-images.myspacecdn.com/images01/64/l_2889f940add664384524b8a9de55eadc.jpg";
realim[5]="http://a914.ac-images.myspacecdn.com/images01/56/l_1de7984a930c7a40a39061dffd43d3b1.gif";
realim[6]="http://a124.ac-images.myspacecdn.com/images01/79/l_839d6e648a8cb024106438be4752fc93.jpg";
realim[7]="http://a120.ac-images.myspacecdn.com/images01/9/l_b393476bf3c4c1ef609e89cf6f37577f.jpg";


var current1=0;
var current2=1;
var nextindex=2;
var image2_timer;
var image1_timer;
//Modalbox.show($(carpic1), {title: 'Viewing Image', width: 600}); return false;
function closeNew()
{
	$('newspotdiv').style.display='none';
	
}
var spottingtimer;
function refreshspotting()
{
	$('subarch').value='HaveSeen';
	$('page').value='refresh';
	$('unauth').value='1';			
	showup(['page','subarch','unauth','yourname','dateseen','locationseen','think','NO_CACHE'],['divspottings']);
	
	
}
function checkTopHistory()
{
	var isn=$('historydiv').style.top.indexOf("-");
	if($('historydiv').style.top.indexOf("-") > -1){
		$('historydiv').style.top='100px';	
	}
	
}
function checkTopAbout()
{
	var isn=$('aboutcardiv').style.top.indexOf("-");
	if($('aboutcardiv').style.top.indexOf("-") > -1){
		$('aboutcardiv').style.top='100px';	
	}
	
	//alert($('aboutcardiv').style.top);
	//alert(isn);
	
	
}
function SaveSpotting()
{
	$('subarch').value='HaveSeen';
	$('page').value='savecomment';
	$('unauth').value='1';			
	showup(['page','subarch','unauth','yourname','dateseen','locationseen','think','NO_CACHE'],['processdiv']);
	new Effect.Puff('newspotdiv');
	refreshspotting();
	//centeredmodalert("Thank you, your spotting was saved",0,0,'confirmAlert();','confirmAlert();');


}
function closeAboutCar()
{
	//$('aboutcardiv').style.display='none';
	new Effect.Puff('aboutcardiv');
}
function aboutcar()
{
	$('aboutcardiv').style.display='inline';	
}
function newSpotting()
{
	$('newspotdiv').style.display='inline';
//	modalert("Sorry Try Tomorrow, For now you can view the ones already left",0,0,'confirmAlert();','confirmAlert();');
}
function closeHistory2()
{
	new Effect.Puff('historydiv');
}
function viewAllSpottings()
{
	
			$('subarch').value='HaveSeen';
			$('page').value='viewhistory2.0';
			$('unauth').value='1';			
			$('historydiv').innerHTML='<img src="/bongsoft/images/spotting/loading.gif" />';
			$('historydiv').style.display='inline';
			showup(['page','subarch','unauth','think','NO_CACHE'],['historydiv']);
	
	//Modalbox.show("/process.bng?subarch=HaveSeen&page=viewhistory2.0&unauth=1",{title:'Spotting History',width:600});
	
	
}
function showCar(arg){

	switch(arg)
	{
		case 1:

			var newpic=$(carpic1).src.replace("m_","l_");
			Modalbox.show('<img src="'+newpic+'" height="470" />', {title: 'Viewing Image', width: 660});
	
			break;
		case 2:
			var newpic=$(carpic2).src.replace("m_","l_");
			Modalbox.show('<img src="'+newpic+'" height="470" />', {title: 'Viewing Image', width: 660});
	
			break;
		default:
		break;
	}
}

function startCars() {
	
	image1_fadeout();
	setTimeout("image2_fadeout();",3000);
}

function image1_fadeout(){
	
	new Effect.Opacity('carpic1',{from:1.0,to:0.5, duration: 1});
	image1_timer=setTimeout("image1_switch();",1100);
	current1=nextindex;
	
	setTimeout("switch_1()",1000);	
	
	nextindex++;
	if(nextindex >=thumbs.length){nextindex=0;}
		
		
}
function image1_switch(){
	image1_fadein();

			
}
function image1_fadein(){
	new Effect.Opacity('carpic1',{from:0.5,to:1.0, duration: 1});
	image1_timer=setTimeout("image1_fadeout();",6000);
}


function switch_2()
{

}
function switch_1()
{
	
}
function image2_fadeout(){
	
	new Effect.Opacity('carpic2',{from:1.0,to:0.5, duration: 1});
	image2_timer=setTimeout("image2_switch();",1100);
	current2=nextindex;
	
	setTimeout("switch_2();",1000);	
	nextindex++;
	
	
	if(nextindex >=thumbs.length){nextindex=0;}
		
}
function image2_switch(){
	image2_fadein();

			
}
function image2_fadein(){
	new Effect.Opacity('carpic2',{from:0.5,to:1.0, duration: 1});
	image2_timer=setTimeout("image2_fadeout();",6000);
}

// JavaScript Document
function checkChatInput(e)
{
	    var keynum   

        //alert(e.type); 
        if(window.event) // IE
        {
        keynum = e.keyCode
        }
        else if(e.which) // Netscape/Firefox/Opera
        {
        keynum = e.which
        }
        if(keynum ==13){
               // TheForm.submit();
			//Authenticate2();
			postChat();
        }

	
}
var recpt='';
function postChat()
{

	//document.getElementById('chatLoading').style.display='inline';
	document.getElementById('txtChatInput').style.background="url('"+document.getElementById('chatLoading').src+"')";
	
	document.getElementById('subarch').value='node';	
	document.getElementById('page').value='postChat';
	document.getElementById('unauth').value='1';
	document.getElementById('xargs').value=recpt;
	showup(['page','subarch','unauth','xargs','txtChatInput','NO_CACHE'],['chatProcessDiv'],['POST']);
	
}
function clearChat()
{
	closeIMs();
	document.getElementById('subarch_4').value='node';	
	document.getElementById('page_4').value='clearChat';
	document.getElementById('unauth_4').value='1';

		showup(['page_4','subarch_4','unauth_4','NO_CACHE'],['processdiv']);

}

var chattimer =0;

function loadChat2()
{
	document.getElementById('subarch_3').value='node';	
	document.getElementById('page_3').value='chatData';
	document.getElementById('unauth_3').value='1';
	document.getElementById('xargs_3').value=recpt;
	if(document.getElementById('divChat')){
		showup(['page_3','subarch_3','unauth_3','xargs_3','NO_CACHE'],['divChatData']);
	}
	
}
function loadChat()
{
		loadChat2();
	hideflash();
}

function closeChat2()
{
	showflash();
	recpt="";
	document.body.removeChild(document.getElementById('divChat'));
	
}
function closeChat()
{
	myavatar=-1;
	closeChat2();
	modall(0);
}

function chat(tonode,slot)
{
	var slotcol=0;
	
	if(slot)
	{
		slotcol=slot%4;
		if(slotcol == 0){slotcol=4;}
		
		//alert(slotcol);
		
	}
	else{
	modall(1);
	
	}
	//if(slot){alert(slot);}

	

	if(!document.getElementById('divChat'))
	{
		var newdiv = document.createElement("DIV");
		newdiv.style.height=400;
		newdiv.style.width=500;
		newdiv.style.background='url("/bongsoft/images/chatback.gif")';
		newdiv.style.border='none';
		newdiv.style.position='absolute';
		newdiv.style.left='50%';
		newdiv.style.top=70+getScroll();
		newdiv.style.marginLeft=-250;
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='11000';		
		newdiv.id='divChat';
		newdiv.name='divChat';
		newdiv.style.display='none';
		if(slot)
		{
			newdiv.style.top = getScroll()+125;	
			
		}
		document.body.appendChild(newdiv);
		
		
	}	
	var abortlink='<a href="javascript:closeChat();">Abort</a>';
	document.getElementById('divChat').innerHTML='<BR><BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;<img src="/bongsoft/images/loading2.gif" />  <font color="white">Loading..</font>' + abortlink;
	document.getElementById('divChat').style.display='inline';
	//setTimeout("new Effect.Appear('divChat');",100);
	
	document.getElementById('subarch_2').value='node';	
	document.getElementById('page_2').value='Chat';
	document.getElementById('unauth_2').value='1';
	document.getElementById('xargs_2').value=tonode;
if(document.getElementById('divChat') == null){
}else{
showup(['page_2','subarch_2','unauth_2','xargs_2','NO_CACHE'],['divChat']);
}

	
}

	
//var selectedslot=0;

function highlight_im(sender,node)
{
	
	sender.style.background='#ffcc66';	
}

function chatFromSlot(slot,node)
{
	//selectedslot=slot;
	chat(node,slot);	
}
function showIMs()
{
	
	if(document.getElementById('divIMs').style.display=='none'){
		document.getElementById('divIMs').style.display='inline';	
	}
	document.getElementById('subarch_IM').value='node';	
	document.getElementById('page_IM').value='showIMs';
	document.getElementById('unauth_IM').value='1';
	showup(['page_IM','subarch_IM','unauth_IM','NO_CACHE'],['divIMs']);
	
	
	
	
//document.getElementById('divIMs').innerHTML="You have new instant messages";


}// JavaScript Document
function closeIMs()
{
	
	document.getElementById('divIMs').style.display='none';
	//document.getElementById('TDnotifications').style.display='inline';
			
}/**
 * SWFObject v1.5.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept={};}if(typeof deconcept.util=="undefined"){deconcept.util={};}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={};}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10]||"";},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=[];var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;function hideFlash()
{
	

	var e = document.getElementsByTagName("embed");
	for(var i=0;i<e.length;i++){
	// eval(e[i].innerHTML);
		
	//	e.style.display='none';
		
	}	
}

function quickStuffSignup()
{
	document.getElementById('divQuickStuffHelpUs').style.display='none';
	document.getElementById('divVideoEmbed').style.display='none';
	document.getElementById('divQuickStuffSignup').style.display='block';
	document.getElementById('divQuickStuffUpload').style.display='none';
	
	
	
}
function quickStuffVideo()
{
	document.getElementById('divQuickStuffSignup').style.display='none';
	document.getElementById('divQuickStuffHelpUs').style.display='none';
	document.getElementById('divVideoEmbed').style.display='block';
	document.getElementById('divQuickStuffUpload').style.display='none';
	
	
}
function quickStuffHelpUs()
{
	document.getElementById('divQuickStuffSignup').style.display='none';
	document.getElementById('divQuickStuffHelpUs').style.display='block';
	document.getElementById('divVideoEmbed').style.display='none';
	document.getElementById('divQuickStuffUpload').style.display='none';
	
		
}

function quickStuffUpload()
{
	document.getElementById('divQuickStuffSignup').style.display='none';
	document.getElementById('divQuickStuffHelpUs').style.display='none';
	document.getElementById('divVideoEmbed').style.display='none';
	document.getElementById('divQuickStuffUpload').style.display='block';
	if(userid > 0){flashUpload();}
	
		
}


// JavaScript Document

function highlight_imageelement(myel)
{

		if(!document.getElementById('divViewImg'))
		{
		var newdiv = document.createElement("DIV");
		newdiv.style.height=400;
		newdiv.style.width=500;
		newdiv.style.background='white';
		newdiv.style.border='solid black 1px';
		newdiv.style.position='absolute';
		newdiv.style.left=tempX;
		newdiv.style.top=tempY;
	//	newdiv.style.left='50%';
	//	newdiv.style.top=70+getScroll();
	//	newdiv.style.marginLeft=-250;
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='11000';		
		newdiv.id='divViewImg';
		newdiv.name='divViewImg';
		newdiv.style.display='none';
		document.body.appendChild(newdiv);
		}
	var abortlink='<a href="javascript:closeViewImg();">Abort</a>';
	document.getElementById('divViewImg').innerHTML='<BR><BR><BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;<img src="/bongsoft/images/loading2.gif" />  <font color="white"> Loading..</font>' + abortlink;

	document.getElementById('divViewImg').style.display='inline';
	document.getElementById('subarch_2').value='Media';	
	document.getElementById('page_2').value='viewimg';
	document.getElementById('unauth_2').value='1';

showup(['page_2','subarch_2','unauth_2','NO_CACHE'],['divViewImg']);	
	
}// JavaScript Document
function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

///////
function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
var dockedvideo='';
var dockeduid='';
var dockedppid='';

var myX=0;
var myY=0;
var opening=0;

var updisabled=0;
var downdisabled=0;
var scrollingmorefrom=0;
var morefromindex=0;
var MoreFromVideos=new Array();
var MoreFromCaptions=new Array();
var MoreFromThumbs=new Array();

function embedVideo(div,uid,pid)
{
		var mydiv=document.getElementById(div);
		mydiv.style.textAlign='center';
		var fo = new SWFObject("/VidPlayer/VidPlayer.swf", "vidPlayer", "400", "266.7", 8, "#000000", false);
		fo.addVariable("u", uid);
		fo.addVariable("unique", pid);
		fo.addVariable("d", domain);
		fo.addVariable("i", imageserver);
		
		fo.write(div);

}
function highlight_video_2(pid,alt)
{
	vidtab=-1;
	if(!alt){
		modall(1);
	}
	if(!document.getElementById('previewvideodiv'))
	{
		var newdiv = document.createElement("DIV");
		newdiv.style.height=500;
		newdiv.style.width=500;
		newdiv.style.background='#6699CC; url("/bongsoft/images/watchvideobg.gif")';
		newdiv.style.border='solid black 2px';
		newdiv.style.position='absolute';
		newdiv.style.left='50%';
		newdiv.style.top=120+getScroll();
		newdiv.style.marginLeft=-250;
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='11000';		
		newdiv.id='previewvideodiv';
		newdiv.name='previewvideodiv';
		newdiv.style.display='none';
		document.getElementById('xargs_2').value='';
		if(alt){
			newdiv.style.marginLeft=-400;
			newdiv.style.width=799;
			newdiv.style.background='#6699CC url("/bongsoft/images/watchvideobg.gif")';
			document.getElementById('xargs_2').value=alt;
		
		}
		if(alt){
				
		}
		document.body.appendChild(newdiv);
		//new Draggable('previewvideodiv');	
		
	}	
	var abortlink='<a href="javascript:closeVideoPreview();">Abort</a>';
	document.getElementById('previewvideodiv').innerHTML='<img src="/bongsoft/images/loadingtiny.gif" />  Loading..' + abortlink;

if(!alt){
	setTimeout("new Effect.Appear('previewvideodiv');",100);
	}
	else{
	setTimeout("new Effect.BlindDown('previewvideodiv');",100);
		
	}
	document.getElementById('subarch').value='Media';	
	document.getElementById('page').value='viewVideo2';
	document.getElementById('unauth').value='1';
	document.getElementById('xargs').value=pid;
	
	showup(['page','subarch','unauth','xargs','xargs_2','NO_CACHE'],['previewvideodiv']);
	


}

function highlight_audio_1(pid)
{
//	modalert('highlight_image_1',1,0,'confirmAlert();','confirmAlert();');	


//modall(1);


	
	if(!document.getElementById('previewvideodiv'))
	{
		var newdiv = document.createElement("DIV");
		newdiv.style.height='auto';
		newdiv.style.width=500;
		newdiv.style.background='url("/bongsoft/images/previewimagebg.gif")';
		newdiv.style.border='solid black 2px';
		newdiv.style.position='absolute';
		newdiv.style.left='50%';
		newdiv.style.top=100+getScroll();
		newdiv.style.marginLeft=-250;
		newdiv.style.fontFamily='verdana';
		newdiv.style.fontSize='12px';
		newdiv.style.fontWeight='600';
		newdiv.style.zIndex='11000';		
		newdiv.id='previewvideodiv';
		newdiv.name='previewvideodiv';
		newdiv.style.display='none';
		
		document.body.appendChild(newdiv);
		//new Draggable('previewvideodiv');	
		
	}	
	var abortlink='<a href="javascript:closeVideoPreview();">Abort</a>';
	document.getElementById('previewvideodiv').innerHTML='<img src="/bongsoft/images/loadingtiny.gif" />  Loading..' + abortlink;
	setTimeout("new Effect.Appear('previewvideodiv');",100);
	
	document.getElementById('subarch').value='Media';	
	document.getElementById('page').value='viewAudio1';
	document.getElementById('unauth').value='0';
	document.getElementById('xargs').value=pid;
	showup(['page','subarch','unauth','xargs','NO_CACHE'],['previewvideodiv']);
	


}



function closeVideoPreview()
{
	document.body.removeChild(document.getElementById('previewvideodiv'));
	modall(0);
}
function hide_video_info(myuid,mypid)
{
	if(isvideodocked(myuid+''+mypid)){return 1;}
	document.getElementById('videoinfodiv'+myuid+mypid).style.display='none';
}

function highlight_video(myuid,mypid,preload,force)
{
		if(!preload){preload =0;}
		if(opening){return;}	
		
	if(document.getElementById('videoinfodiv'+myuid+mypid) == null){
			create_videoinfodiv(myuid,mypid);
	}
	if(preload == 0){
	move_videodiv(myuid,mypid);
	}
		if(preload == 0 && document.getElementById('videoinfodiv'+myuid+mypid).style.display == 'none'){
			document.getElementById('videoinfodiv'+myuid+mypid).style.display = 'inline';
			//Effect.Appear('userinfodiv'+myuid,{duration:0});
			
		}else{
			void(0);
		}
		
	
	

		
		document.getElementById('u').value=myuid;
		document.getElementById('subarch').value='Media';
		document.getElementById('page').value='videoInfoPopup';
		document.getElementById('unauth').value='1';
				document.getElementById('ppid').value=mypid;
		
if(document.getElementById('videoinfodiv'+myuid+mypid).innerHTML == 'Loading.......' || force == 1)
{
	showup(['page','subarch','unauth','u','ppid','NO_CACHE'],['videoinfodiv' +myuid+mypid]);
}		
	
	
	

}
function move_videodiv(myuid,mypid)
{
//	alert(dockedvideo);
   if(isvideodocked(myuid+''+mypid)){return 1;}
//	alert(dockedvideo);
	if(opening){return;}
	
	if(document.getElementById('videoinfodiv'+myuid+mypid) == null){
			create_videoinfodiv(myuid,mypid);
	}
	if(document.getElementById('videoinfodiv'+myuid+mypid).style.display=='none'){
		document.getElementById('videoinfodiv'+myuid+mypid).style.display='inline';
		}
		if(document.getElementById('videoinfodiv'+myuid+mypid).style.visibility=='hidden'){
		document.getElementById('videoinfodiv'+myuid+mypid).style.visibility='visible';
	}
	
	document.getElementById('videoinfodiv'+myuid+mypid).style.MozOpacity=0.97;
		document.getElementById('videoinfodiv'+myuid+mypid).style.filter='Alpha(Opacity=95, Style=0)';
		getHW();
		var newY=tempY -100;
//		var offscreenY=newY+390;
	//	if (offscreenY > winH) {newY=winH-400;}

		var newX=tempX+15;
//		var offscreenX=newX+400;
	//	if(offscreenX > winW){newX=winW}

	document.getElementById('videoinfodiv'+myuid+mypid).style.left=newX;
	document.getElementById('videoinfodiv'+myuid+mypid).style.top=newY;
	
	

	//alert(myY+'-'+myX);

}
function remove_video_dock(myu,vid)
{
	var closemain=0;
	var playvisible=0;
	var editvisible=0;
	
if(document.getElementById('videoplaydiv'+myu+''+vid) )
{
		if(document.getElementById('videoplaydiv'+myu+''+vid).style.display != 'none')
		{
			playvisible=1;
		}
				
}
if(document.getElementById('videoeditdiv'+myu+''+vid))
{
		if(document.getElementById('videoeditdiv'+myu+''+vid).style.display != 'none')
		{
			editvisible=1;
		}
		
	
}
if(editvisible == 1){
	closemain=0;
	document.getElementById('videoeditdiv'+myu+''+vid).style.display = 'none';
}
if(playvisible == 1){
	closemain=0;
	document.getElementById('videoplaydiv'+myu+''+vid).style.display = 'none';
}
if(editvisible == 0 && playvisible == 0){closemain=1;}
if(closemain ==1)
{
	dockedvids[dockedvids.indexOf(myu+""+vid)]='';
	document.getElementById('videoinfodiv'+myu+''+vid).style.display='none';
	document.getElementById('vidbuttons'+myu+""+vid).style.display='none';
	document.getElementById('videoinfodiv'+myu+""+vid).style.height='150px';
}	
	


	//if(document.getElementById('videoplaydiv'+myu+''+vid)){
		//					   document.getElementById('videoplaydiv'+myu+''+vid).style.display='none';
			//				   }
}
function create_videoinfodiv(myuid,mypid,preload)
{

	if(!preload){preload = 0;}
	var newdiv=document.createElement("DIV");

	newdiv.id='videoinfodiv'+myuid+mypid;
	newdiv.innerHTML='Loading.......';
	nextz=nextz+500;
	newdiv.style.zIndex=nextz;

	document.body.appendChild(newdiv);		
	document.getElementById('videoinfodiv'+myuid+mypid).style.height='150px';
	document.getElementById('videoinfodiv'+myuid+mypid).style.width='400px';
	document.getElementById('videoinfodiv'+myuid+mypid).style.left=tempX;
	document.getElementById('videoinfodiv'+myuid+mypid).style.top=tempY;
	document.getElementById('videoinfodiv'+myuid+mypid).style.bottom='0';
	document.getElementById('videoinfodiv'+myuid+mypid).style.position='Absolute';
	document.getElementById('videoinfodiv'+myuid+mypid).style.visibility='visible';
	
	document.getElementById('videoinfodiv'+myuid+mypid).style.background='#99CC66';
	document.getElementById('videoinfodiv'+myuid+mypid).style.border='solid black 1px;';

if(preload == 0){
	document.getElementById('videoinfodiv'+myuid+mypid).style.display='inline'; 
}
else{
		highlight_video(myuid,mypid,1);

		document.getElementById('videoinfodiv'+myuid+mypid).style.display='none'; 
}


}
dockedvids = new Array(25);
var vdoccount=0;
var skipdock=0;
function isvideodocked(vid)
{
//alert(vid);		
	for(var x = 0; x < 25; x++)
	{
		if(dockedvids[x] == vid){return true; }	
	}

	return false;
}
function govideo(myu,myp)
{

	dockeduid=myu;
	dockedppid=myp;


	if(!isvideodocked(myu+''+myp)){
		dockedvids[vdoccount]=myu+''+myp;
	vdoccount++;
//	document.getElementById('vidbuttons'+myu+""+myp).style.display='block';
	Effect.Appear('vidbuttons'+myu+""+myp);
	document.getElementById('videoinfodiv'+myu+""+myp).style.height='290px';
	new Draggable('videoinfodiv'+myu+""+myp,{handle:'dragHandle'+myu+''+myp});
	}	
//	document.getElementById('playvideobutton'+myu+""+myp).style.display='block';


//	dockedvideo=myu+""+myp;

	 
	return 1;	
}
function playVideo(myuid,mypid)
{
	if(!document.getElementById('videoplaydiv'+myuid+mypid)){
		
	var newdiv=document.createElement("DIV");
	newdiv.id='videoplaydiv'+myuid+mypid;
	nextz=nextz+500;
	newdiv.style.zIndex=nextz;
	document.getElementById('videoinfodiv'+myuid+''+mypid).appendChild(newdiv);		
	document.getElementById('videoplaydiv'+myuid+mypid).style.height='350px';
	document.getElementById('videoplaydiv'+myuid+mypid).style.width='400px';
	document.getElementById('videoplaydiv'+myuid+mypid).style.left=tempX;
	document.getElementById('videoplaydiv'+myuid+mypid).style.top=tempY;
	document.getElementById('videoplaydiv'+myuid+mypid).style.bottom='0';
	document.getElementById('videoplaydiv'+myuid+mypid).style.position='Absolute';
	document.getElementById('videoplaydiv'+myuid+mypid).style.visibility='visible';
//	document.getElementById('videoplaydiv'+myuid+mypid).style.left=	document.getElementById('videoinfodiv'+myuid+mypid).style.left;
//		document.getElementById('videoplaydiv'+myuid+mypid).style.top=	document.getElementById('videoinfodiv'+myuid+mypid).style.top+20;
	document.getElementById('videoplaydiv'+myuid+mypid).style.left=	0;
		document.getElementById('videoplaydiv'+myuid+mypid).style.top=26;

document.getElementById('videoplaydiv'+myuid+mypid).style.background='';
	document.getElementById('videoplaydiv'+myuid+mypid).style.border='none';
	document.getElementById('videoplaydiv'+myuid+mypid).style.display='inline'; 
//document.getElementById('videoplaydiv'+myuid+mypid).innerHTML='';

var embed=document.createElement("embed");
	embed.setAttribute("width",400);
	embed.setAttribute("height",400);
	embed.setAttribute("src","http://www.rispeed.com/VidPlayer/VidPlayer.swf?u="+myuid+"&unique="+mypid+"&wmode=transparent&rand="+GUID());
     document.getElementById('videoplaydiv'+myuid+mypid).appendChild(embed);
	}
	else{

		document.getElementById('videoplaydiv'+myuid+mypid).style.display='block';	
	}

//	document.getElementById('videoinfodiv'+u+''+p).innerHTML='';
}




function EditVideo(myuid,mypid)
{
	if(!document.getElementById('videoeditdiv'+myuid+mypid)){
	var newdiv=document.createElement("DIV");
	newdiv.id='videoeditdiv'+myuid+mypid;
	nextz=nextz+500;
	newdiv.style.zIndex=nextz;
	document.getElementById('videoinfodiv'+myuid+''+mypid).appendChild(newdiv);		
	document.getElementById('videoeditdiv'+myuid+mypid).style.height='350px';
	document.getElementById('videoeditdiv'+myuid+mypid).style.width='400px';
	document.getElementById('videoeditdiv'+myuid+mypid).style.left=tempX;
	document.getElementById('videoeditdiv'+myuid+mypid).style.top=tempY;
	document.getElementById('videoeditdiv'+myuid+mypid).style.bottom='0';
	document.getElementById('videoeditdiv'+myuid+mypid).style.position='Absolute';
	document.getElementById('videoeditdiv'+myuid+mypid).style.visibility='visible';
	document.getElementById('videoeditdiv'+myuid+mypid).style.left=	0;
	document.getElementById('videoeditdiv'+myuid+mypid).style.top=26;
	document.getElementById('videoeditdiv'+myuid+mypid).style.background='';
	document.getElementById('videoeditdiv'+myuid+mypid).style.border='none';
	document.getElementById('videoeditdiv'+myuid+mypid).style.display='inline'; 
	var myif=document.createElement("iframe");
	myif.setAttribute("src","/VidEditor.bng?u="+myuid+"&unique=" +mypid);
	myif.setAttribute("width","400px");
	myif.setAttribute("height","400px");
	myif.setAttribute("scrolling","no");
	myif.setAttribute("frameborder","no");
	myif.setAttribute("align","left");
	myif.setAttribute("name","editframe"+myuid+mypid);
	document.getElementById('videoeditdiv'+myuid+mypid).appendChild(myif);

//document.getElementById('videoeditdiv'+myuid+mypid).innerHTML="<iframe style=\"width:400px;height:400px;\" src=\"http://www.rispeed.com/VidEditor.bng?u="+myuid+"&unique=" +mypid + "\" /\>";

//	document.getElementById('videoeditdiv'+myuid+mypid).appendChild(editObj);

	

}
	else{
		document.getElementById('videoeditdiv'+myuid+mypid).style.display='block';	
	}

//	document.getElementById('videoinfodiv'+u+''+p).innerHTML='';
}
var vidtab=-1;
function h_tab(tnum,tname,tval)
{
	if(!tval){tval=''}
	if(tnum != vidtab){	
		document.getElementById(tname).style.background=tval;	
	}
}
function hideMoreFrom()
{
	new Effect.BlindUp('divmorefrom');
	myhighlight(document.getElementById('tdMoreFrom'),'');	
}
function ProcessMoreFromSlot(slotnum)
{
		  highlight_video_2(MoreFromVideos[(morefromindex+slotnum)-1],1);
		  
}

function showMoreFrom(_UI)
{
	switch(vidtab)
	{
		case 0:
		hideVidComments();
		break
		case 1:
		hideShareCode();
		break
		case 3:
		hideEditVideo();
		break
		
	}
	if(vidtab !=2)
	{
		MoreFromVideos.clear();
		MoreFromCaptions.clear();
		MoreFromThumbs.clear();
		
		vidtab=2;
		myhighlight(document.getElementById('tdMoreFrom'),'#FF0000');
		new Effect.BlindDown('divmorefrom');
		document.getElementById('subarch').value='Media';	
		document.getElementById('page').value='DisplayMoreFrom';
		document.getElementById('unauth').value='1';
		document.getElementById('xargs').value=_UI;
		document.getElementById('divmorefrom').style.height=440;
	scrollingmorefrom=1;
	morefromindex=0;
	showup(['page','subarch','unauth','xargs','xargs2','NO_CACHE'],['divmorefrom'],['POST']);
	
	

		
	}
}
function hideDownArrow(){downdisabled=1;document.getElementById('imgDownArrow').src='/bongsoft/images/downarrow2disabled.gif';}
											   
function showDownArrow(){downdisabled=0;document.getElementById('imgDownArrow').src='/bongsoft/images/downarrow2.gif';}
function hideUpArrow(){updisabled=1;document.getElementById('imgUpArrow').src='/bongsoft/images/uparrow2disabled.gif';}
											   
function showUpArrow(){updisabled=0;document.getElementById('imgUpArrow').src='/bongsoft/images/uparrow2.gif';}




function scrollMoreFrom(_UI,_Switch)
{
		
	scrollingmorefrom=1;
	if(_Switch == 0){morefromindex=0;}
	if(_Switch==1){morefromindex--;}
	if(_Switch==2){morefromindex++;}
	
	if(morefromindex<0){morefromindex=0;scrollingmorefrom=0;return 1;}
	
	document.getElementById('subarch').value='Media';	
	document.getElementById('page').value='ScrollMoreFrom';
	document.getElementById('unauth').value='1';
	document.getElementById('xargs').value=_UI;
	document.getElementById('xargs2').value=morefromindex;
	document.getElementById('xargs3').value=MoreFromVideos.length;
	
	showup(['page','subarch','unauth','xargs','xargs2','xargs3','NO_CACHE'],['divMoreVids'],['POST']);
	
		
}
function hideVidComments()
{
	new Effect.BlindUp('divcomments');
	myhighlight(document.getElementById('tdComments'),'');
}
function showComments(_UI,_PI,refreshMark)
{
	switch(vidtab)
	{
		case 1:
		hideShareCode();
		break
		case 2:
		hideMoreFrom();
		break
		case 3:
		hideEditVideo();
		break
		
	}
	if(vidtab != 0 || refreshMark)
	{
		vidtab = 0;
		myhighlight(document.getElementById('tdComments'),'#FF0000');

		if(!refreshMark){new Effect.BlindDown('divcomments');}
			
		document.getElementById('subarch').value='Media';	
		document.getElementById('page').value='DisplayVideoComments';
		document.getElementById('unauth').value='1';
		document.getElementById('xargs').value=_UI;
		document.getElementById('xargs2').value=_PI;
		document.getElementById('divcomments').style.height=450;
		showup(['page','subarch','unauth','xargs','xargs2','NO_CACHE'],['divcomments'],['POST']);
	


	}
}
function hideShareCode()
{
	
		new Effect.BlindUp('divsharecodes');
		myhighlight(document.getElementById('tdShareCode'),'');
}
function showShareCode()
{
	switch(vidtab)
	{
		case 0:
		hideVidComments();
		break
		case 2:
		hideMoreFrom();
		break
		case 3:
		hideEditVideo();
		break
		
	}
	if(vidtab != 1){
		vidtab=1;
//		document.getElementById('divsharecodes').style.height='290px';
		myhighlight(document.getElementById('tdShareCode'),'#FF0000');
		new Effect.BlindDown('divsharecodes');
	}
}
function SendVidToFriend(href,emailaddy)
{
	var emailaddress=document.getElementById('txtsendtofriend').value;
	if(!ValidateEmail(emailaddy) )
	{
			document.getElementById('msgsent').style.display='none';		
			document.getElementById('invalidemailmsg').style.display='';		
		new Effect.Shake('invalidemailmsg');
	}else{

			document.getElementById('invalidemailmsg').style.display='none';		
			document.getElementById('msgsent').style.display='';		
			new Effect.Shake('msgsent');		
			document.getElementById('txtsendtofriend').value='';		
			document.getElementById('page').value='SendFriendVideoLink';
		document.getElementById('subarch').value='Media';
		document.getElementById('unauth').value='1';
		document.getElementById('xargs').value=href;
		document.getElementById('xargs2').value=emailaddy;
		showup(['page','subarch','unauth','xargs','xargs2','txtComment','NO_CACHE'],['divprocess2'],['POST']);	

			
	}
//	alert(href+"\n"+emailaddy);	
}
function hideEditVideo()
{
		document.getElementById('diveditvideo').removeChild(document.getElementById('ifVidEditor'));
		document.getElementById('diveditvideo').innerHTML=	storeEditHtml;
		new Effect.BlindUp('diveditvideo');
		myhighlight(document.getElementById('tdEditVideo'),'');	
}
function showEditVideo(UI,PI)
{
	switch(vidtab)
	{
		case 0:
		hideVidComments();
		break
		case 1:
		hideShareCode();
		break
		case 2:
		hideMoreFrom();
		break
		
		
	}
		//////
	if(vidtab != 3)
	{
		vidtab=3;
		var myif=document.createElement("iframe");
		myif.setAttribute("src","/VidEditor.bng?u="+UI+"&unique=" +PI);
		myif.setAttribute("width","400px");
		myif.setAttribute("height","400px");
		myif.setAttribute("scrolling","no");
		myif.setAttribute("frameborder","no");
		myif.setAttribute("align","left");
		myif.setAttribute("name","editframe"+UI+PI);
		myif.setAttribute("id","ifVidEditor");
		storeEditHtml=document.getElementById('diveditvideo').innerHTML;
		document.getElementById('diveditvideo').innerHTML='';
		document.getElementById('diveditvideo').style.height='290px';
		document.getElementById('diveditvideo').appendChild(myif);
		myhighlight(document.getElementById('tdEditVideo'),'#FF0000');
		new Effect.BlindDown('diveditvideo');
	}
	

}
var storeEditHtml='';
// JavaScript Document
function deleteChat(id)
{
	document.getElementById('txtshout').style.background='Red';
	//document.getElementById('divprocessshout').innerHTML='<img src="/bongsoft/images/loading8.gif" />';
	document.getElementById('subarch').value='ShoutBox';	
	document.getElementById('page').value='deleteShout';
	document.getElementById('unauth').value='0';
	$(txtshout).value=id;
	showup(['txtshout','page','subarch','unauth','NO_CACHE'],['divprocessshout']);

}
function checkShoutInput(e)
{
	    var keynum   

        //alert(e.type); 
        if(window.event) // IE
        {
        keynum = e.keyCode
        }
        else if(e.which) // Netscape/Firefox/Opera
        {
        keynum = e.which
        }
        if(keynum ==13){
               // TheForm.submit();
			//Authenticate2();
			postShout();
        }

	
}
var shoutstart=0;
var shoutlimit=0;

function loadShout(start,limit)
{
	shoutstart=start;
	shoutlimit=limit;
	document.getElementById('subarch').value='ShoutBox';	
	document.getElementById('page').value='shoutData';
	document.getElementById('unauth').value='1';
	document.getElementById('xargs2').value=start;
	document.getElementById('xargs').value=limit;

	showup(['xargs3','xargs2','page','subarch','xargs','unauth','NO_CACHE'],['divshoutbox']);
	//closeFolderDesc();
	setTimeout("loadShout(shoutstart,shoutlimit);",4000);
	
}

function postShout()
{
	document.getElementById('txtshout').style.background='Red';
	//document.getElementById('divprocessshout').innerHTML='<img src="/bongsoft/images/loading8.gif" />';
	document.getElementById('subarch').value='ShoutBox';	
	document.getElementById('page').value='postShout';
	document.getElementById('unauth').value='1';
	showup(['txtshout','page','subarch','unauth','NO_CACHE'],['divprocessshout']);
	
}
