function GetTabContent(val)
{
	myRand=parseInt(Math.random()*99999999);
	strUrl = WWWROOT+"/account/PostDbAlbums.php?page=dashboard&rand="+myRand+"&seltab="+val;
	new Ajax.Request(strUrl, {
  	method: 'get',
 	 onSuccess: function(transport) { 	
	 	document.getElementById('divTabContent').innerHTML=transport.responseText;	

	  }
	});	
}
function OpenInviteWindow(ab)
{
	ajaxwin_invite=dhtmlwindow.open("Invite Friends", "iframe", WWWROOT+"/account/invite.php?ab="+ab, "Invite Friends on Pixable", "width=525px,height=410px,left=300px,top=100px,resize=0,scrolling=1")
    ajaxwin_invite.onclose=function(){return true};
}
function OpenDemoVideo()
{  
   ajaxwin1=dhtmlwindow.open("ajaxbox", "iframe", WWWROOT+"/homeflash/demo.html", "How it works", "width=510px,height=290px,left=300px,top=100px,resize=0,scrolling=1")
    ajaxwin1.onclose=function(){return true}
}
function ShowHideDiv(val)
{
	if(val == 'aboutme' )
	{
		document.getElementById('aboutmediv').style.display = 'none';	
		document.getElementById('editaboutme').style.display = '';
	}
	else
	{
		document.getElementById('captiondiv').style.display = 'none';	
		document.getElementById('editcaptiondiv').style.display = '';
	}
}
function GetAlbumTabContent(val)
{
	myRand=parseInt(Math.random()*99999999);
	strUrl = WWWROOT+"/account/PostDbAlbums.php?page=dashboard&rand="+myRand+"&seltab="+val;
	new Ajax.Request(strUrl, {
  	method: 'get',
 	 onSuccess: function(transport) { 	
	 	document.getElementById('divTabContent').innerHTML=transport.responseText;	
		star.revertonload(document.getElementById('totalRating').value);		
		star.num = document.getElementById('totalRating').value;
	  }
	});	
}
function GetPage(pge, rec, type,ord,sby)
{
	document.getElementById('divloadprocess').style.display='';
	myRand=parseInt(Math.random()*99999999);
	seltab = document.getElementById('hdnSelTab').value;
	strUrl = WWWROOT+"/account/PostDbAlbums.php?page=dashboard&rand="+myRand+"&_pge="+pge+"&_rec="+rec+"&_ord="+ord+"&_sby="+sby+"&seltab="+seltab;
	
	new Ajax.Request(strUrl, {
  	method: 'get',
 	 onSuccess: function(transport) { 
	 	document.getElementById('divTabContent').innerHTML=transport.responseText;	
		document.getElementById('divloadprocess').style.display='none';
	  }
	});	
}

function GetFbAlbumContent()
{
	document.getElementById('showFbAlbumLoad').style.display='';
	myRand=parseInt(Math.random()*99999999);
	strUrl = WWWROOT+"/account/PostfbAlbums.php?rand="+myRand;
	new Ajax.Request(strUrl, {
  	method: 'get',
	evalJS : true,
 	 onSuccess: function(transport) { 
	 	text=transport.responseText.split("|||||");
	 	document.getElementById('divFbAlbumContent').innerHTML=text[0];
	 	document.getElementById('xfbTotalAlbums').innerHTML=text[1];
	 	document.getElementById('xfbTotalPhotos').innerHTML=text[2];
		document.getElementById('showFbAlbumLoad').style.display='none';
	  }
	});	
}

function GetDbAlbumContent()
{
	document.getElementById('divloadcontent').style.display='';
	myRand=parseInt(Math.random()*99999999);
	strUrl = WWWROOT+"/account/PostDbAlbums.php?rand="+myRand;
	new Ajax.Request(strUrl, {
  	method: 'get',
	evalJS : true,
 	 onSuccess: function(transport) { 
	 	text=transport.responseText;
	 	document.getElementById('divTabContent').innerHTML=text;
		document.getElementById('divloadcontent').style.display='none';
		
	  }
	});	
}

