var jsBuildNum='7964M';

/*
	TalkShoe Confidential Information
	Copyright (c) 2005 - 2009 
*/
//This function checks for browser that do not handle getElementByID()
if(!document.getElementById){
  if(document.all)
  document.getElementById=function(){
    if(typeof document.all[arguments[0]]!="undefined")
    return document.all[arguments[0]]
    else
    return null
  }
  else if(document.layers)
  document.getElementById=function(){
    if(typeof document[arguments[0]]!="undefined")
    return document[arguments[0]]
    else
    return null
  }
}

var qsParm = new Array();
	function qs() {
		var query = window.location.search.substring(1);
		var parms = query.split('&');
		for (var i=0; i<parms.length; i++) {
		var pos = parms[i].indexOf('=');
		if (pos > 0) {
		var key = parms[i].substring(0,pos);
		var val = parms[i].substring(pos+1);
		qsParm[key] = val;
		}
	}
} 

//JSF-ism
/*function clearFormHiddenParams(curFormName) {
  var curForm = document.forms[curFormName];
}*/

var queryString = window.top.location.search.substring(1);
function getParameter(parameterName){
// Add "=" to the parameter name (i.e. parameterName=value)
	var parameterName = parameterName + "=";
		if ( queryString.length > 0 ) {
// Find the beginning of the string
			begin = queryString.indexOf ( parameterName );
// If the parameter name is not found, skip it, otherwise return the value
			if ( begin != -1 ) {
// Add the length (integer) to the beginning
				begin += parameterName.length;
// Multiple parameters are separated by the "&" sign
				end = queryString.indexOf ( "&" , begin );
				if ( end == -1 ) {
					end = queryString.length
				}
			// Return the string
			return unescape ( queryString.substring ( begin, end ) );
			}
		// Return "null" if no parameter has been found
		return "null";
	}
} 


//This function is a simple status bar messaging function.
function statwords(message){
	window.status = message;
}

function statwordsErase(){
	window.status = ' ';
}

//Go Terms and Conditions Popup Link
function goTerms(){
	  var popWidth = "960px";
	  var popHeight = (screen.height*2) / 3;
 window.open("/se/legal/TermsOfService.html", "terms", "resizable=yes,toolbar=no, scrollbars=yes, menubar=no, status=yes, titlebar=no, height="+popHeight+", width="+popWidth+", top=20 left=20");
}

function goTermsProt(){
	  var popWidth = "960px";
	  var popHeight = (screen.height*2) / 3;
 window.open("/se/legal/TermsOfService.html", "terms", "resizable=yes,toolbar=no, scrollbars=yes, menubar=no, status=yes, titlebar=no, height="+popHeight+", width="+popWidth+", top=20 left=20");
}

function goPrivacy(){
	  var popWidth = "960px";
	  var popHeight = (screen.height*2) / 3;
 window.open("/se/legal/PrivacyPolicy.html", "privacy", "resizable=yes,toolbar=no, scrollbars=yes, menubar=no, status=yes, titlebar=no, height="+popHeight+", width="+popWidth+", top=20 left=20");
}

function goPrivacyProt(){
	  var popWidth = "960px";
	  var popHeight = (screen.height*2) / 3;
 window.open("/se/legal/PrivacyPolicy.html", "privacy", "resizable=yes,toolbar=no, scrollbars=yes, menubar=no, status=yes, titlebar=no, height="+popHeight+", width="+popWidth+", top=20 left=20");
}

