function openAddFeaturedWidgetWindow(widgetID, widgetWidth, widgetHeight, thumbnailFile) {
 self.location =servlet + "addwidget?&widgetWidth="+ widgetWidth + 
   "&widgetHeight="+ widgetHeight + "&thumbnailFile=" + thumbnailFile +
   "&widgetId="+widgetID+ "&sl=0&st=0";
}
/**
//ADD featured widget in a pop up, this is not currently used
//openAddFeaturedWidgetWindow is used instead.
 function openAddFeaturedWidgetPopup(widgetID, widgetWidth, widgetHeight, thumbnailFile) {
  sl = document.body.scrollLeft;
  st = document.body.scrollTop;	   
  h = 725;
  w = 650;
  currentDate = new Date();
   addWidgetPopup = window.open (servlet + "addwidget?&widgetWidth="+ widgetWidth + 
   "&widgetHeight="+ widgetHeight + "&thumbnailFile=" + thumbnailFile +
   "&widgetId="+widgetID+
  	"&sl=" + sl + "&st=" + st +
    "&popup=y&r=" + currentDate.getTime(),
	"AddWidgetPopup" + currentDate.getTime(), "toolbar=no,scrollbars=yes,location=no,width=" + w +
	",height=" + h + "," + "top=" + ((screen.height-h)/2) + 
	",left=" + ((screen.width-w)/2));
  if (addWidgetPopup != null)
    addWidgetPopup.focus();
} 

//ADD featured game in a window like the widget, not currently used
//openAddFeaturedGamePopup is used instead.
function openAddFeaturedGameWindow(gameID) { 
  self.location = servlet + "playgame?&gameID=" + gameID +
  	"&sl=0&st=0&showPageList=true";
}**/

//ADD featured game as a pop up
function openAddFeaturedGamePopup(gameID) {
  sl = document.body.scrollLeft;
  st = document.body.scrollTop;	   
  h = 725;
  w = 650;
  currentDate = new Date();
   addGamePopup = window.open (servlet + "playgame?gameID=" + gameID +
  	"&sl=" + sl + "&st=" + st + "&showPageList=true" +
    "&popup=y&r=" + currentDate.getTime(),
	"AddGamePopup" + currentDate.getTime(), "toolbar=no,scrollbars=yes,location=no,width=" + w +
	",height=" + h + "," + "top=" + ((screen.height-h)/2) + 
	",left=" + ((screen.width-w)/2));
  if (addGamePopup != null)
    addGamePopup.focus();
}

function openAddFeaturedVideoPopup(guid) {
  sl = document.body.scrollLeft;
  st = document.body.scrollTop;	   
  h = 590;
  w = 950;
  currentDate = new Date();
  addVideoPopup = window.open (servlet + "browsefeaturedvideos?siteid=" + siteID + "&guid=" + guid +
  	"&sl=" + sl + "&st=" + st +
    "popup=y&r=" + currentDate.getTime(),
	"AddVideoPopup" + currentDate.getTime(), "toolbar=no,scrollbars=yes,location=no,width=" + w +
	",height=" + h + "," + "top=" + ((screen.height-h)/2) + 
	",left=" + ((screen.width-w)/2));
  if (addVideoPopup != null)
    addVideoPopup.focus();
}

function showFriendsHistory()
{
	document.getElementById("lobbyFriendHistory").style.display="block";
	document.getElementById("friendHistoryViewAll").style.display="block";
		document.getElementById("lobbyMyFriends").style.display="none";
}

function showMyFriends()
{
	document.getElementById("lobbyFriendHistory").style.display="none";
	document.getElementById("friendHistoryViewAll").style.display="none";
	document.getElementById("lobbyMyFriends").style.display="block";
}
function scrollDiv(divName, amount) {
	var divScroll = document.getElementById(divName);
	if (amount < 0) {
		if (divScroll.scrollLeft > amount)
			divScroll.scrollLeft+=amount;
		else
			divScroll.scrollLeft = 0;
	}	else if (amount > 0) {
		if(divScroll.scrollLeft + amount < divScroll.scrollWidth)
			divScroll.scrollLeft+=amount;
		else
			divScroll.scrollLeft = divScroll.scrollWidth;
	}
	
}
