function addTime(mins,secs) {	if (trim(mins) == '') {		mins = 0;	}	if (trim(secs) == '') {		secs = 0;	}	var minsec = mins * 60;	return (parseFloat(minsec) + parseFloat(secs));}function validTime(time,filetime) {	if (time <= filetime && time >= 0)	return true;	else	return false;}function logError(ertext) {	if (document.getElementById('errorLog')){		showDiv('errorLog');		document.getElementById('errorLog').innerHTML = "<p>" + ertext + "</p>";	}}function toggleSubgroups(toggler,subgroup,symbols) {	toggleClass(toggler,'current');	toggleSymbol(toggler,symbols);	subel = $(subgroup);	Effect.toggle(subel,'blind', {duration: .2});	return false;}function toggleClass(elem,classn) {	if (Element.hasClassName(elem,classn)) {		Element.removeClassName(elem,classn);	} else {		Element.addClassName(elem,classn);	}}function toggleSymbol(elem,symbols) {	var toggles = document.getElementsByClassName('toggler',elem);	var symb = toggles[0];	var syms = new Array;	if (symbols) {		syms = symbols.split('|');	} else {		syms[0] = '+';		syms[1] = '-';	}	if (symb.innerHTML == syms[0]) {		symb.innerHTML = syms[1];	} else {		symb.innerHTML = syms[0];	}}function hideDiv(eid) {	if (document.getElementById(eid)) {	document.getElementById(eid).style.display = "none";	}}function showDiv(eid) {	if (document.getElementById(eid)) {	document.getElementById(eid).style.display = "";	}}function clearDiv(eid) {	if (document.getElementById(eid)) {	document.getElementById(eid).innerHTML = "";	}}function toggleDiv(eid) {	if (isDivHidden(eid)) {		showDiv(eid);	} else {		hideDiv(eid);	}}function isDivHidden(eid) {	e = document.getElementById(eid);	if (e.style.display == "none") {		return true;	} else if (e.getAttribute('class') == "hidden" || e.getAttribute('className') == "hidden" ){		return true;	} else {		return false;	}}function showNextDiv(eid) {	for (var i=1;document.getElementById(eid + (i +1));i++) {		if (isDivHidden(eid + i)) {			showDiv(eid + i);			setUnselected(eid + i);			return true;		}	}	showDiv(eid + i);	hideDiv(eid + i + '_add');	return false;}function toggleSelect (eid,num,total) {	for (var i=1;i<=total;i++) {		if (i <= num) {			showDiv(eid + i);		} else {			hideDiv(eid + i);		}	}}function setUnselected(eid) {	//document.getElementById(eid).style.background = 'url(images/bg_lines.gif) 0 0 repeat';	//document.getElementById(eid).style.fontWeight = 'normal';//E3EBF2	var e;	e = document.getElementById(eid);	e.setAttribute('class','');	//for IE	e.setAttribute('className','');}function setSelected(eid) {	//document.getElementById(eid).style.background = '#E3EBF2';	//document.getElementById(eid).style.fontWeight = 'bold';	var e;	e = document.getElementById(eid);	e.setAttribute('class','selected');	//for IE	e.setAttribute('className','selected');}function showTab (eid, num) {	for (var i=1;document.getElementById(eid + '_div_' + i);i++) {		if (i ==  num) {			document.getElementById(eid + '_div_' + i).style.display = 'block';			setSelected(eid + '_tab_' + i);		} else {			hideDiv(eid + '_div_' + i);			setUnselected(eid + '_tab_' + i);		}	}	//return true;}function closeTabs (eid) {	for (var i=1;document.getElementById(eid + '_div_' + i);i++) {		hideDiv(eid + '_div_' + i);		setUnselected(eid + '_tab_' + i);	}	//return true;}function previewLink(eid,time,filetime) {	//?module=Podcast&action=SpotPreview&id=26&secs=15	if (validTime(time,filetime)) {    wurl = "?module=Podcast&action=SpotPreview&id=" + eid + "&secs=" + time;    window.open(wurl,"SpotPreview","height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");		//logError('');	} else {		alert("Please insert a valid time");	}}//-->function flip(e, img) {	var dirt = 'images/buttons/';	if (e.src == (dirt + img + '.gif')) {		e.src = dirt + img + '_over' + '.gif';	} else {		e.src = dirt + img + '.gif';	}}//?module=Stats&action=Graph&period=day&date={$pcast_stats.trafficDay.date}&pcast_id={$podcast.ID}&width=300&height=150function drawDownloadGraph(eid,period,date,pcast_id,episode_id,width,height) {	e = document.getElementById(eid);	newimg = '<img src="?module=Stats&action=Graph&period='+period+'&date='+date+'&pcast_id='+pcast_id+'&width='+width+'&height='+height+'" width="'+width+'" height="'+height+'" />';	//alert(newimg);	e.innerHTML = newimg;}function jumpto(gturl) {	window.location = gturl;}function sendtoFlashPreview(flashname,epid,secs) {	e = getFlashMovieObject(flashname);	e.SetVariable("module","Podcast");	e.SetVariable("action","SpotPreview");	e.SetVariable("changed",1);	e.SetVariable("id",epid);	e.SetVariable("secs",secs);	//alert("secs="+secs);}function stopFlashPreview(flashname) {	window.document[flashname].SetVariable("stopNow",1);}function getFlashMovieObject(movieName){  if (window.document[movieName])   {      return window.document[movieName];  }  if (navigator.appName.indexOf("Microsoft Internet")==-1)  {    if (document.embeds && document.embeds[movieName])      return document.embeds[movieName];   }  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)  {    return document.getElementById(movieName);  }}// write flash obj with query stringfunction writeFlashPreview(divid,eid,secs,totalsecs) {		var qstring = 'swf/flash_preview2.swf?baseurl='+rootURL+'&module=Podcast&action=SpotPreview&id='+eid+'&secs='+secs;	var flobj = '';	//alert(qstring);	document.getElementById(divid).innerHTML = '';	// assemble flash obj	if (validTime(secs,totalsecs)) {	flobj = '<object type="application/x-shockwave-flash" data="'+qstring+'" width="64" height="14"><param name="wmode" value="transparent" /><param name="movie" value="'+qstring+'" /></object>';	} else {		flobj = '<img src="images/buttons/warn_icobutton.gif" alt="Warning" /><span class="small warn">&nbsp;Invalid</span>';	}	// write all lines	document.getElementById(divid).innerHTML = flobj;}function clearAllDivs(eid) {	for (var i=1;document.getElementById(eid + (i +1));i++) {		clearDiv(eid + i);	}}/*<object type="application/x-shockwave-flash" data="flash_preview.swf" width="80" height="14"><param name="wmode" value="transparent" /><param name="FlashVars<param name="movie" value="flash_preview.swf" /></object>*//*function writeFlashPreview(divid,eid,secs) {	// assemble flash obj	var flobj = '<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="80" height="14" id="flashpreview'+eid+'" align="bottom"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="?module=Podcast&action=SpotPreview&id='+eid+'&secs='+secs+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#666666" /><embed src="swf/flash_preview.swf?module=Podcast&action=SpotPreview&id='+eid+'&secs='+secs+'" quality="high" wmode="transparent" bgcolor="#666666" width="80" height="14" name="flashpreview{$smarty.section.spots.index}" align="bottom" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" swLiveConnect="true" /></object>';	// write all lines	document.getElementById(divid).innerHTML = flobj;}*/function checkAll(formname,value) {	for (i = 0; i < formname.elements.length; i++) {		if (value == '1') {		formname.elements[i].checked = true;		} else {		formname.elements[i].checked = false;		}	}}// AJAX General//var url = "http://localhost/~aaronquint/quirkey/public/?module=Track&action=XMLAdd"; // The server-side scriptfunction handleHttpResponse(statusDiv) {  //alert("handling");  if (http.readyState == 4) {    if (http.status == 200) {      // Response is positive      document.getElementById(statusDiv).innerHTML = http.responseXML;      isWorking = false;    }   } else if (http.readyState > 1) {	  	 document.getElementById(statusDiv).innerHTML = "Posting . . .";  }   //document.getElementById(statusDiv).innerHTML = "posting";}var isWorking = false;//url is an absolute url to send data to//values are an array of form elementsfunction ajax_send(url,values,statusDiv) {    if (!isWorking && http) { 	var urlElem = new Array();	for (i=0; i < values.length -1; i++) {		urlElem[i] = values[i].name+"="+escape(values[i].value);	}	urlElem = urlElem.join('&');	//url += "&" + urlElem;	//document.getElementById('status').innerHTML = urlElem;    http.open("POST", url, true);    //document.getElementById(statusDiv).innerHTML =url;	http.onreadystatechange = handleHttpResponse(statusDiv);	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');    isWorking = true;    http.send(urlElem);  } }function getHTTPObject() {  var xmlhttp;  /*@cc_on  @if (@_jscript_version >= 5)    try {      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");    } catch (e) {      try {        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");      } catch (E) {        xmlhttp = false;      }    }  @else  xmlhttp = false;  @end @*/  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {    try {      xmlhttp = new XMLHttpRequest();    } catch (e) {      xmlhttp = false;    }  }  return xmlhttp;}var http = getHTTPObject();// I didnt write these //function trim(TRIM_VALUE){	if(TRIM_VALUE.length < 1){		return"";	}	TRIM_VALUE = RTrim(TRIM_VALUE);	TRIM_VALUE = LTrim(TRIM_VALUE);	if(TRIM_VALUE==""){		return "";	}	else{		return TRIM_VALUE;	}}function RTrim(VALUE){	var w_space = String.fromCharCode(32);	var v_length = VALUE.length;	var strTemp = "";	if(v_length < 0){		return"";	}	var iTemp = v_length -1;	while(iTemp > -1){		if(!(VALUE.charAt(iTemp) == w_space)){			strTemp = VALUE.substring(0,iTemp +1);			break;		}		iTemp = iTemp-1;	} //End While	return strTemp;} //End Functionfunction LTrim(VALUE){	var w_space = String.fromCharCode(32);	if(v_length < 1){		return"";	}	var v_length = VALUE.length;	var strTemp = "";	var iTemp = 0;	while(iTemp < v_length){		if(!(VALUE.charAt(iTemp) == w_space)){			strTemp = VALUE.substring(iTemp,v_length);			break;    }		iTemp = iTemp + 1;	} //End While	return strTemp;} //End Function