function goSysMaint(){
 var popWidth = "740px";
 var popHeight = "340px";
 
		window.open('/talkshoe/web/help/sysMaintPop.jsp', 'sysMaintChild', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no, height='+popHeight+', width='+popWidth+', top=20 left=20' );
}

function goTMMPrevBubble(formName,bubbleImgChecker){
	var bubbleCheckerVal=document.getElementById(formName+':'+bubbleImgChecker).value;
	document.getElementById(formName+':TMMPreviousLink').blur();
	
	if(bubbleCheckerVal=='TMMBubbleImg2'){
		document.getElementById(formName+':TMMBubbleImg1').style.display="";
		document.getElementById(formName+':TMMBubbleImg2').style.display="none";
		document.getElementById(formName+':TMMBubbleImg3').style.display="none";
		document.getElementById(formName+':TMMPrevNextSpacerImg').style.display="";
		document.getElementById(formName+':TMMPreviousLink').style.display="none";
		document.getElementById(formName+':TMMNextLink').style.display="";
		document.getElementById(formName+':TMMGoHomeLink').style.display="none";
		document.getElementById(formName+':'+bubbleImgChecker).value="TMMBubbleImg1";
	}else if(bubbleCheckerVal=='TMMBubbleImg3'){
		document.getElementById(formName+':TMMBubbleImg1').style.display="none";
		document.getElementById(formName+':TMMBubbleImg2').style.display="";
		document.getElementById(formName+':TMMBubbleImg3').style.display="none";
		document.getElementById(formName+':TMMPrevNextSpacerImg').style.display="none";
		document.getElementById(formName+':TMMPreviousLink').style.display="";
		document.getElementById(formName+':TMMNextLink').style.display="";
		document.getElementById(formName+':TMMGoHomeLink').style.display="none";
		document.getElementById(formName+':'+bubbleImgChecker).value="TMMBubbleImg2";
	}else{
		document.getElementById(formName+':TMMBubbleImg1').style.display="";
		document.getElementById(formName+':TMMBubbleImg2').style.display="none";
		document.getElementById(formName+':TMMBubbleImg3').style.display="none";
		document.getElementById(formName+':TMMPrevNextSpacerImg').style.display="";
		document.getElementById(formName+':TMMPreviousLink').style.display="none";
		document.getElementById(formName+':TMMNextLink').style.display="";
		document.getElementById(formName+':TMMGoHomeLink').style.display="none";
		document.getElementById(formName+':'+bubbleImgChecker).value="TMMBubbleImg1";
	}
}

function goTMMNextBubble(formName,bubbleImgChecker){
	var bubbleCheckerVal=document.getElementById(formName+':'+bubbleImgChecker).value;
	document.getElementById(formName+':TMMNextLink').blur();
	
	if(bubbleCheckerVal=='TMMBubbleImg1'){
		document.getElementById(formName+':TMMBubbleImg1').style.display="none";
		document.getElementById(formName+':TMMBubbleImg2').style.display="";
		document.getElementById(formName+':TMMBubbleImg3').style.display="none";
		document.getElementById(formName+':TMMPrevNextSpacerImg').style.display="none";
		document.getElementById(formName+':TMMPreviousLink').style.display="";
		document.getElementById(formName+':TMMNextLink').style.display="";
		document.getElementById(formName+':TMMGoHomeLink').style.display="none";
		document.getElementById(formName+':'+bubbleImgChecker).value="TMMBubbleImg2";
	}else if(bubbleCheckerVal=='TMMBubbleImg2'){
		document.getElementById(formName+':TMMBubbleImg1').style.display="none";
		document.getElementById(formName+':TMMBubbleImg2').style.display="none";
		document.getElementById(formName+':TMMBubbleImg3').style.display="";
		document.getElementById(formName+':TMMPrevNextSpacerImg').style.display="none";
		document.getElementById(formName+':TMMPreviousLink').style.display="";
		document.getElementById(formName+':TMMNextLink').style.display="none";
		document.getElementById(formName+':TMMGoHomeLink').style.display="";
		document.getElementById(formName+':'+bubbleImgChecker).value="TMMBubbleImg3";
	}else{
		document.getElementById(formName+':TMMBubbleImg1').style.display="";
		document.getElementById(formName+':TMMBubbleImg2').style.display="none";
		document.getElementById(formName+':TMMBubbleImg3').style.display="none";
		document.getElementById(formName+':TMMPrevNextSpacerImg').style.display="";
		document.getElementById(formName+':TMMPreviousLink').style.display="none";
		document.getElementById(formName+':TMMNextLink').style.display="";
		document.getElementById(formName+':TMMGoHomeLink').style.display="none";
		document.getElementById(formName+':'+bubbleImgChecker).value="TMMBubbleImg1";
	}
}

function resetTMMBubbleChecker(formName,bubbleImgChecker){
	var bubbleCheckerVal=document.getElementById(formName+':'+bubbleImgChecker).value;
	document.getElementById(formName+':'+bubbleImgChecker).value="TMMBubbleImg1";
	
}

function submitButtonDisable(formName,whichButton){
	if(browser != "Safari"){
		whichButton.disable = true;
		document.getElementById(formName).submit();
	}
}


//Macromedia Rollover JS.
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function replaceImg(imgId,newSrc){
	document.getElementById(imgId).setAttribute('src',newSrc);
	return;
}

function shortenLength(formName,dataTableName,i,fieldName,shortLength){
	var shortenedValue;
	var shortenThis=document.getElementById(formName+':'+dataTableName+':'+i+':'+fieldName).value;
	
	if(shortenThis.length>shortLength){
		shortenedValue=shortenThis.substring(0,shortLength);
		document.write(shortenedValue+"...");
	}else{
		document.write(shortenThis);
	}

}

function shortenLengthFeatured(formName,dataTableName,fieldName,shortLength){
	var shortenedValue;
	var shortenThis=document.getElementById(formName+':'+dataTableName+':0:'+fieldName).value;
	
	if(shortenThis.length>shortLength){
		shortenedValue=shortenThis.substring(0,shortLength);
		document.write(shortenedValue+"...");
	}else{
		document.write(shortenThis);
	}
}

function shortenLengthTalkCast(fieldName,shortLength){
	var shortenedValue;
	var shortenThis=document.getElementById(fieldName).value;
	
	if(shortenThis.length>shortLength){
		shortenedValue=shortenThis.substring(0,shortLength);
		document.write(shortenedValue+"... ");
	}else{
		document.write(shortenThis);
	}

}

function shortenLengthBasic(fieldName,shortLength){
	var shortenedValue;
	var shortenThis=document.getElementById(fieldName).value;
	
	if(shortenThis.length>shortLength){
		shortenedValue=shortenThis.substring(0,shortLength);
		document.write(shortenedValue+"... ");
	}else{
		document.write(shortenThis);
	}

}

function changeEmailAddress(name,location){
	var changeToAt = '@';
	document.write(name+changeToAt+location);
}

function goArenaPopup(){
	  var popWidth = "967px";
	  var popHeight = "600px";
 window.open("/resources/talkshoe/images/static/downloads/tsl_screenshot.jpg", "terms", "resizable=yes,toolbar=no, location=no, scrollbars=no, menubar=no, status=no, titlebar=no, height="+popHeight+", width="+popWidth+", top=20 left=20");
}

function ConcatError(){
	var userAgentVal = document.getElementById('defaultErrorPageUserAgentForm:DefErrorUserAgent').value;	
	var defErrorVal = document.getElementById('defaultErrorPageForm:DefErrorDescription').value;	
	var fullErrorVal;
	
	fullErrorVal=defErrorVal+userAgentVal;
	document.getElementById('defaultErrorPageForm:DefErrorDescription').value="";
	document.getElementById('defaultErrorPageForm:DefErrorDescription').value=fullErrorVal;
}

function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	document.getElementById(divid).style.height = newH+"px";		
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}

