/*:::oOO0:::: [ START file description ] ::::0OOo:::*/
/*:::oOO0:::: Created for:	High Level Media::::0OOo:::*/	
/*:::oOO0:::: Author:	Daniel Hudson ::::0OOo:::*/
/*:::oOO0:::: Email:	admin@HighLevelMedia.com ::::0OOo:::*/
/*:::oOO0:::: Date:		01/31/2005 ::::0OOo:::*/
/*:::oOO0:::: Purpose:	To apply functionality to page ::::0OOo:::*/
/*:::oOO0:::: [ Use of this document in part or whole is forbidden without written permission from the author. ] ::::0OOo:::*/
/*:::oOO0:::: [END file description] ::::0OOo:::*/
var title = null;
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
window.onload = function () 
{
	if(document.all)
	{
			//el=document.getElementById("displayWin").style;
			el=document.body.style;
			el.scrollbarDarkShadowColor="#000000";
			//scrollbar3dLightColor="#D71C01";
			el.scrollbarArrowColor="#ffffff";
			el.scrollbarBaseColor="#8C2624";
			//scrollbarFaceColor="#D22107";
			el.scrollbarHighlightColor="#CCCCCC";
			el.scrollbarShadowColor="#000000";
			el.scrollbarTrackColor="#CD3232";

	}
		//Set up stylesheet controls
	var cookie = readCookie("style");
	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
}
window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}
function setActiveStyleSheet(title) {
if(document.getElementsByTagName)
{
var d, i, a, main;
if(title != null && document.getElementsByTagName("style")[0])
{
	//document.getElementsByTagName("style")[0].disabled=true;
	if(title=='null')
	{
	//document.getElementsByTagName("style")[0].disabled=false;
	}
}

  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }

	}
	if(document.getElementsByTagName("body")[0])
{
		b=document.getElementsByTagName("body")[0];
	b.style.display='none';
	b.style.display='block';
	}
}

function getActiveStyleSheet() {
if(document.getElementsByTagName)
{
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}
}

function getPreferredStyleSheet() {
if(document.getElementsByTagName)
{
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
	}
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}
//idea from CodeLifter.com
// http://www.codelifter.com
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 8000

// Duration of crossfade (seconds)
var crossFadeDuration = 5

// =======================================
// do not edit anything below this line
// =======================================

function runSlideShow(aryCount,eItem,aryImg)
{
	for (i = 0; i < eItem.length; i++)
	{
   	if (document.all)
	 	{
    	//eItem[i].style.filter="blendTrans(duration=2)"
      eItem[i].style.filter="blendTrans(duration=crossFadeDuration)"
      eItem[i].filters.blendTrans.Apply()    
   	}
   	//eItem[i].style.backgroundImage = aryImg[i][aryCount[i]].src
		document.getElementById("idHeaderR1").style.backgroundImage="url("+aryImg[i][aryCount[i]].src+")";

   	if (document.all)
		{
    	eItem[i].filters.blendTrans.Play()
   	}
	 	aryCount[i] = aryCount[i] + 1;
   	if (aryCount[i] > (aryImg[i].length-1)) aryCount[i]=0
	}
	t = setTimeout('runSlideShow(aryCount,aryE,aryI)', slideShowSpeed);
}
//START[ flashDetect ]
// v = flash plugin version
// w = width
// h = height
// f = full path to flash swf source file
// i = image subsitute
function flashDetect(v,w,h,f)
{
fContent = '';
var MM_contentVersion = parseInt(v);
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1) && (navigator.appVersion.indexOf("Mac")==-1)) {
	eval ('try {var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+MM_contentVersion);if (xObj)	MM_FlashCanPlay = true; xObj = null;	} catch (e)	{}');
}
			
if ( MM_FlashCanPlay ) {
	fContent = fContent +'<object type="application/x-shockwave-flash"';
	fContent = fContent +' data="'+f+'"';
	fContent = fContent +' width="'+w+'" height="'+h+'">';
	fContent = fContent +' <param name="movie" value="'+f+'"/><param name="quality" value="high"/><param name="bgcolor" value="#000000"/> '; 
	fContent = fContent +' <embed src="'+f+'" quality="high" bgcolor="#000000"';
	fContent = fContent +' swLiveConnect="false" width="'+w+'" height="'+h+'"';
	fContent = fContent +' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
	fContent = fContent +' </embed>';
	fContent = fContent +' </object>';
} else{
	fContent = fContent +'<a class="oAlt" href="http://www.macromedia.com/go/getflashplayer" title="Get the Flash Plugin (external link)" onmouseout="this.style.color=\'black\';this.style.backgroundColor=\'white\';"  onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'black\';" style="position:absolute;display:block;float:left;top:0px;left:0px;background-color:white;color:black;font-size:75%;border: 1px outset #cccccc;line-height: 1.25em;letter-spacing:.5em;text-decoration:none ! important">Get Plugin</a>';
}
return fContent;
//END[ flashDetect ]
}

 var exitWin=4;
function opennew(theurl,thetitle){
	var winWidth=775;
	var winHeight=581;
	var winTop=0;
	var winLeft=0;
	var closeexitWin=exitWin;
	if(screen){
	winLeft=(screen.width/2)-(winWidth/2);
	winTop=(screen.height/2)-(winHeight/2);
	}
	if(closeexitWin != 4 ){
	if(exitWin.location != window.location && navigator.appName=="Microsoft Internet Explorer"){
	exitWin.close();
	}
	}
	exitWin=window.open(theurl,'newWin','height='+winHeight+',width='+winWidth+',top='+winTop+',left='+winLeft+',resizable=yes,scrollbars=no,toolbar=no,location=no,status=no,menubar=no');
	exitWin.window.focus();
	}