// JavaScript Document
var loadingIndicator = "<div style='height:200px;'><span class='LoadingIndicator'><img src='images/indicators/indicator_progress_circles.gif' align='absmiddle'>Loading {cType} for {cName}</span></div>"

var celebrityTabs = Array("TabNews","TabImages","TabBooks","TabVideos","TabMusic","TabDVDs");
function showCollectionContent(cType,cName,cId) {
	document.getElementById("TabInnerContent").innerHTML = getLoadingText(cType,cName);
	InActiveAllTabs();
	ActiveTab(document.getElementById("Tab" + cType));
	ShowTitle(cType,cName);
	LoadCollections(cType,cName,cId);
}
function getLoadingText(cType,cName) {
	strLoadingText 	= loadingIndicator.replace("{cType}",cType);
	strLoadingText	= strLoadingText.replace("{cName}",cName);
	return strLoadingText;	
}
function InActiveAllTabs() {
	for(i = 0;i<celebrityTabs.length;i++)
		InActiveTab(document.getElementById(celebrityTabs[i]));
}

function InActiveTab(cTab) {
	cTab.className = "TabInActive";
}

function ActiveTab(cTab) {
	cTab.className = "TabActive";
}

function ShowTitle(cType,cName) {
	document.getElementById("TabContentTitle").innerHTML = cType + " related to " + cName;
}

function LoadCollections(cType,cName,cId) {
	var success = function(t){LoadCollectionsContent(t,cType,cName);}
	var failure = function(t){LoadFailed(t);}
	var url = "celebrity.php";
	var pars = 'id='+cId+'&op=celebrity'+cType;
    var myAjax = new Ajax.Request(url, {method:'post',postBody:pars, onSuccess:success, onFailure:failure});
}

function LoadCollectionsContent(t,cType,cName) {
	strContent = t.responseText;
	if(strContent == "")
		strContent = '<div id="CelebrityFullGallery"><div id="CelebrityNewsNoData">No ' + cType + ' found for ' + cName + '</div></div>'
	document.getElementById('TabInnerContent').innerHTML 	= strContent;
}