function embedSWF(swfFile,w,h,styleClassID){
	var swfDir='/resources/talkshoe/images/swf/';
	var swfCode='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" '
				  + 'width="'+w+'" height="'+h+'" class="'+styleClassID+'" id="'+styleClassID+'">'
				  + '<param name="allowScriptAccess" value="sameDomain" />'
				  + '<param name="movie" value="'+swfDir+swfFile+'">'
				  + '<param name="quality" value="best" />'
				  + '<param name="wmode" value="transparent" />'
				  + '<param name="bgcolor" value="#FFFFFF" />'
				  + '<embed src="'+swfDir+swfFile+'" quality="best" wmode="transparent" bgcolor="#FFFFFF" width="'+w+'" height="'+h+'" '
				  + 'name="'+styleClassID+'" class="'+styleClassID+'" allowScriptAccess="sameDomain" '
				  + 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'
				  + '</embed>'
				  + '</object>';
	document.write(swfCode); 
}

function embedSWFMainRandom(condition,w,h,styleClassID){
	var rN = Math.ceil(Math.random() * 9999);
	if(condition=="randomized"){
		swfFile = "MainBubbleInitFlash_Toronto.swf?rNum="+rN;
	}else{
		swfFile = condition;
	}
	
	var swfDir='/resources/talkshoe/images/swf/';
	var swfCode='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" '
				  + 'width="'+w+'" height="'+h+'" class="'+styleClassID+'" id="'+styleClassID+'">'
				  + '<param name="allowScriptAccess" value="sameDomain" />'
				  + '<param name="movie" value="'+swfDir+swfFile+'">'
				  + '<param name="quality" value="best" />'
				  + '<param name="wmode" value="transparent" />'
				  + '<param name="bgcolor" value="FFFFFF" />'
				  + '<embed src="'+swfDir+swfFile+'" quality="best" wmode="transparent" bgcolor="FFFFFF" width="'+w+'" height="'+h+'" '
				  + 'name="'+styleClassID+'" class="'+styleClassID+'" allowScriptAccess="sameDomain" '
				  + 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'
				  + '</embed>'
				  + '</object>';
	document.write(swfCode); 
}

function embedSWFLounge(condition,w,h,styleClassID){
var NumOfProfiles = 3;
var RandomProfNum = Math.ceil(Math.random() * NumOfProfiles)-1;
var sProfileSWFs = new Array('/se/images/lounge/profiles/hostProfileCliff.swf'//1
						   ,'/se/images/lounge/profiles/hostProfileLee.swf'//2
						   ,'/se/images/lounge/profiles/hostProfileMark.swf');//3
						   
	if(condition=="randomized"){
		swfFileL = sProfileSWFs[RandomProfNum];
	}else{
		swfFileL = condition;
	}

	var swfCodeL='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" '
				  + 'width="'+w+'" height="'+h+'" class="'+styleClassID+'" id="'+styleClassID+'">'
				  + '<param name="allowScriptAccess" value="sameDomain" />'
				  + '<param name="movie" value="'+swfFileL+'">'
				  + '<param name="quality" value="best" />'
				  + '<param name="wmode" value="transparent" />'
				  + '<param name="bgcolor" value="FFFFFF" />'
				  + '<embed src="'+swfFileL+'" quality="best" wmode="transparent" bgcolor="FFFFFF" width="'+w+'" height="'+h+'" '
				  + 'name="'+styleClassID+'" class="'+styleClassID+'" allowScriptAccess="sameDomain" '
				  + 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'
				  + '</embed>'
				  + '</object>';
	document.write(swfCodeL); 	
}

