function gleepopup() {
	window.open('http://www.mix1065.com/mediaplayer/?station=WMVX-FM&action=music&item=20551792', 'streaming_player','location=no,menubar=no,resizable=yes,scrollbars=yes,width=980,height=592');
	self.location = 'http://www.mix1065.com/cc-common/news/sections/special/glee/';
}

function acsTV() {
   mywindow = window.open("/pages/acstv.html","AlanCoxShowTV","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=924,height=575");
  mywindow.moveTo(50,25);
 } 


function mj_popup() {
	window.open('http://interactive.foxnews.com/livestream/live.html?chanId=4','MediaPlayerWindow','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=850,height=502');
	self.location = '/cc-common/news/sections/special/michaeljackson/';
}

function openlocaliheartradio_blackberry_popup(MEDIA, SKIN) {
	window.open('/cc-common/mediaplayer/player.html?mps='+SKIN+'&mid='+MEDIA+'','MediaPlayerWindow','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=728,height=511');
	self.location = '/cc-common/radio_app/index.html?tabs=1';
}

function openlocaliheartradio_iphone_popup(MEDIA, SKIN) {
	window.open('/cc-common/mediaplayer/player.html?mps='+SKIN+'&mid='+MEDIA+'','MediaPlayerWindow','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=728,height=511');
	self.location = '/cc-common/radio_app/index.html';
}


function openCustomPodcast(SKIN,SITEID,CALLLETTERS,FILENAME) {
	var MEDIA = 'http://a1135.g.akamai.net/f/1135/'+SITEID+'/1h/cchannel.download.akamai.com/'+SITEID+'/podcast/CLEVELAND-OH/'+CALLLETTERS+'/'+FILENAME;
  day = new Date();
  id = day.getTime();
  window.open('/cc-common/mediaplayer/player.html?mps='+SKIN+'&mid='+MEDIA+'','MediaPlayerWindow','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=728,height=511');
}

