// JavaScript Document
var loading1=new Image();
loading1.src="/bongsoft/images/newProfile/loading1.gif";

function hideMiddle()
{
	new Effect.Fade('divMiddle');	
}
function sendmessage2(uid)
{
	if(userid < 1){modalert("You must be logged in to send messages",1,0,'confirmAlert();','confirmAlert()');}	
	else{sendmessage(uid);}
}
var nextI=0;
var prevI=0;
var startI=0;

function expandPhotos(uid,start,pid)
{
	var mystart=0;
	var noload=0;
	if(pid == undefined){pid = 0;}
	if(start != undefined){mystart=start;noload=1;}

	if(noload == 0)
	{
		var mediadiv=document.getElementById('divMiddle');
		mediadiv.style.display='block';
		mediadiv.style.visibility='visible';
		mediadiv.innerHTML='<center><table width="795" class="boxExpandMedia" cellspacing="0" cellpadding="0" ><TR><TD class="expandedMediaHeader" align="left"><table width="790" cellpadding="0" cellspacing="0" class="expandedHeader"><TR><TD align="left">Loading</TD><TD width="26" align="left"><img style="cursor:pointer" onClick="javascript:hideMiddle()" src="/bongsoft/images/newProfile/x1.gif" /></TD></TR></TABLE></TD></TR><TR><TD class="expandedMediaData"> <img src="/bongsoft/images/newProfile/loading1.gif" /></TD></TR><TR><TD class="expandedMediaBottom"></TD></TR>	</table></center>';
	
	}
	document.getElementById('subarch').value='newProfile';
	document.getElementById('page').value='expandPhotos';
	document.getElementById('unauth').value='1';
	document.getElementById('xargs').value=uid;
	document.getElementById('xargs2').value=mystart;
	document.getElementById('xargs5').value=pid;	
	showup(['page','subarch','unauth','xargs','xargs5','xargs2','NO_CACHE'],['divMiddle']);	
}
function FivePhotos(uid,start,pid)
{
	startI=start;
	nextI=startI+1;
	prevI=startI-1;
	if(pid == undefined){pid = 0}
	document.getElementById('subarch').value='newProfile';
	document.getElementById('page').value='FivePhotos';
	document.getElementById('unauth').value='1';
	document.getElementById('xargs').value=uid;
	document.getElementById('xargs2').value=start;
	document.getElementById('xargs5').value=pid;
	showup(['page','subarch','unauth','xargs5','xargs','xargs2','NO_CACHE'],['divFivePhotos']);	
		
}
function hide_photo()
{
	new Effect.Fade('divViewPhoto');	
}
function click_photo(myel,uid,pid)
{

//	document.getElementById('divViewPhoto');	

	var thesrc="";
	thesrc=myel.src;	
	if(thesrc == undefined){
		thesrc='http://osite.rispeed.com/bongsoft/images/musicnote.gif';	
	}

new Effect.Appear('divViewPhoto');
	document.getElementById('divViewPhoto').innerHTML='	<table width="100% class="mainViewPhoto"><TR><TD align="left" valign="top"><div style="display:inline" id="divCaption"><img src="/bongsoft/images/newProfile/loading2.gif" />Loading Image Data</div></TD><TD align="right"><img src="/bongsoft/images/newProfile/x2.gif" style="cursor:pointer" onclick="hide_photo()" /></TD></TR></table><hr color="black" size="1"><table class="photoData" align="center"><TR><TD width="210">	<img width="200" src="'+thesrc+'" class="viewingPhoto" /></TD>	<TD class="viewPhotoRight" valign="top" align="left"><div style="display:inline" id="divPhotoRight"><img src="/bongsoft/images/newProfile/loading2.gif" /> </div></TD>	</TR></TABLE><table width="100%" cellpadding="0" cellspacing="0"><TR><TD><div id="divPhotoComments" style="display:none" class="photoComments" width="100%"></div></TD></TR></TABLE>';


	document.getElementById('subarch_2').value='newProfile';	
	document.getElementById('page_2').value='viewPhoto';
	document.getElementById('unauth_2').value='1';
	document.getElementById('xargs_2').value=thesrc;
	document.getElementById('xargs3').value=uid;
	document.getElementById('xargs4').value=pid;
	showup(['page_2','subarch_2','unauth_2','xargs_2','xargs3','xargs4','NO_CACHE'],['divPhotoRight']);	
}


function newPhotoComment()
{
	
	document.getElementById('divNewComment').style.display='block';
	
}
function viewPhotoComments(uid,pid,start)
{
	document.getElementById('divPhotoComments').style.display='block';
	document.getElementById('divPhotoComments').innerHTML='<img src="/bongsoft/images/newProfile/loading2.gif" />';
	document.getElementById('subarch_2').value='newProfile';	
	document.getElementById('page_2').value='photoComments';
	document.getElementById('unauth_2').value='1';
	document.getElementById('xargs_2').value=uid
	document.getElementById('xargs3').value=pid;
	document.getElementById('xargs4').value=start;
	showup(['page_2','subarch_2','unauth_2','xargs_2','xargs3','xargs4','NO_CACHE'],['divPhotoComments']);	
	
//	centeredmodalert("Try this later!",1,0,'confirmAlert()','confirmAlert()');	
}
function embedProfileSong(uid,pid,thediv)
{
		var mydiv='';

		if(thediv == undefined){
				mydiv='divEmbedSong';
		}
		else{mydiv=thediv;}
		
		var mydiv=document.getElementById(mydiv);
		mydiv.style.textAlign='center';
		mydiv.style.display='block';
		var fo = new SWFObject("/AudPlayer/AudPlayer.swf", "audPlayer", "200", "70", 8, "#000000", false);
//		var agen='/audiogen.bng?u=' + uid + '&unique=' + pid;		//
		fo.addVariable("u",uid);		
		fo.addVariable("p",pid);
		fo.write(mydiv);

}
function embedProfileVideo(uid,pid)
{

		var mydiv=document.getElementById('divPhotoComments');
		mydiv.style.textAlign='center';
		mydiv.style.display='block';
		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", server);//
		fo.addVariable("i", imageserver);
		
		fo.write('divPhotoComments');

}