function verifyProgressBar(formName,formBtnDiv,progressID){
var progressBar = "/resources/talkshoe/images/defaultProgress.gif";

		document.getElementById(formName+':'+formBtnDiv).style.display = "none";
		document.getElementById(formName+':initSearchProgress').style.display = "inline";
		document.getElementById(formName+':initSearchProgress').style.visibility = "visible";
		setTimeout("document.getElementById('"+formName+":"+progressID+"').setAttribute('src','/resources/talkshoe/images/defaultProgress.gif')", 200);
		return true;

}

function LocationReplaceUrl(hiddenLocation){
	var locUrl = document.getElementById(hiddenLocation).value;
	location.replace=locUrl;
}

function LocationReplaceGoToUrl(hiddenLocation){
	var locUrl = document.getElementById(hiddenLocation).value;
	location.replace=locUrl;
	location.href=locUrl;
}

function LocationReplaceGoToUrlFull(locUrl){
	location.replace=locUrl;
	location.href=locUrl;
}

function protectedNotLoggedIn(){
	setTimeout("location.href='/talkshoe/web/tscmd/signin/1'",2000);
}

function changeToHomeForNonUser(){
	var goLocation='/talkshoe/web/tscmd/home/1';
	location.href=goLocation;
}

function printTodayDate(){
 var printToday = new Date();
 var MonthNames =new Array('January','February','March','April',
 						   'May','June','July','August','September',
 						   'October','November','December');
 var printTodayDay = printToday.getDate();
 var printTodayMonth = MonthNames[printToday.getMonth()];
 var printTodayYear = printToday.getFullYear();
 document.write('<span class="ContentHeaderFontListingBlue">'+
 printTodayMonth +' '+printTodayDay+', '+ printTodayYear +
 '</span>');
}

///START illegal character check section.
function remove_XS_whitespace(item){
  item.value = item.value.replace(/^\s*|\s*$/g,"");
  item.value = item.value.replace(/^\s+|\s+$/g,"");
  item.value = item.value.replace(/^\s+/,"");
  item.value = item.value.replace(/^\s/,"");
  item.value = item.value.replace(/^\r\n*/,"");
  item.value = item.value.replace(/^(\r\n|[\r\n])*/g,"");
  item.value = item.value.replace(/^[\r\n]*/g,"");
  item.value = item.value.replace(/^(\r\n|\r|\n)*/g,"");
  item.value = item.value.replace(/\s*$/,"");
  item.value = item.value.replace(/\r\n*$/,"");
  item.value = item.value.replace(/(\r\n|[\r\n])*$/g,"");
  item.value = item.value.replace(/[\r\n]*$/g,"");
  item.value = item.value.replace(/(\r\n|\r|\n)*$/g,"");
  item.value = item.value.replace(/ +/g, " ");  
  item.value = item.value.replace(/^\s/g, "");
  item.value = item.value.replace(/\s$/g, "");	
  
  if (item.value == ' '){item.value = ''};
}


function remove_Illegal_CharsAllow(item){
  var i1 = /</g; //<
  var i2 = />/g; //>
  var i3 = /~/g; //~
  //var i4 = /\"/g; //"
  var noErrFlag = true;

  if((item.value.match(i1)) 
  || (item.value.match(i2)) 
  || (item.value.match(i3))){
  //|| (item.value.match(i4))){
  	item.value = item.value.replace(i1, '');
 	item.value = item.value.replace(i2, '');
	item.value = item.value.replace(i3, '');
	//item.value = item.value.replace(i4, '');
	errorPop('We do not allow these characters: < > or ~\nThese characters will be removed.');
	noErrFlag = false;
	return false;
  }
	return noErrFlag;
}

function remove_Illegal_CharsDeny(item){
  var i1 = /</g; //<
  var i2 = />/g; //>
  var i3 = /~/g; //~
  //var i4 = /\"/g; //"
  //var i5 = /&/g; //"
  var noErrFlag = true;
 
  if((item.value.match(i1)) 
  || (item.value.match(i2)) 
  || (item.value.match(i3))){
  //|| (item.value.match(i4))
  //|| (item.value.match(i5))){
  	item.value = item.value.replace(i1, '');
 	item.value = item.value.replace(i2, '');
	item.value = item.value.replace(i3, '');
	//item.value = item.value.replace(i4, '');
	//item.value = item.value.replace(i5, '');
	errorPop('We do not allow these characters: < > or ~\nThese characters will be removed.');
	item.focus();
	noErrFlag = false;
	return false;
  }
	return noErrFlag;
}

