function insertflash() {
		document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"334\" height=\"124\" id=\"kola_masthead_ver1\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"/media/kola_masthead_ver1.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#000000\" /><embed src=\"/media/kola_masthead_ver1.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"334\" height=\"124\" name=\"kola_masthead_ver1\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");
}

function openWindow(url,w,h) {
	var options='top=100,left=250,resizable=yes,scrollbars=yes,menubar=no,width='+w+',height='+h;
	window.open(url,'event',options);
}

function openGalleryWindow(url) {
	new_window = window.open(url,'photos','top=100,left=250,resizable=yes,width=590,height=520,scrollbars=yes,menubar=no');
	setTimeout("new_window.focus()",500);
}

function openContestWindow(url) {
	new_window = window.open(url,'photos','top=100,left=250,resizable=yes,width=670,height=520,scrollbars=yes,menubar=no');
	setTimeout("new_window.focus()",500);
}

function simpleArray() {
        this.length = 0;
        this.active = '';
}

function event(type, start, finish, image, link) {
        this.type = type;
        this.start = start;
        this.finish = finish;
        this.image = image;
        this.link = link;
}

events = new simpleArray();

function addEvent(type, start, finish, image, link) {
        events.length++;
        if (finish == 000) {
                finish = 2400;
        }
        events[events.length] = new event(type, start, finish, image, link);
}

function setImage() {
        today = new Date();
        day = today.getDay();
        hour =today.getHours();
        minute = today.getMinutes();
        now = (hour * 100) + minute;
        type = 'week';
        if (day == 0) {
                type = 'sun';
        } else if (day == 6) {
                type = 'sat';
        }
        for (i=1; i<=events.length; i++) {
                if ( (events[i].type == type) && (events[i].start <= now) &&  (events[i].finish > now) ) {
                        events.active = i;
                        eventImage = imageCode + events[i].image + '.jpg width=187 height=124>';
						if (events[events.active].link != null) {
                                eventImage = '<A HREF=\"' + events[events.active].link + '\">' + eventImage + '</A>';
                        }
                }
        }
}
imageCode = '<IMG BORDER=0 SRC=/graphics/';
addEvent('week',000,500,'onair_nights', '');
addEvent('week',500,900,'onair_brian', 'mailto:brian@kolafm.com');
addEvent('week',900,1400,'onair_cindy', 'mailto:cindy@kolafm.com');
addEvent('week',1400,1900,'onair_vic', 'mailto:vic@kolafm.com');
addEvent('week',1900,2400,'onair_kevin', 'mailto:kevin@kolafm.com');
addEvent('sat',000,2400,'onair_weekends', '');
addEvent('sat',900,1400,'onair_marina', '');
addEvent('sat',1400,2400,'onair_weekends', '');
addEvent('sun',000,2400,'onair_weekends', '');
setImage();

function showLayer(id) 
{
	var div = returnDiv(id);
	div.visibility = "visible";
}

function hideLayer(id) 
{
        var div = returnDiv(id);
        div.visibility = "hidden";
//		previousLayer = "";
}
   
var tim;
var tim2;
var tim3;
var previousLayer = "";
var open_sub_layer = "";

function mouseOutOfLayer(id)
{
	if(id.indexOf("sub_") >= 0)
	{
//		alert("previousLayer = " + previousLayer);
		func = "hideLayer('"+previousLayer+"')";
		tim = setTimeout(func, 500);
		func = "hideLayer('"+id+"')";
		tim2 = setTimeout(func, 500);
	}
	else
	{
		if(open_sub_layer != "")
		{		
			func = "hideLayer('"+open_sub_layer+"')";
			tim2 = setTimeout(func, 500);
		}
		func = "hideLayer('"+id+"')";
		tim = setTimeout(func, 500);
	}
}
 
function mouseIntoLayer(id)
{
	clearTimeout(tim);
	clearTimeout(tim2);

	if(id.indexOf("sub_") >= 0)
	{  // we're mousing into a sub_layer
		if(open_sub_layer != id && open_sub_layer != "")
			hideLayer(open_sub_layer);
		clearTimeout(tim3);
		showLayer(id);
		showLayer(previousLayer);
		open_sub_layer = id;
	}
	else
	{  // we're just mousing into a regular layer
//		alert("harro2");	
		if (open_sub_layer != "")
			hideLayer(open_sub_layer);
		if(previousLayer != id && previousLayer != "")
		{
			
			hideLayer(previousLayer);
		}
		showLayer(id);
		previousLayer = id;
	}
}


function closeOpenSubs()
{
	if(open_sub_layer != "")
	{
		func = "hideLayer('"+open_sub_layer+"');open_sub_layer = ''";
		tim3 = setTimeout(func, 500);
	}
}

function keepParent(id)
{
	clearTimeout(tim);
	showLayer(id);
	previousLayer = id;
}

function mouseOutOfChild(id)
{
    var div = returnDiv(id);
    div.visibility = "hidden";
	tim = setTimeout(func, 500);
}

function returnDiv(id) {
	if (document.all) // IE
	{
		var div = document.all(id).style;
	}
	else if (document.layers) // NS4
	{
		var div = document.layers[id];
	}
	else if (document.getElementById) // NS6
	{
		var div = document.getElementById(id).style;
	}
	return div;
}