function GetFbAccountUserInfo()
{

	myRand=parseInt(Math.random()*99999999);
	strUrl = WWWROOT+"/account/PostfbAccount.php?rand="+myRand;
	new Ajax.Request(strUrl, {
  	method: 'get',
	evalJS : true,
 	 onSuccess: function(transport) { 
	 	text=transport.responseText.split("|||||");
	
		strimg='<img src="'+text[1]+'" class="UIRoundedImage_Image"/>';
		strimg+='<span class="UIRoundedImage_Corners">';
		strimg+=' <img class="UIRoundedImage_CornersSprite" alt="" src="'+WWWROOT+'/images/UIRoundedImage.png?8:156558"/>';
		strimg+='</span>';		
		 
	 	document.getElementById('xdivUserInfoName').innerHTML=text[0];
	 	document.getElementById('xdivUserPic').innerHTML=strimg;
		//document.getElementById('xShowInfoLoader').style.display='none';
	  }
	});	
}


function GetFbAlbumPhotosContent(id)
{
	//document.getElementById('xShowInfoLoader').style.display='';
	myRand=parseInt(Math.random()*99999999);
	strUrl = WWWROOT+"/account/PostfbAlbumPhotos.php?rand="+myRand+"&albumid="+id;
	new Ajax.Request(strUrl, {
  	method: 'get',
	evalJS : true,
 	 onSuccess: function(transport) { 
	 	var pics=transport.responseText;
		arrpics=pics.split(',');
		var start_set='[';
		var inner_set='';
		for(i=0;i<arrpics.length;i++)
		{
		  inner_set+="{'caption':'', 'url': '"+arrpics[i]+"'},"
		}
		var inner_set = inner_set.substring(0, inner_set.length-1);
		var last_set='];';		
		var page_set=eval(start_set + inner_set + last_set);
		//document.getElementById('xShowInfoLoader').style.display='none';
		return GB_showImageSet(page_set, 1);
	  }
	});	
}



function GetFbAlbumPageContent(pge)
{
	
	document.getElementById('showFbAlbumLoad').style.display='';
	myRand=parseInt(Math.random()*99999999);
	strUrl = WWWROOT+"/account/PostfbAlbums.php?rand="+myRand+"&_pge="+pge;
	new Ajax.Request(strUrl, {
  	method: 'get',
	evalJS : true,
 	 onSuccess: function(transport) { 
	 
	 text=transport.responseText.split("|||||");
	 document.getElementById('divFbAlbumContent').style.display='';
	 document.getElementById('divFbAlbumContent').innerHTML=text[0];
	 document.getElementById('xfbTotalAlbums').innerHTML=text[1];
	 document.getElementById('xfbTotalPhotos').innerHTML=text[2];
	 document.getElementById('showFbAlbumLoad').style.display='none';
     if(pge!=1)
	   document.getElementById('link1').style.color='';
	   document.getElementById('link'+pge).style.color='#ffa34c';

	  }
	});	
}

function CopyAlbum(albumid,selTab)
{
	var myRand=parseInt(Math.random()*99999999);
	strUrl = WWWROOT+"/account/copyalbum.php?rand="+myRand+"&albumid="+albumid;
	new Ajax.Request(strUrl, {
  	method: 'get',
	evalJS : true,
 	 onSuccess: function(transport) { 
	  	alert(transport.responseText);
		if(selTab){
			TabDashboardAlbum(selTab);
		}
	  }
	});	
}

function AlbumSettings(albumid,selTab)
{
	ajaxwin_invite=dhtmlwindow.open("Pixable album settings", "iframe", WWWROOT+"/account/albumsettings.php?albumid="+albumid, "Pixable album settings", "width=580px,height=390px,left=300px,top=100px,resize=0,scrolling=1")
    ajaxwin_invite.onclose=function(){
		TabDashboardAlbum(selTab);
		return true;
	};
}

function ShareAlbumWithFriends(albumid)
{
	ajaxwin_invite=dhtmlwindow.open("Share pixable album with friends", "iframe", WWWROOT+"/account/sharealbumwithfriends.php?albumid="+albumid, "Share pixable album with friends", "width=500px,height=450px,left=300px,top=100px,resize=0,scrolling=1")
    ajaxwin_invite.onclose=function(){return true};
}