function remove_Illegal_CharsSearch(item){
  var i1 = /%/g; //<
  var i2 = /\//g; ///
  var i3 = /\\/g; //\
  var noErrFlag = true;
 
  if((item.value.match(i1))
  || (item.value.match(i2))
  || (item.value.match(i3))){
  	item.value = item.value.replace(i1, '%25');
  	item.value = item.value.replace(i2, '');
  	item.value = item.value.replace(i3, '');
  }
  
	return noErrFlag;
}

function illegalCharChecker(field){
	remove_XS_whitespace(field);
	return remove_Illegal_CharsAllow(field);
}

function illegalCharCheckerRemove(field){
	remove_XS_whitespace(field);
	return remove_Illegal_CharsDeny(field);
}

function illegalCharCheckerSearch(field){
	remove_XS_whitespace(field);
	return remove_Illegal_CharsSearch(field);
}
///END illegal character check section.

///START Session Timeout section.
function timeOutRedirect(){
	location.href = '/talkshoe/web/tscmd/timeout/1';
}

function timeOutAlert(duration){
	var durationTot = (duration * 60);
	durationTot = durationTot + '500';
	setTimeout("timeOutRedirect();", durationTot);
}
///END Session Timeout section.

///START TalkShoe Live Callout image section.
function EnterTSLCallOutContent(which){
	var MainTSLCallOutWidth = screen.width;
	var MainTSLCallOutHeight = screen.height;
	
	if(which == 'reg'){
		TSLCallOutSrc = '/resources/talkshoe/images/tslCallOut.jpg';
	}else if(which == 'non'){
		TSLCallOutSrc = '/resources/talkshoe/images/tslCallOutNonMember.jpg';
	}else{
		TSLCallOutSrc = '/resources/talkshoe/images/tslCallOut.jpg';
	}
	
	ContentInfo = '<table border="0" cellspacing="0" cellpadding="0" width="'+MainTSLCallOutWidth+'" '+
	'id="MainTSLCallOutTB" class="MainTSLCallOutTB" style="padding:0px;" onclick="hideTSLCallOut();">'+
	'<tr>'+
	'<td class="MainTSLCallOutTBTD" align="center" width="'+MainTSLCallOutWidth+'" height="'+MainTSLCallOutHeight+'">'+
	
	'<table border="0" cellspacing="0" cellpadding="0" class="MainTSLCallOutImgInnerTB" style="padding:0px;" align=center>'+
	'<tr>'+
	'<td class="MainTSLCallOutImgInnerTBTD" align="right">'+
	'<a href="javascript:;" onclick="hideTSLCallOut();" class="MainTSLCallOutClose">CLOSE - X</a><br />'+
	'</td></tr>'+
	'<td class="MainTSLCallOutImgInnerTBTD" align="center" id="MainTSLCallOutImgTD">'+
	'<img border="0" width="700" src="'+TSLCallOutSrc+'" id="MainTSLCallOutImg" class="MainTSLCallOutImg" onclick="hideTSLCallOut();"/>'+
	'<br /><a href="javascript:;" onclick="hideTSLCallOut();" class="MainTSLCallOutCloseSm">Click here to return to previous page.</a>'+
	'</td></tr>'+
	'</table>'+
	'</td></tr>'+
	'</table>';
}

function showTSLCallOut(which){
	document.getElementById('TSLCallOutDiv').style.visibility = "visible";
	EnterTSLCallOutContent(which);
	document.getElementById('TSLCallOutDiv').innerHTML = ContentInfo;
	document.getElementById('MainTSLCallOutTB').style.display = "";
}

function showTSLCallOutNonMember(){
	document.getElementById('TSLCallOutDiv').style.visibility = "visible";
	EnterTSLCallOutNonMemberContent();
	document.getElementById('TSLCallOutDiv').innerHTML = ContentInfo;
	document.getElementById('MainTSLCallOutTB').style.display = "";
}

function hideTSLCallOut(){
	document.getElementById('TSLCallOutDiv').blur();
	document.getElementById('MainTSLCallOutTB').style.display = "none";
	document.getElementById('TSLCallOutDiv').style.height = "0px";
	document.getElementById('TSLCallOutDiv').style.visibility = "hidden";
}
///END TalkShoe Live Callout image section.

///Start Search section
function setSearchDefault(formName,fieldName1){
	var defSearchString = "Keyword or Call ID";
	
	document.getElementById(formName+':'+fieldName1).value = defSearchString;
	
}

function setSearchFocus(formName,fieldName1,fieldName2){
	var focusThis1=document.getElementById(formName+':'+fieldName1);
	var focusThis2=document.getElementById(formName+':'+fieldName2);
	
	focusThis1.select();
	focusThis2.select();
}

