function playVideo(_8){
	window.open(_8, "", "width=800,height=800,location=yes,menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,directories=yes");
}
function getEl( id ){ return document.getElementById( id ); }
// Login Functions
function AsnsSignIn( obj, leftOffSet, topOffSet, ele ) {
	if (!leftOffSet) leftOffSet = 0;
	if (!topOffSet) topOffSet = 0;
	var pSNS = getEl(ele);
	pSNS.innerHTML = "";
	pSNS.innerHTML += _sns_var_;
	if ( document.all ) {
		var pos = findPos(obj);
		pSNS.style.position = 'absolute';
		pSNS.style.left = (pos[0] + leftOffSet - 138) + 'px';
		pSNS.style.top =  (pos[1] + topOffSet + 12)  + 'px';
} else {
		obj.appendChild(pSNS);
		pSNS.style.left = leftOffSet + 'px';
		pSNS.style.top =  topOffSet  + 'px';
		pSNS.style.position = 'relative';
		}
	var close = document.createElement("span");
	var a = document.createElement("a");
	a.href = 'javascript:AsnsClose("'+ele+'")';
	a.title = "close";
	var img = document.createElement("img")
	img.src = "http://my.screenname.aol.com/images/10x10_x.gif";
	img.style.border = "0px"
	a.appendChild(img);
	close.appendChild(a);
	spans = pSNS.getElementsByTagName("span");
	spans[1].style.cssFloat = "right";
	spans[1].style.styleFloat = "right";
	spans[1].style.margin = "1px 0px 0px 10px";
	close.style.cssFloat = "right";
	close.style.styleFloat = "right";
	close.style.margin = "2px 2px 0px 0px";
	spanPar = spans[1].parentNode;
	spanPar.insertBefore(close,spans[1]);
	pSNS.style.zIndex = 5000;
	pSNS.style.display = "block";
}
function closeSNS(ele) {
	getEl(ele).innerHTML = '';
}

function AsnsClose(ele) {
	pSNS = getEl(ele);
	pSNS.style.display = "none";
}

