	var lProfileIDJS;
	var sLocalSiteRootJS;

	var Fav_slideSpeed = 20;
	var Fav_timer = 5;

	var objectIdToSlideDown = false;
	var Fav_activeId = false;
	var Fav_slideInProgress = false;

	function showHideFav(e, inputId) {
		if (Fav_slideInProgress) return;
		Fav_slideInProgress = true;
		if (!inputId) inputId = this.id;
		inputId = inputId + '';
		var numericId = inputId.replace(/[^0-9]/g,'');
		var answerDiv = document.getElementById('Fav_a' + numericId);
		objectIdToSlideDown = false;
		
		if (!answerDiv.style.display || answerDiv.style.display == 'none') {		
			if (Fav_activeId &&  Fav_activeId != numericId) {	
				objectIdToSlideDown = numericId;
				slideContent(Fav_activeId,(Fav_slideSpeed*-1));
				}
			else {
				setFavVis('Fav_ac1', lProfileIDJS, '');
				answerDiv.style.display = 'block';
				answerDiv.style.visibility = 'visible';
				slideContent(numericId, Fav_slideSpeed);
				}
			}
		else {
			slideContent(numericId,(Fav_slideSpeed*-1));
			Fav_activeId = false;
			}	
		}

	function slideContent(inputId, direction) {
		
		var obj = document.getElementById('Fav_a' + inputId);
		var contentObj = document.getElementById('Fav_ac' + inputId);
		height = obj.clientHeight;
		if (height == 0) height = obj.offsetHeight;
		height = height + direction;
		rerunFunction = true;

		if (height > contentObj.offsetHeight){
			height = contentObj.offsetHeight;
			rerunFunction = false;
			}
		if (height <= 1){
			height = 1;
			rerunFunction = false;
			}
		obj.style.height = height + 'px';
		var topPos = height - contentObj.offsetHeight;
		if (topPos > 0) topPos = 0;
		contentObj.style.top = topPos + 'px';
		if (rerunFunction)
			setTimeout('slideContent(' + inputId + ',' + direction + ')', Fav_timer);
		else {
			if (height <= 1){
				obj.style.display='none'; 
				if(objectIdToSlideDown && objectIdToSlideDown != inputId) {
					document.getElementById('Fav_a' + objectIdToSlideDown).style.display = 'block';
					document.getElementById('Fav_a' + objectIdToSlideDown).style.visibility = 'visible';
					slideContent(objectIdToSlideDown, Fav_slideSpeed);				
					}
				else
					Fav_slideInProgress = false;
				}
			else {
				Fav_activeId = inputId;
				Fav_slideInProgress = false;
				}
			}
		}

	function initShowHideFav(lProfileIDLocalJS, sLocalRootPass) {

		var divs = document.getElementsByTagName('DIV');
		var divCounter = 1;
		for (var no = 0; no < divs.length; no++) {
			if (divs[no].className == 'FavHeader') {
				divs[no].onclick = showHideFav;
				divs[no].id = 'Fav_q' + divCounter;
				var answer = divs[no].nextSibling;
				while (answer && answer.tagName != 'DIV') 
					answer = answer.nextSibling;
				answer.id = 'Fav_a' + divCounter;	
				contentDiv = answer.getElementsByTagName('DIV')[0];
				contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	
				contentDiv.className = 'PageBack';
				contentDiv.id = 'Fav_ac' + divCounter;
				answer.style.display = 'none';
				answer.style.height = '1px';
				divCounter++;
				}		
			}	
			lProfileIDJS = lProfileIDLocalJS;
			sLocalSiteRootJS = sLocalRootPass;
			setFavVis('Fav_ac1', lProfileIDJS, '');
		}

	function setFavVis(obj, sProfID, sSort) {

		var sFavHTML;	
		sFavHTML = GetTextViaHTTP(sLocalSiteRootJS + '/Site-Tools/Favorites.asp?ProfileID=' + sProfID + '&Sort=' + sSort);
		window.parent.document.getElementById("Fav_ac1").innerHTML = sFavHTML;

		}

	function DeleteFavorite(lFavID, sTitle){
		var agree;
		agree = confirm('Are you sure you want to remove "' + sTitle + '" from your list of favorite?');
		if (agree) {
			document.FavForm.FavID.value = lFavID;
			document.FavForm.FavMode.value = "DeleteFav";
			document.FavForm.submit();
			}
		}

	var xmlFavReq;

	function GetTextViaHTTP(xmlURL) {
		xmlFavReq = false;
	    // branch for native XMLHttpRequest object
	    if(window.XMLHttpRequest && !(window.ActiveXObject)) {
	    	try { xmlFavReq = new XMLHttpRequest(); } 
	        catch(e) {
				xmlFavReq = false;
				}
			} 
		// branch for IE/Windows ActiveX version
	    else if(window.ActiveXObject) {
	       	try { xmlFavReq = new ActiveXObject("Msxml2.XMLHTTP"); } 
	      	catch(e) {
	        	try { xmlFavReq = new ActiveXObject("Microsoft.XMLHTTP"); } 
	        	catch(e) {
	          		xmlFavReq = false;
	        		}
				}
			}
		if(xmlFavReq) {
			xmlFavReq.onreadystatechange = GetXMLViaHTTPStatus;
			xmlFavReq.open("GET", xmlURL, false);
			xmlFavReq.send("");
			return xmlFavReq.responseText;
			}
		}	



	function GetXMLViaHTTPStatus() {
	    // only if xmlFavReq shows "loaded"
	    if (xmlFavReq.readyState == 4) {
	        // only if "OK"
	        if (xmlFavReq.status == 200) {
	            // ...processing statements go here...
				} 
	        else {
	            alert("There was a problem retrieving the XML data:\n" + xmlFavReq.statusText);
				}
			}
		}






	var panes = new Array();

	function setupPanes(containerId, defaultTabId) {
	  // go through the DOM, find each tab-container
	  // set up the panes array with named panes
	  // find the max height, set tab-panes to that height
	  panes[containerId] = new Array();
	  var maxHeight = 0; var maxWidth = 0;
	  var container = document.getElementById(containerId);
	  var paneContainer = container.getElementsByTagName("div")[0];
	  var paneList = paneContainer.childNodes;
	  for (var i=0; i < paneList.length; i++ ) {
	    var pane = paneList[i];
	    if (pane.nodeType != 1) continue;
	    if (pane.offsetHeight > maxHeight) maxHeight = pane.offsetHeight;
	    if (pane.offsetWidth  > maxWidth ) maxWidth  = pane.offsetWidth;
	    panes[containerId][pane.id] = pane;
	    pane.style.display = "none";
	  }
	    paneContainer.style.height = maxHeight + "px";
	    paneContainer.style.width  = maxWidth + "px";
	    document.getElementById(defaultTabId).onclick();
	}

	function showPane(paneId, activeTab) {
	  // make tab active class
	  // hide other panes (siblings)
	  // make pane visible
	  
	    for (var con in panes) {
	    activeTab.blur();
	    activeTab.className = "tab-active";
	    if (panes[con][paneId] != null) { // tab and pane are members of this container
	      var pane = document.getElementById(paneId);
	      pane.style.display = "block";
	      var container = document.getElementById(con);
	      var tabs = container.getElementsByTagName("ul")[0];
	      var tabList = tabs.getElementsByTagName("a")
	      for (var i=0; i<tabList.length; i++ ) {
	        var tab = tabList[i];
	        if (tab != activeTab) tab.className = "tab-disabled";
	      }
	      for (var i in panes[con]) {
	        var pane = panes[con][i];
	        if (pane == undefined) continue;
	        if (pane.id == paneId) continue;
	        pane.style.display = "none"
	      }
	    }
	  }
	  return false;    
	}

	function OpenURL(sURL, sHandle) {
		if (sHandle != '') {window.open(sURL, sHandle);}
		else {document.location.href = sHandle;}
		}
		
	function AddFavorites(){
		if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
			var url = "http://" + sPageURLJS;
			var title = sPageTitleJS;
			window.external.AddFavorite(url,title);
			}
		else {
			var msg = "This browser does not support automated bookmarking!  Please use your browser functions to add Artistopia to your favorites.";
			if(navigator.appName == "Netscape") 
				alert(msg);
			}
		}
		