function onKeyPress(evt){
    //to call function for use following code
    /*if(document.all){
      //ie has to block in the key down
    		document.onkeydown = onKeyPress;
	  }else if (document.layers || document.getElementById){ 
	  //NS and mozilla have to block in the key press
    		document.onkeypress = onKeyPress;
	  }*/
    
	window.status = '';
	//IE below
    var oEvent = (window.event) ? window.event : evt;

	//Mozilla below
    var nKeyCode =  oEvent.keyCode ? oEvent.keyCode :
                    oEvent.which ? oEvent.which : 
                    void 0;
}

function checkEnter(formName,buttonName){
	var ie="Microsoft Internet Explorer";
	var ns="Netscape";
	
	var goEnter=document.getElementById(formName+':'+buttonName);
	if(navigator.appName == ie){
		if(event.keyCode==13){
			goEnter.focus();
		}
	}
}

function checkSearch(formName,fieldName){
illegalCharCheckerSearch(document.getElementById(formName+':'+fieldName));
var searchFieldVal=document.getElementById(formName+':'+fieldName).value;
var searchFieldValEnc=encodeURIComponent(document.getElementById(formName+':'+fieldName).value);
var searchTSCMD="/talkshoe/web/tscmd/search/";
var defSearchText = "Keyword or Call ID";

	if((searchFieldVal=="") || (searchFieldVal==defSearchText)){
		return false;
	}else{
		location.href = searchTSCMD + searchFieldValEnc;
	}
}

function checkSearchStatic(formName,fieldName){
illegalCharCheckerSearch(document.getElementById(formName+':'+fieldName));
var searchFieldVal=document.getElementById(formName+':'+fieldName).value;
var searchFieldValEnc=encodeURIComponent(document.getElementById(formName+':'+fieldName).value);
var searchTSCMD="/talkshoe/web/tscmd/search/";
var defSearchText = "Keyword or Call ID";

	if((searchFieldVal=="") || (searchFieldVal==defSearchText)){
		return false;
	}else{
		parent.location.href = searchTSCMD + searchFieldValEnc;
	}
}
///END Search section

//Addthis.com FEED/BOOKMARK CODE START
function AddThisRemove_Illegal_CharsQuotes(item){
  var i1 = /\'/g; //<
  var i2 = /\"/g; //>
  var noErrFlag = true;
 
  if((item.value.match(i1)) 
  || (item.value.match(i2))){
  	item.value = item.value.replace(i1, '');
 	item.value = item.value.replace(i2, '');
  }
	return item.value;
}

function openAddThisPop(addThisPopUrl){
 var popWidth = "616px";
 var popHeight = "565px";
 
	window.open(addThisPopUrl, 'AddThisChild', 'toolbar=yes,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no, height='+popHeight+', width='+popWidth+', top=20 left=20' );

}

function printAddThisFeed(fieldName){
	var AddThisRSSUrl = encodeURIComponent(document.getElementById(fieldName).value);
	
	var FullAddThisRSSUrl='http://www.addthis.com/feed.php?pub=abrauser&h1='+AddThisRSSUrl+'&t1=';

	document.write('<a href="javascript:;" '
					+' onmouseover="tip_it(1,\'TalkShoe Help\',\'Subscribe using any feed reader!\',\'200\',\'300\');" onmouseout="tip_it(0, \'\', \'\', \'0\',\'0\');" '
					+' onclick="openAddThisPop(\''+FullAddThisRSSUrl+'\')"><img src="/resources/talkshoe/images/AddThisRSSBtn.gif" '
					+'width="125" height="16" border="0" class="MasterRSSImg"/></a>');
	
	
}

function printAddThisFeedBlog(feedUrl){
	var AddThisBlogRSSUrl = masterWebSiteBaseUrlForJS + feedUrl;
	
	var FullAddThisBlogRSSUrl='http://www.addthis.com/feed.php?pub=abrauser&h1='+AddThisBlogRSSUrl+'&t1=';
	
	document.write('<a href="javascript:;" '

					+' onmouseover="tip_it(1,\'TalkShoe Help\',\'Subscribe using any feed reader!\',\'200\',\'300\');" onmouseout="tip_it(0, \'\', \'\', \'0\',\'0\');" '
					+' onclick="openAddThisPop(\''+FullAddThisBlogRSSUrl+'\')"><img src="/resources/talkshoe/images/AddThisRSSBtn.gif" '
					+'width="125" height="16" border="0" class="MasterRSSPodcastImg"/></a>');

}