function findPos(obj) {
	var curleft = curtop = 0;
	curleft = getX(obj);
	curtop = getY(obj);
	return [curleft,curtop];
}
function getY( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function getX( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}
/* Header functions*/
// Tog More for Search
function togMore(sShow){
	if (sShow == "hide"){
		getEl("srchMoreId").style.display = "none";
	}
	else{
		getEl("srchMoreId").style.display = "block";
	}
	return false;
}

// Begin : Headers 2 code
function p_o(o){return getEl(o);}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function srchSub(ref){
	var frm=p_o("search");
	var queryval = frm.topQuery.value.trim();
	queryval = queryval.replace( /\+/, " ");
	if(ref == 'a'){
		var newurl = frm.action + queryval;
		if (frm.target == '_blank') {
			window.open(newurl, '_blank', '');
		} else {
			window.location = newurl;
			}
	}else{
		var newurl = ref.href + queryval;
		window.location = newurl;
	}
	return false;
}

function searchTarget(url, newWindow, newTarget) {
	// Set the target for the form
	document.bb_topform.action = url;
	if (newWindow) {
		document.bb_topform.target = '_blank';
	} else {
		document.bb_topform.target = '';
	}

	// Update the tabs classes to allow highlighting of the selected
	var tabList = ["searchTabNews","searchTabWeb","searchTabImages","searchTabVideo","searchTabLocal","searchTabBV"]
	for(var i=0;i<tabList.length;i++){
	getEl(tabList[i]).className = '';
	}
	getEl(newTarget).className = 'srchCatBg';

	return false;
}

function eventIsEnterKey(event) {
	if (event && event.which == 13 || window.event && window.event.keyCode == 13 || event && event.which == 3 || window.event && window.event.keyCode == 3) {
		return true;
	}
	return false;
}

function submitHeaderSearch(event) {
	if (event == "onclick" || eventIsEnterKey(event)) {
		return srchSub("a");        
	} else {
	return true;
	}
}

//Prevent IE flickr
try {
	document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

function hideHeaderMore(e) {
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;

	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;

	if(targ.id != 'srchMoreAnc') {
    	var oDiv=p_o('srchMoreId');

		if(oDiv.style.display.toLowerCase() == "block") 
			oDiv.style.display='none';
	}
}

document.onclick = hideHeaderMore;
/*end header functions*/

// Tag Cloud/List (Blog Chatter)
function showTags(){
	if (iTagType == 1) // Show as Cloud
		{
			caption = "List";
			iTagType = 2;
			getEl("tagCloud").style.display = "block";
			getEl("newsTagList").style.display = "none";
		} 
		else // Show as List
		{
			caption = "Cloud";
			iTagType = 1;
			getEl("tagCloud").style.display = "none";
			getEl("newsTagList").style.display = "block";
		}
			getEl("newsTagTypeAnc").innerHTML = caption;
}
// End: Tag Cloud/List (Blog Chatter)
function showToolTip(oCaller, ttID){getEl(ttID).style.display = "block";}
function hideToolTip(oCaller, ttID){getEl(ttID).style.display = "none";}

function changeSort(sort){
	setPref("sort", sort);
	getEl('frmHubSrt').submit()
	return false;
}

function changeTimePeriod(){
	var i = document.frmHubSrt.timePeriodSelect.selectedIndex;
	setPref("timePeriod", document.frmHubSrt.timePeriodSelect[i].value);
	document.frmHubSrt.submit();  
}

function changeSource(){
	var i = document.frmHubSrt.sourceSelect.selectedIndex;
	setPref("source",document.frmHubSrt.sourceSelect[i].value);
	document.frmHubSrt.submit();
}

function goToHub() {
	var query = getEl("searchText").value;
	if(query == "" || query == "Enter Keywords") {
		return false;
	} else {
		setPref("sort",'mostRecent');
		 var hostname = location.host;
		 var newLocation = "http://" + hostname + "/videos/?query=" + escape(query);
		 window.location = newLocation;
	}
}

function evntIsEnerKy(event) {
	if (event && event.which == 13 || window.event && window.event.keyCode == 13 || event && event.which == 3 || window.event && window.event.keyCode == 3) {
	    return true;
	}
	return false;
}
function searchTxt(event){
	if (event == "onclick" || evntIsEnerKy(event)) {
		return	goToHub();    
	} else {
		return true;
	}
}

function textAppear(id,obj,img,size){
var ul=getEl("sortimg");
if(ul.childNodes != null){
	for (var i=1;i<=size;i++) {
		getEl("vid"+i).style.display="";
		getEl("vid1"+i).style.display="none";
	}
	var imagePlace = getEl(id);
	imagePlace.style.display="block";
	obj.style.display="none";
	imagePlace.style.background='url('+img+')';
}
}

function textHide(size){
	for (var i=1;i<=size;i++) {
		getEl("vid"+i).style.display="";
		getEl("vid1"+i).style.display="none";
	}
}

function changeVw(bkgrnd,vw){
	var o = document.getElementById("listHeaderTop");
	if(vw == "grid"){
					getEl("gridImg").src="http://www.aolcdn.com/ch_news/grid-gray.gif";
					bkgrnd.parentNode.className ="viewHoverDiv";
					getEl("listImg").src="http://www.aolcdn.com/ch_news/list-blue.gif";
					getEl("listBk").parentNode.className="viewDiv";
					if (o) {
						getEl("listHeaderTop").style.display="none";
						getEl("listHeaderBottom").style.display="none";
					} else {
						getEl("listHeader").style.display="none";
					}
	}
	else{
					getEl("listImg").src="http://www.aolcdn.com/ch_news/list-grey.gif";
					bkgrnd.parentNode.className ="viewHoverDiv";
					getEl("gridImg").src="http://www.aolcdn.com/ch_news/grid-blue.gif";
					getEl("gridBk").parentNode.className="viewDiv";
					if (o) {
						getEl("listHeaderTop").style.display="";
						getEl("listHeaderBottom").style.display="";
					} else {
						getEl("listHeader").style.display="";
					}
	}
	if (o) {
		getEl("resultSetTop").className = vw;
		getEl("resultSetBottom").className = vw;
	} else {
		getEl("resultSet").className = vw;
	}
	setPref("view", vw);

	return true;
}

/*user ratings starts */
function rtngOver(element, starOverURL){
	element.style.cursor = 'hand';
	var baseId = element.getAttribute('baseId');
	var starNum = element.getAttribute('starNum');
	for(i=1;i<=starNum;i++)
	{
		var myEl = getEl(baseId + i);
		myEl.src = starOverURL;
	}
}

function rtngOut(element)
{
	element.style.cursor = 'auto';

	var baseId = element.getAttribute('baseId');
	var starNum = element.getAttribute('starNum');

	for(i=1;i<=starNum;i++) {
		var myEl = getEl(baseId + i);
		myEl.src = myEl.getAttribute('oSrc');
	}
}

function submitRating(rating,vidId,url,subCategory){
	var request = getHTTPObject();
	if(request){
		request.onreadystatechange = function(){
		displayRatingResponse(request, rating);
	};
	request.open("POST", url, true);
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	request.send("id="+vidId+"&rating="+rating+"&subCategory="+subCategory);
}}

function displayRatingResponse(request, rating){
	if(request.readyState == 4){
		if(request.status == 200){
			var element = getEl("videoDetailContainer");
			element.innerHTML = request.responseText;
			getEl("beforeRating").style.display = "none";
			getEl("afterRating").style.display = "block";
			for(var cnt=1;cnt<=rating;cnt++){
				var myEl = getEl("usrRtngStr20" + cnt);
				myEl.src = "http://www.aolcdn.com/ch_music2/star_blue_on";
			}
		}
	}
}

/*user ratings ends */

function changeCnt(cnt){
	setPref("resultsNbr", document.navcountgen.resultsNbr.value)
	document.navcountgen.submit();
	return true;
}

function clearText(obj){
	var headerQuery = obj.value;
	obj.value = '';
	obj.className="nobg";
}

function replaceText(obj){
	headerQuery = ""
	var target = obj.value.trim();
	obj.value = (target == "") ?  headerQuery : target;
	if (obj.value == "") {
		obj.className="";
	}
}

var type_error = "error";
var type_debug = "debug";
var isdebug = false;

function log( type, msgs ){
	var result = "";
	for (var i = 0; i < arguments.length; i++){
		result += " " + arguments[i];
	}
	if (type == type_debug && isdebug ) alert(result);
}

var logger = new function(){
	this.error = function(msgs){ log(type_error,msgs); };
	this.debug = function(msgs){ log(type_debug,msgs); };
}

if (typeof console == "undefined" || !console.error) {
	var console = {};
	console= logger;
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function setPref(param, value){
	var prefCookieName = "VCE-PREFS";
	var prefCookieString = "";
	var prefDelim = "&";
	var keyvalDelim = ":";
	var prefArray;
	var prefCookie = getCookie(prefCookieName);
	if ( prefCookie ) {
		prefArray = prefCookie.split(prefDelim);
	} else {
		prefArray = new Array();
	}

	var re = "^" + param + keyvalDelim;
	for (var i=0;i<prefArray.length;i++){
		if ( prefArray[i].search(re) <  0 ){
			if (prefCookieString != "" ){
				prefCookieString += prefDelim;
			}
			prefCookieString += prefArray[i];
		}
	}
	if (prefCookieString != "" )
		prefCookieString += prefDelim;

	prefCookieString += (param + keyvalDelim + value);
	setCookie(prefCookieName,prefCookieString,null);
	console.debug("prefCookieString: ",prefCookieString);
	}

function getHTTPObject(){
	var xhr = null;
	if (window.XMLHttpRequest){
		xhr = new XMLHttpRequest();
	} else {
		if (window.ActiveXObject){
			try {
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e) {
				try {
					xhr = new ActiveXObject("Microsoft.XMLHTTP");
					}
				catch (e) {
					xhr = null;
				}
			}
		}
	}
return xhr;
}

//adds a video id to the VCE-QUICKLIST cookie
function addToQuicklist(videoId, url){
	var vceCookieVal = getCookie("VCE-QUICKLIST");
	if(vceCookieVal){
		if(vceCookieVal.indexOf(videoId) == -1){
		var vIdArray = vceCookieVal.split(",");
		setCookie("VCE-QUICKLIST", addToArray(vIdArray, videoId), 365);
		var now = new Date();
		setCookie("VCE-LASTUPDATED", now.getTime(), 365);
		}
	}
	else setCookie("VCE-QUICKLIST", videoId, 365);
	var request = getHTTPObject();
	if(request){
	request.onreadystatechange = function(){
	displayResponse(request, "quickListContainer");
	};
	request.open("POST", url, true);
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	request.send("videoId="+videoId);
	}
}

//removes a video id from the VCE-QUICKLIST cookie
function removeFromQuicklist(videoId, url){
	var vceCookieVal = getCookie("VCE-QUICKLIST");
	if(vceCookieVal != null && vceCookieVal != ""){
	var vIdArray = vceCookieVal.split(",");
	vIdArray = removeFromArray(vIdArray, videoId);
	setCookie("VCE-QUICKLIST", vIdArray, 365); 
	var now = new Date();
	setCookie("VCE-LASTUPDATED", now.getTime(), 365);
	}
	var request = getHTTPObject();
	if(request){
	request.onreadystatechange = function(){
	displayResponse(request, "quickListViewContainer");
	};
	if(vIdArray.length>0){
	request.open("POST", url, true);
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	request.send("videoId="+videoId);
	}
	else{getEl("quickListView").innerHTML="No Videos in list";}
	}
}

function updatePlaybackQuicklistNav(vId, url){
	var request = getHTTPObject();
	if(request){
	request.onreadystatechange = function(){
	displayResponse(request, "playbackQuicklistNavContainer");
	};
	request.open("POST", url, true);
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	request.send("id="+vId);
	}
}

function update(vId, url){
	var request = getHTTPObject();
	if(request){
	request.onreadystatechange = function(){
	displayResponse(request, "quickcentCont");
	};
	request.open("POST", url, true);
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	request.send("id="+vId);
	}

}

function addComment(vId,subCategory,url){
	var comment="";
	var comnt = getEl("newComment").value;
	var txt="type your comment here";
	if(comnt == txt || comnt == "" || comnt == "null" || comnt.replace(/\s{2,}/gi," ") == " "){getEl("newComment").value="type your comment here";}
	else{
    comnt = comnt.replace(/\s{2,}/gi," ").replace(/\n/gi," <br/>");
	var str= comnt.split(" ");
	for(var i=0;i<str.length;i++){
		comment+=cutString(str[i],90)+" ";
		}
	var request = getHTTPObject();
	if(request){
	request.onreadystatechange = function(){
	displayResponse(request, "commentsContainer");
	};
	request.open("POST", url, true);
	request.setRequestHeader("Content-type","application/x-www-form-urlencoded;charset=UTF-8");
	request.send("id="+vId+"&subCategory="+subCategory+"&newComment="+comment);
	}
	}
}

function cutString (str, maxchars) {
		if(str&&str.length<maxchars) return str;
		else if(str) return (str.substring(0,maxchars).lastIndexOf(" ")>0)?str.substring(0,str.substring(0,maxchars).lastIndexOf(" ")):str.substring(0,maxchars);
		else return "";
	}

function updateMoreVideos(sort,url){
	var request = getHTTPObject();
	if(request){
	request.onreadystatechange = function(){
	displayResponse(request, "moreVideosContainer");
	};
	request.open("POST", url, true);
	request.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	request.send("sort="+sort);
}
}

//ajax callback function
function displayResponse(request, elementId){
	if(request.readyState == 4){
	var element = getEl(elementId);
	element.innerHTML = request.responseText;
	}
}

function updateCommentPagination(vId,resultsIndex,resultsNbr,url){
    setPref("resultsNbr", resultsNbr);
	var query="id="+vId+"&resultsIndex="+resultsIndex+"&resultsNbr="+resultsNbr;
	var request = getHTTPObject();
	if(request){
	request.onreadystatechange = function(){
	displayResponse(request, "commentsContainer");
	};
	request.open("POST", url, true);
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	request.send(query);
	}
}

function processKey(e){
	if (null == e)
	e = window.event;
	var browserName=navigator.appName;
	if (e.keyCode == 13 && browserName=="Microsoft Internet Explorer"){
	document.commentForm.submit();
	}	
}

//sets a cookie with the specified
//name, value and expiration date
function setCookie(name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+";path=/";
}

//returns the value of the
//specified cookie
function getCookie(cookieName){
	if (document.cookie.length>0){
	var start=document.cookie.indexOf(cookieName + "=");
	if (start!=-1){ 
	start=start + cookieName.length+1; 
	var end=document.cookie.indexOf(";",start);
	if (end==-1){
	end=document.cookie.length;
	}
	return unescape(document.cookie.substring(start,end));
	}
	}
	return null;
}

//removes the specified element from the
//current array
function removeFromArray(array, element){
	var newArray = new Array(array.length - 1);
	var ni = 0;
	var i = 0;
	for(; i < array.length;){
		if(array[i].indexOf(element) == -1){
		newArray[ni] = array[i];
		ni=ni+1; 
		}
		i=i+1;
	}
	return newArray;
}

//adds the specified element to the
//current array
function addToArray(array, element){
	var newArray = new Array(array.length);
	var l = array.length;
	var i = 0;
	if(array.length==20){
		for(; i < 20; ){
				newArray[i] = array[i];
				i=i+1;
		}
		alert("Quick List can only store 20 videos");
		return newArray;
	}
	else{
		newArray = new Array(array.length+1);
			for(; i < array.length; ){
				newArray[i] = array[i];
				i=i+1;
			}
			newArray[i] = element;
			return newArray;
	}
}

function shareOperation(iOperation,strTitle){
	var staf_obj = new staf_SE();
	staf_obj.setLang("en-US");
	var strUrl=location.href;
	if (strUrl != ""){
	staf_obj.setURL(strUrl);
	}
	if (strTitle != ""){
	staf_obj.setTitle(strTitle);
	}
	if (iOperation == 1){
	staf_obj.sendIM();
	}
	else{
	staf_obj.sendEmail();
	}
}

/* start of staf_init.js */

function staf_SE(){
	var omniture_tracking;
	// Email This variables
	var width, height;        // Width and Height of Email Popup
	var im_width, im_height;  // Width and Height of Email Popup
	var lang = "";            // Language parameter
	// IM Variables
	var message = "";        // IM Message
	var linkURL = "";        // Default URL is the current page.
	var pageTitle = "";      // Page Title
	var confirm = false;     // Confirmation pop-up window for non-AOL browsers
	// Launch IM
	var sendIM = function(){
		winl = (screen.width - im_width) / 2;
		wint = (screen.height - im_height) / 2;
		if (winl < 0) winl = 0;
		if (wint < 0) wint = 0;
		window.open("http://sendtoafriend.aol.com/im.adp?url=" + linkURL + "&title=" + pageTitle + "&lang=" + lang, "IM_Window", "height=" + im_height + ",width=" + im_width + ",top=" + wint + ",left=" + winl + ",statusbar=0,toolbar=0,menubar=0,location=0,resizable=0");
	}
	// Launch Email
	var sendEmail = function (){
		winl = (screen.width - width) / 2;
		wint = (screen.height - height) / 2;
		if (winl < 0) winl = 0;
		if (wint < 0) wint = 0;
		window.open("http://sendtoafriend.aol.com/?url=" + linkURL + "&title=" + pageTitle + "&lang=" + lang, "Email_Window", "height=" + height + ",width=" + width + ",top=" + wint + ",left=" + winl + ",statusbar=0,toolbar=0,menubar=0,location=0,resizable=0");
	}
	// Default Values
	var setDefault = function (){
		message = "Your friend wants you to check this out:";
		linkURL = escape(document.location);
		pageTitle = escape(document.title);
		confirm = false;
		width = 292;
		height = 500;
		im_width = 292;
		im_height = 150;
		lang = "en-US";
	}

	// Set default values.
	setDefault();
	return {
		sendIM: function(){
			if(omniture_tracking){
				setOmniStaf("IM");
			}
			sendIM();
		},
		sendEmail: function(){
			if(omniture_tracking){
				setOmniStaf("Email");
			}
			sendEmail();
		},
		setMessage: function(custom_message){
			if (typeof(custom_message) == "string"){
				message = custom_message;
			}
		},
		setWidth: function(custom_width){
			if (typeof(custom_width) == "number") {
				width = custom_width;
			}
		},
		setHeight: function(custom_height){
			if (typeof(custom_height) == "number"){
				height = custom_height;
			}
		},
		setIMWidth: function (custom_width) {
			if (typeof(custom_width) == "number") {
				im_width = custom_width;
			}
		},
		setIMHeight: function(custom_height){
			if (typeof(custom_height) == "number") {
				im_height = custom_height;
			}
		},
		setLang: function(custom_lang){
			if(typeof(custom_lang) == "string"){
				lang = custom_lang;
			}
		},
		setTitle: function(custom_title){
			if(typeof(custom_title) =="string"){
				pageTitle = escape(custom_title);
			}
		},
		setURL: function(custom_url){
			if (typeof(custom_url) =="string"){
				linkURL = escape(custom_url);
			}
		}
	};

}

// Tabbed support for Panel Modules below the Player
// Tab persistence set to NO
var tabPersistence=0 
var tabContentIDs=new Object()

function expandContent(linkobj){
	var ulid=linkobj.parentNode.parentNode.id
	var ullist=document.getElementById(ulid).getElementsByTagName("div")
	for (var i=0; i<ullist.length; i++){
		ullist[i].className="setbg"
			if (typeof tabContentIDs[ulid][i]!="undefined")
		document.getElementById(tabContentIDs[ulid][i]).style.display="none"
	}
	linkobj.parentNode.className="selected"
	document.getElementById(linkobj.getAttribute("rel")).style.display="block"
	saveSelectedTabContentID(ulid, linkobj.getAttribute("rel"))
}

function expandTab(tabcontentid, tabnumber) {
	var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
		if (thetab.getAttribute("rel"))
			expandContent(thetab)
}

function saveTabContentIDs(ulid, relattribute){
	if (typeof tabContentIDs[ulid]=="undefined")
		tabContentIDs[ulid]=new Array()
		tabContentIDs[ulid][tabContentIDs[ulid].length]=relattribute
}

function saveSelectedTabContentID(ulid, selectedtabid){
	if (tabPersistence==1)
		setTabCookie(ulid, selectedtabid)
}

function getULbyID(ulid, tabcontentid){
	var ullist=document.getElementById(ulid).getElementsByTagName("li")
	for (var i=0; i<ullist.length; i++){
		if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){
			return ullist[i].getElementsByTagName("a")[0]
		break
		}
	}
}

function initTabContent() {
	for (var i=0; i<arguments.length; i++){
	if (tabPersistence==0 && getTabCookie(arguments[i])!="")
	setTabCookie(arguments[i], "")
		var clickedontab=getTabCookie(arguments[i])
		var ulobj=document.getElementById(arguments[i])
		var ulist=ulobj.getElementsByTagName("div")
		for (var x=0; x<ulist.length; x++){
			var ulistlink=ulist[x].getElementsByTagName("a")[0]
			if (ulistlink.getAttribute("rel")){
				saveTabContentIDs(arguments[i], ulistlink.getAttribute("rel"))
				ulistlink.onclick=function(){
				expandContent(this)
			return false
		}
		if (ulist[x].className=="selected" && clickedontab=="")
			expandContent(ulistlink)
		}
	}
	if (clickedontab!="") {
	var culistlink=getULbyID(arguments[i], clickedontab)
	if (typeof culistlink!="undefined")
		expandContent(culistlink)
			else
				expandContent(ulist[0].getElementsByTagName("a")[0])
		}
	}
}

function getTabCookie(Name) { 
	var re=new RegExp(Name+"=[^;]+", "i");
	if (document.cookie.match(re))
	return document.cookie.match(re)[0].split("=")[1]
	return ""
}

function setTabCookie(name, value) {
	document.cookie = name+"="+value
}

function loadDTintoComment() {
	var arrUCdt = document.getElementsByTagName("ucdatetime");
	for( var x = 0; x < arrUCdt.length; x++ ) {
		var comId = arrUCdt[x].getAttribute('commentId');
		var rawDate = arrUCdt[x].getAttribute('rawdate');
		var strRawDate = (+rawDate);
		var myDate = new Date(strRawDate);
		var formatTime = getFormattedTime(myDate);
		var strDate = myDate.getMonth()+1 + "/" + myDate.getDate() + "/" + myDate.getFullYear() + " " + formatTime;
		var oDest = document.getElementById(comId);
		oDest.innerHTML = strDate;
	}
}

function loadRoundedCorner(){
if (document.getElementById('aTzsearch_bx'))
	document.getElementById('aTzsearch_bx').innerHTML+="<img src='http://www.aolcdn.com/bv_vce/images/fff_dot.gif' class='tl cor' /><img src='http://www.aolcdn.com/bv_vce/images/fff_dot.gif' class='tr cor' /><img src='http://www.aolcdn.com/bv_vce/images/fff_dot.gif' class='bl cor' /><img src='http://www.aolcdn.com/bv_vce/images/fff_dot.gif' class='br cor' />";
if(document.getElementById('frmHubSrt')){	
	var cont2=document.getElementById('frmHubSrt').getElementsByTagName('a');

	for(i=0;i<cont2.length;i++){
		cont2[i].innerHTML+="<img src='http://www.aolcdn.com/bv_vce/images/f2f2f2_dot.gif' class='tl cor' /><img src='http://www.aolcdn.com/bv_vce/images/f2f2f2_dot.gif' class='tr cor' /><img src='http://www.aolcdn.com/bv_vce/images/f2f2f2_dot.gif' class='bl cor' /><img src='http://www.aolcdn.com/bv_vce/images/f2f2f2_dot.gif' class='br cor' />"
		}
	}
}

// send e-mail using mailto
// Called from music/artist/mail/utilPan_email
function sendEmail(pageURL,pageTitle) {
	var bolSend = true;
	var oShareForm = document.forms.email_form;
	//console.debug("oShareForm",oShareForm);
	var shFromName = oShareForm.inputYourName.value;
//	var shFromName = "";
	if ( shFromName == "" ) {shFromName = "Your%20Friend"}
	var shFromEmail = oShareForm.inputYourEmail.value;
	var shToEmail = oShareForm.inputFriendEmail.value;
	if ( (shToEmail == "") || (shToEmail == "Enter your friend's email address") ) {
		alert("Please enter a destination email address.");
		oShareForm.inputFriendEmail.focus();
		bolSend = false;
	}
//	var shMsg = oShareForm.personal_message.value;
	
	var strMailto = "mailto:";
	strMailto += shToEmail + "?";
	strMailto += "&from=" + shFromEmail;
	strMailto += "&subject=" + shFromName + " has sent you " + pageTitle;
	strMailto += "&body=" + pageURL ; //+ shMsg;
	
	if (bolSend) { document.location.href = strMailto; };
}

// GPL'd courtesy of http://www.jeffothy.com/weblog/clipboard-copy
// Needs swf file at <cannae.asset_url>/ch_music2/_clipboard.swf
function copyElToClip(el, swf ) {
    var field = document.createElement("textarea");
    field.appendChild( document.createTextNode(dojo.dom.textContent(el)) );
    copyFieldToClip(field, swf )
}
function copyFieldToClip(el, swf ) {
    console.debug(el + " value: ", el.value);
    if (el.createTextRange) {
        var range = el.createTextRange();
        if (range) range.execCommand('Copy');
    } else {
        var flashcopier = 'flashcopier';
        if(!getEl(flashcopier)) {
            var divholder = document.createElement('div');
            divholder.id = flashcopier;
            document.body.appendChild(divholder);
        }
        getEl(flashcopier).innerHTML = '';
        var divinfo = '<embed src="'+swf+'" FlashVars="clipboard='+escape(el.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
        getEl(flashcopier).innerHTML = divinfo;
    }
}

function showdisclaimer() {
    getEl("disclaimlink").innerHTML="";getEl("disclaimlink").style.textAlign="left";getEl("disclaimlink").style.marginBottom="5px";
    getEl("disclaimlink").innerHTML="This video is provided and hosted from a third party server. AOL is not responsible for any activities originating with such third party server.";
}

/* OnlineOpinion (S3tS,1424b) / AOL client detection */
/* This product and other products of OpinionLab, Inc. are protected by U.S. Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */
var custom_var_static,_sp='%3A\\/\\/',_rp='%3A//',_poE=0.0, _poX=0.0,_sH=screen.height,_d=document,_w=window,_ht=escape(_w.location.href),_hr=_d.referrer,_tm=(new Date()).getTime(),_kp=0,_sW=screen.width;_d.onkeypress=_fK;function _fK(_e){if(!_e)_e=_w.event;var _k=(typeof _e.which=='number')?_e.which:_e.keyCode;if((_kp==15&&_k==12))_w.open('https://dashboard.opinionlab.com/pv_controlboard.html?url='+_fC(_ht),'PageViewer','height=529,width=705,screenX='+((_sW-705)/2)+',screenY='+((_sH-529)/2)+',top='+((_sH-529)/2)+',left='+((_sW-705)/2)+',status=yes,toolbar=no,menubar=no,location=no,resizable=yes');_kp=_k};function _fC(_u){_aT=_sp+',\\/,\\.,-,_,'+_rp+',%2F,%2E,%2D,%5F';_aA=_aT.split(',');for(i=0;i<5;i++){eval('_u=_u.replace(/'+_aA[i]+'/g,_aA[i+5])')}return _u};function O_LC2(){var _sY,_tp;if(navigator.userAgent.indexOf("AOL")>(-1)){_sY=0;_tp=0;}else{_sY=((_sH-192)/2);_tp=((_sH-192)/2);}_w.open('https://secure.opinionlab.com/ccc01/comment_card.asp?time1='+_tm+'&time2='+(new Date()).getTime()+'&prev='+_fC(escape(_hr))+'&referer='+_fC(_ht)+'&height='+_sH+'&width='+_sW+'&custom_var='+custom_var_static,'comments','width=535,height=192,screenX='+((_sW-535)/2)+',screenY='+_sY+',top='+_tp+',left='+((_sW-535)/2)+',resizable=yes,copyhistory=yes,scrollbars=no')};function _fPe(){if(Math.random()>=1.0-_poE){O_LC2();_poX=0.0}};function _fPx(){if(Math.random()>=1.0-_poX)O_LC()};window.onunload=_fPx;function O_GoT(_p){_d.write('<a href=\'javascript:O_LC2()\'>'+_p+'</a>');_fPe()}