function openMixPodcast(SKIN,FILENAME) {
	var MEDIA = 'http://a1135.g.akamai.net/f/1135/18227/1h/cchannel.download.akamai.com/18227/podcast/CLEVELAND-OH/WMVX-FM/'+FILENAME+'?force=1';
  day = new Date();
  id = day.getTime();
  window.open('/cc-common/mediaplayer/player.html?mps='+SKIN+'&mid='+MEDIA+'','MediaPlayerWindow','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=728,height=511');
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// COUNTDOWN CLOCK FUNCTIONS
///////////////////////////////////////////////////////////////////////////////////////////////////

function cdtime(container, targetdate){
if (!document.getElementById || !document.getElementById(container)) return
this.container=document.getElementById(container)
this.currentTime=new Date()
this.targetdate=new Date(targetdate)
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
}

function formatresults(){
if (this.timesup==false){//if target date/time not yet met
var displaystring= "<TABLE class='cd_table'><TR><TD class='cd_timecell'><DIV class='cd_days'>"+arguments[0]+"</DIV></TD><TD class='cd_timecell'><DIV class='cd_hours'>"+arguments[1]+"</DIV></TD><TD class='cd_timecell'><DIV class='cd_minutes'>"+arguments[2]+"</DIV></TD><TD class='cd_timecell'><DIV class='cd_seconds'>"+arguments[3]+"</DIV></TD></TR><TR><TD class='cd_titlecell'><DIV class='cd_days_title'>days</DIV></TD><TD class='cd_titlecell'><DIV class='cd_hours_title'>hours</DIV></TD><TD class='cd_titlecell'><DIV class='cd_minutes_title'>minutes</DIV></TD><TD class='cd_titlecell'><DIV class='cd_seconds_title'>seconds</DIV></TD></TR></TABLE>"
}
else{ //else if target date/time met
var displaystring="<DIV class='cd_overtime'></DIV>"
}
return displaystring
}

function simpleresults(){
if (this.timesup==false){//if target date/time not yet met
var displaystring= arguments[0]+" d&nbsp;&nbsp;"+arguments[1]+" h&nbsp;&nbsp;"+arguments[2]+" m&nbsp;&nbsp;"+arguments[3]+" s"
}
else{ //else if target date/time met
var displaystring="<DIV class='cd_overtime'></DIV>"
}
return displaystring
}


///////////////////////////////////////////////////////////////////////////////////////////////////
// Custom P1 Launch Codes - Launches a Photo Gallery and a Specific Page
///////////////////////////////////////////////////////////////////////////////////////////////////

function open_p1_photopopup(album_id,position,custompage) {
	if(typeof(position)=="undefined"){
		window.open('/cc-common/gallery/display.html?album_id=' + album_id, '_blank','width=728,height=600,resizable=no,scrollbars=no,menu=no,status=no');
	} else {
		window.open('/cc-common/gallery/display.html?album_id=' + album_id + '&position='+position, '_blank','width=728,height=600,resizable=no,scrollbars=no,menu=no,status=no');
	}

self.location = custompage;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// Triv's Vegas Show Player
///////////////////////////////////////////////////////////////////////////////////////////////////
function open_vegasshow_player() {
window.open('/pages/triv/vegasshow/player.html', '_blank','width=600,height=660,resizable=no,scrollbars=no,menu=no,status=no');
}

function open_vegasshow_p1_player() {
window.open('/pages/triv/vegasshow/player.html', '_blank','width=600,height=660,resizable=no,scrollbars=no,menu=no,status=no');
self.location = 'http://www.wtam.com/pages/trivpage.html';
}

function open_linda_p1_player() {
window.open('/pages/triv/lindatrivisonnoendowmentfund/player.html', '_blank','width=600,height=500,resizable=no,scrollbars=no,menu=no,status=no');
self.location = 'http://www.wtam.com/pages/trivpage.html';
}

function open_linda_player() {
window.open('/pages/triv/lindatrivisonnoendowmentfund/player.html', '_blank','width=600,height=500,resizable=no,scrollbars=no,menu=no,status=no');
}




/*
	Header Information------------------------------------[Do Not Remove This Header]--
	Title: OO Dom Image Rollover
	Description: This script makes it easy to add rollover/ mousedown 
  	effects to any image on the page, including image submit buttons. Automatically 
  	preloads images as well. Script works in all DOM capable browsers- IE5+, NS6+, 
  	Opera7+.
	
	Legal: Copyright 2005 Adam Smith
	Author Email Address: ibulwark@hotmail.com
	Date Created: June 6, 2005
	Website: Codevendor.com | eBadgeman.com
	Script featured on Dynamic Drive: http://www.dynamicdrive.com
	-----------------------------------------------------------------------------------
*/

function imageholderclass(){
	this.over=new Array();
	this.down=new Array();
	this.src=new Array();
	this.store=store;
	
	function store(src, down, over){
		var AL=this.src.length;
		this.src[AL]=new Image(); this.src[AL].src=src;
		this.over[AL]=new Image(); this.over[AL].src=over;
		this.down[AL]=new Image(); this.down[AL].src=down;
	}
}

var ih = new imageholderclass();
var mouseisdown=0;

function preloader(t){
	for(i=0;i<t.length;i++){
		if(t[i].getAttribute('srcover')||t[i].getAttribute('srcdown')){
			
			storeimages(t[i]);
			var checker='';
			checker=(t[i].getAttribute('srcover'))?checker+'A':checker+'';
			checker=(t[i].getAttribute('srcdown'))?checker+'B':checker+'';
			
			switch(checker){
			case 'A' : mouseover(t[i]);mouseout(t[i]); break;
			case 'B' : mousedown(t[i]); mouseup2(t[i]); break;
			case 'AB' : mouseover(t[i]);mouseout(t[i]); mousedown(t[i]); mouseup(t[i]); break;
			default : return;			
			}
			
			if(t[i].src){t[i].setAttribute("oldsrc",t[i].src);}
		}
	}
}
function mouseup(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");this.oldmouseup();}

	}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");}}
	t.onmouseup=newmouseup;
}

function mouseup2(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");this.oldmouseup();}
		}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");}}
	t.onmouseup = newmouseup;
}

function mousedown(t){
	var newmousedown;
	if(t.onmousedown){
		t.oldmousedown=t.onmousedown;
		newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");this.oldmousedown();}}
	}
	else{newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");}}}
	t.onmousedown=newmousedown;
}

function mouseover(t){
	var newmouseover;
	if(t.onmouseover){
		t.oldmouseover=t.onmouseover;
		newmouseover=function(){this.src=this.getAttribute("srcover");this.oldmouseover();}
	}
	else{newmouseover=function(){this.src=this.getAttribute("srcover");}}
	t.onmouseover=newmouseover;
}

function mouseout(t){
	var newmouseout;
	if(t.onmouseout){
		t.oldmouseout=t.onmouseout;
		newmouseout=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout();}
	}
	else{newmouseout=function(){this.src=this.getAttribute("oldsrc");}}
	t.onmouseout=newmouseout;
}

function storeimages(t){
	var s=(t.getAttribute('src'))?t.getAttribute('src'):'';
	var d=(t.getAttribute('srcdown'))?t.getAttribute('srcdown'):'';
	var o=(t.getAttribute('srcover'))?t.getAttribute('srcover'):'';
	ih.store(s,d,o);
}

function preloadimgsrc(){
	if(!document.getElementById) return;
	var it=document.getElementsByTagName('IMG');
	var it2=document.getElementsByTagName('INPUT');
	preloader(it);
	preloader(it2);
}

if(window.addEventListener){window.addEventListener("load", preloadimgsrc, false);} 
else{
	if(window.attachEvent){window.attachEvent("onload", preloadimgsrc);}
	else{if(document.getElementById){window.onload=preloadimgsrc;}}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////

/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////