function printAddThisBookmark(fieldName,pageTitle){
	var AddThisBMUrl = encodeURIComponent(document.getElementById(fieldName).value);
	var AddThisBMTitle = AddThisRemove_Illegal_CharsQuotes(document.getElementById(pageTitle));
	var FullAddThisBMUrl='http://www.addthis.com/bookmark.php?wt=nw&pub=abrauser&url='+AddThisBMUrl+'&title='+encodeURIComponent(AddThisBMTitle);

	document.write('<a href="javascript:;" '

					+' onmouseover="tip_it(1,\'TalkShoe Help\',\'Bookmark using any bookmark manager!\',\'200\',\'300\');" onmouseout="tip_it(0, \'\', \'\', \'0\',\'0\');" '
					+'onclick="openAddThisPop(\''+FullAddThisBMUrl+'\')">'
					+'<img src="/resources/talkshoe/images/AddThisBMBtn.gif" width="125" height="16" '
					+'border="0" class="MasterRSSImg"/></a>');

}
//Addthis.com FEED/BOOKMARK CODE END
//Smashcode BUTTON CODE START
function printSmashThisButton(talkcastId,titleField){
		var SmashThisTalkcastId = document.getElementById(talkcastId).value;
		var SmashThisTitleToReplace = document.getElementById(titleField).value;
		var SmashThisTitle = encodeURIComponent(SmashThisTitleToReplace);
		var SmashUrl = 'http://tsapp.smashcode.com/subscribe/';

		document.write('<a onmouseover="tip_it(1,\'TalkShoe Help\',\'Get Text alerts via SMASHCODE.COM\',\'200\',\'300\');" onmouseout="tip_it(0, \'\', \'\', \'0\',\'0\');" '
						+'class="MasterRSSPodcastImg" href="'+SmashUrl+SmashThisTalkcastId+'/'+SmashThisTitle+'" target="smashcode" ' 
						+'onclick="window.open(\''+SmashUrl+SmashThisTalkcastId+'/'+SmashThisTitle+'\',\'smashcode\',\'toolbar=no,width=700,height=400,scrollbars=yes\');return false;">'
						+'<img src="/resources/talkshoe/images/SmashThis.gif" width="125" height="16" border="0"/></a>');
}

//Digg.com BUTTON CODE START
var DiggThisJS='<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>';
function printDiggThisButton(fieldName){
	var DiggThisUrlToReplace = document.getElementById(fieldName).value;
	var DiggThisUrl = DiggThisUrlToReplace.replace("http://", "");
	//var DiggThisUrl = encodeURIComponent(newDiggThisUrl);
	
	
	document.write('<script type="text/javascript">\n'
				 + 'digg_url = \''+DiggThisUrl+'\';\n'
				 + 'digg_bgcolor = \'#EDF5FC\';\n'
				 + 'digg_skin = \'compact\';\n'
				 + '</script>\n'
				 + DiggThisJS);
	//document.write('<div style="position:absolute; width:600px; background:#FFFFFF; margin:0px;">'+DiggThisUrl+'</div>');
}

function printDiggThisButtonCustom(fieldName){
	var DiggThisUrlToReplace = document.getElementById(fieldName).value;
	var DiggThisUrl = DiggThisUrlToReplace.replace("http://", "");
	//var DiggThisUrl = encodeURIComponent(newDiggThisUrl);
	
	document.write('<script type="text/javascript">\n'
				 + 'digg_url = \''+DiggThisUrl+'\';\n'
				 //+ 'digg_bgcolor = \'#FFFFFF\';\n'
				 + 'digg_skin = \'compact\';\n'
				 + '</script>\n'
				 + DiggThisJS);
}
//Digg.com BUTTON CODE END

//START Change rowColor if inactive
function changeRowColorInactive(tableId,rowNum){
	var tableElem = document.getElementById(tableId);
	/*if(tableId == 'CreateMineDataTable' || tableId == 'CreateMineUnlistedDataTable'){
		rowElem = tableElem.rows[rowNum];
	}else{*/
		rowElem = tableElem.rows[rowNum+1];
	//}
	rowElem.style.backgroundColor="#FBE7FE";
	//rowElem.style.backgroundColor=colorVar;
}
//END Change rowColor if inactive
function getMonthAsString(moNum) {
    var monthNames = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    var monthName = monthNames[moNum];
    return monthName;
}

function getHourAMPM(hrNum,minNum){
	var AMPM;
	var HourStr;
	var MinStr;
	var TimeAMPM;

	if(hrNum > 11){
		if(hrNum == "12"){ HourStr = "12"; }else{ HourStr = hrNum-12; }
		AMPM = "PM";
	}else{
		if(hrNum == "0"){ HourStr = "12"; }else{ HourStr = hrNum; }
		AMPM = "AM";
	}
	
	if(minNum <10){
		MinStr = "0" + minNum;
	}else{
		MinStr = minNum;
	}
	
	TimeAMPM = HourStr + ":" + MinStr + " " + AMPM;
	
	return TimeAMPM;
}

