function insertflash() {
		document.write("<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=\"625\" height=\"104\" id=\"kpam\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"/flash/kpam_flash_masthead2010.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"/flash/kpam_flash_masthead2010.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"625\" height=\"104\" name=\"kpam\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");
}

function insertflashAP() {
		document.write("<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=\"625\" height=\"104\" id=\"kpam\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"http://www.kpam.com/flash/kpam_flash_masthead2010.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"http://www.kpam.com/flash/kpam_flash_masthead2010.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"625\" height=\"104\" name=\"kpam\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");
}

function scrollHeadlines() {
/***********************************************
* IFRAME Scroller script- © 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
***********************************************/

//specify path to your external page:
var iframesrc="http://www.kpam.com/scroll.shtml"

//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="800px" height="17px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')
}

function openWin( windowURL, windowName, windowFeatures ) { 
				return window.open( windowURL, windowName, windowFeatures ) ; 
			} 

var writeDate;
now = new Date;
Day = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
month = new Array("Jan.","Feb.","March","April","May","Jun","July","Aug.","Sept.","Oct.","Nov.","Dec.");
writeDate =  (Day[now.getDay()] + ", " + month[now.getMonth()] + " " + now.getDate() );

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);
}


var openPromo = "mainpromo";

function showPromo(promoToShow)
{
	hideLayer(openPromo);
	showLayer(promoToShow);
	openPromo = promoToShow;
}
var tim;
var previousLayer = "";

function showLayer(id) 
{
	var div = returnDiv(id);
	div.visibility = "visible";
}

function hideLayer(id) 
{
        var div = returnDiv(id);
        div.visibility = "hidden";
		previousLayer = "";
}

function mouseOutOfLayer(id)
{
	func = "hideLayer('"+id+"')";
	tim = setTimeout(func, 500);
}
 
function mouseIntoLayer(id)
{
	clearTimeout(tim);
	if(previousLayer != id)
	{
		if(previousLayer != "")
			hideLayer(previousLayer);
		showLayer(id);
	}
	previousLayer = id;
}


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;
}

//begin artist fade

var tiles_array = new Array("pers1", "pers2", "pers3", "pers4", "pers5", "pers6", "pers7");
var tiles_pointer = Math.floor(Math.random()*(tiles_array.length - 1)) + 1;
var fade_timeout_time = 50;
var wait = 4000;

function inittiles() {
	// fade in/out tiles.
	if(tiles_pointer%tiles_array.length == 0) {
   		tiles_pointer = 0;
		for(i = 1; i < tiles_array.length-1; i++)
		{
//			alert("hiding:  tiles_"+tiles_array[i]);
			setOpacity(document.getElementById(tiles_array[i]), 0);
		}
		
	}

//	alert(tiles_pointer);
	lyrId = tiles_array[tiles_pointer];
	lyr = document.getElementById(lyrId);
	// setOpacity(lyr, 0);
	lyr.style.visibility = 'visible';
	if(tiles_pointer == 0) {
//		alert("fadeOut: tiles_"+tiles_array[tiles_array.length-1]);
		fadeOut(tiles_array[tiles_array.length-1], 100);
	} else {
//		alert("fadeIn: "+lyrId);
    	fadeIn(lyrId,0);
	}
	
	tiles_pointer++;
	var tim = setTimeout("inittiles()", wait);
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", fade_timeout_time);
    }
  }
}

function fadeOut(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity >= 0) {
      setOpacity(obj, opacity);
      opacity -= 10;
      window.setTimeout("fadeOut('"+objId+"',"+opacity+")", fade_timeout_time);
    }
  }
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

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 = "";