function printEpiTime(hiddenDateTime){
	var dateTimeVal = document.getElementById(hiddenDateTime).value;
	
	var dateTimeValNew = new Date(dateTimeVal);

	var epiMonth = getMonthAsString(dateTimeValNew.getMonth());
	var epiDay = dateTimeValNew.getDate();
	var epiYr = dateTimeValNew.getFullYear();
	var epiTime = getHourAMPM(dateTimeValNew.getHours(),dateTimeValNew.getMinutes());
	
	var visitorTime = new Date();
	var timeZoneOffset;
		if(visitorTime) {
			timeZoneOffset = (visitorTime.getTimezoneOffset()/60);
			
			timeZoneOffset = timeZoneOffset*(-1)
			if(timeZoneOffset > 0){
				if(timeZoneOffset < 10){
					timeZoneOffset = "0"+timeZoneOffset;
				}
				timeZoneOffset = "+"+timeZoneOffset;
			}else if(timeZoneOffset == 0){
				timeZoneOffset = "";
			}else if(timeZoneOffset < 0){
				if(timeZoneOffset > -10){
					timeZoneOffset = timeZoneOffset*(-1);
					timeZoneOffset = "-0"+timeZoneOffset;
				}
			}
		}
	
	var dateStr = epiMonth + " " + epiDay + ", " + epiYr + " " + epiTime;
	
	document.write(document.getElementById(hiddenDateTime).value);//Original EDT Time
	//document.write(dateStr + " GMT" + timeZoneOffset);//Pretty with GMT-04:00 TimeZone
	//document.write(dateTimeValNew);//Ugly with UTC TimeZone
}

function cdtime(container, targetdate, currentdate){
	if (!document.getElementById || !document.getElementById(container)) return
	this.container=document.getElementById(container)
	if(currentdate == "currentJS"){
		this.currentTime=new Date()
	}else{
		this.currentTime=new Date(document.getElementById(currentdate).value)
	}
	this.targetdate=new Date(document.getElementById(targetdate).value)
	this.timesup=false
	this.updateTime()
}

cdtime.prototype.updateTime=function(){
	var thisobj=this
	this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
	setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}

cdtime.prototype.displaycountdown=function(baseunit, functionref){
	this.baseunit=baseunit
	this.formatresults=functionref
	this.showresults()
}

cdtime.prototype.showresults=function(){
	var thisobj=this
	var timediff=(this.targetdate-this.currentTime)/1000 //difference btw target date and current date, in seconds
	if (timediff<0){ //if time is up
		this.timesup=true
		this.container.innerHTML=this.formatresults()
		return
	}
	var oneMinute=60 //minute unit in seconds
	var oneHour=60*60 //hour unit in seconds
	var oneDay=60*60*24 //day unit in seconds
	var dayfield=Math.floor(timediff/oneDay)
	var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
	var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
	var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))
	if (this.baseunit=="hours"){ //if base unit is hours, set "hourfield" to be topmost level
		hourfield=dayfield*24+hourfield
		dayfield="n/a"
	}
	else if (this.baseunit=="minutes"){ //if base unit is minutes, set "minutefield" to be topmost level
		minutefield=dayfield*24*60+hourfield*60+minutefield
		dayfield=hourfield="n/a"
	}
	else if (this.baseunit=="seconds"){ //if base unit is seconds, set "secondfield" to be topmost level
		var secondfield=timediff
		dayfield=hourfield=minutefield="n/a"
	}
	this.container.innerHTML=this.formatresults(dayfield, hourfield, minutefield, secondfield)
	setTimeout(function(){thisobj.showresults()}, 1000) //update results every second
}

/////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW//////////////////////////////

//Create your own custom format function to pass into cdtime.displaycountdown()
//Use arguments[0] to access "Days" left
//Use arguments[1] to access "Hours" left
//Use arguments[2] to access "Minutes" left
//Use arguments[3] to access "Seconds" left

//The values of these arguments may change depending on the "baseunit" parameter of cdtime.displaycountdown()
//For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a"
//For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc

function formatResultsNextFrame(){
	var refreshURL = unescape(window.location);
	var refreshURLPN = unescape(window.location.pathname);
	
	if (this.timesup==false){ //if target date/time not yet met
		if((arguments[0] == 0) 
		&& (arguments[1] == 0) 
		&& (arguments[2] < 15)){
			window.location.replace(refreshURL);
			var displaystring="<span class='nextFrameLcdStyleSmall'>Reloading Page...</span>"
		}else{
			var displaystring = "<span class='nextFrameLcdStyle'>";
			if(arguments[0] != 0){
				displaystring += arguments[0]+" <sup>d</sup> ";
			}
			if(arguments[1] != 0){
				displaystring += arguments[1]+" <sup>h</sup> ";
			}
			if(arguments[2] != 0){
				displaystring += arguments[2]+" <sup>m</sup> ";
			}
			
			displaystring += arguments[3]+" <sup>s</sup></span>"
		}
	}else{ //else if target date/time met
		//if time up refresh page.
		var displaystring="<span class='nextFrameLcdStyleSmall'>Reloading Page...</span>"; //Don't display any text
		window.location.replace(refreshURL);
		//window.location.href = refreshURL;
	}
	return displaystring;
}
