<!--
if (typeof(pathprefix) != "string"){
	var pathprefix = '';	
}

function valuevalidation(entered, min, max, alertbox, datatype)
	{
		// Value Validation by Henrik Petersen / NetKontoret
		// Explained at www.echoecho.com/jsforms.htm
		// Please do not remove this line and the two lines above.
		with (entered)
		{
		checkvalue=parseFloat(value);
		if (datatype)
		{smalldatatype=datatype.toLowerCase();
		if (smalldatatype.charAt(0)=="i") {checkvalue=parseInt(value)};
		}
		if ((parseFloat(min)==min && checkvalue<min) || (parseFloat(max)==max && checkvalue>max) || value!=checkvalue)
		{if (alertbox!="") {alert(alertbox);} return false;}
		else {return true;}
		}
	}

// Use this to add a function to the onload event
function addOnloadEvent(fnc){
  if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", fnc, false );
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else
      window.onload = fnc;
  }
}

function popUp(url,w,h){
	var properties = 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width='+w+',height='+h+'';
	mypopup = window.open(url,'name', properties);
	if (mypopup == undefined) {alert('It appears that your browser has popup blocking enabled.\nPlease modify this setting to allow for full functionality.');}
	else {mypopup.focus();}
}

// Init pop-up height vars
var addHeight = 0;
var baseHeight = 490;
var testHeight = false;
function popMedia(thevar) {
	
	var mh_url = pathprefix + "cf_media2/popheight.cfm";
	
	synRequest(mh_url);
	mediaAction(thevar);
	
}

// perform actual window open
function mediaAction (thevar){
	var popHeight = baseHeight + (addHeight/1);
	
	if ( ((thevar.indexOf('grp=') != -1) || (thevar.indexOf('cat=') != -1) || (thevar.indexOf('chnl=') != -1) || (thevar.indexOf('obj='))) != -1 && thevar != '' ) {
		
		/* Replaced by new media 
		theurl = pathprefix + 'cf_media/index.cfm?' + thevar;
		var properties = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550';
		*/
		if ((thevar.indexOf('grp='))  != -1 && thevar != '') {
			thevar = thevar.replace('grp','g');
			
			var properties = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=580,height='+popHeight;
			theurl = pathprefix + 'cf_media2/index.cfm?' + thevar;
		} else {
			
			// Launch Full Player
			var properties = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=830,height='+popHeight;
			theurl = pathprefix + 'cf_media2/index.cfm?' + thevar;
		}
	} else {
		if ((thevar.indexOf('g='))  != -1 && thevar != '') {
			var properties = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=580,height='+popHeight;
			theurl = pathprefix + 'cf_media2/index.cfm?' + thevar;
		} else {
			var properties = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=830,height='+popHeight;
			theurl = pathprefix + 'cf_media2/index.cfm?' + thevar;
		}
		
	}
	mymedia = window.open(theurl,'popupmedia', properties);
	mymedia.focus();
}

// Callback for getting the media header height
function mediaHeight(rq,thevar) {
	addHeight = rq.responseText;
	testHeight = true;
	
}

function synRequest(url){
	
	if(window.XMLHttpRequest) {
		// Gecko (Firefox, Moz), KHTML (Konqueror, Safari), Opera, Internet Explorer 7
		var req = new XMLHttpRequest(); 
	} else if(window.ActiveXObject) {  
		var req = new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer 4,5,5.5,6
	} 
	
	req.open('GET', url, false); 
	req.send(null);
	if(req.status == 200){
		addHeight = req.responseText;
	} else {
		// Fail to default of 80
		addHeight = 80;
	}
 	
}

// Request
	function request(url,method,qs,callback,cbparam){
		var myRequest = null;
		var ready  = false;
	
		try {
			if(window.XMLHttpRequest) {
				
				// Gecko (Firefox, Moz), KHTML (Konqueror, Safari), Opera, Internet Explorer 7
				myRequest = new XMLHttpRequest(); 
			} else if(window.ActiveXObject) {  
				myRequest = new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer 4,5,5.5,6
			} 
		} catch(e) {
			return false;
		}
		
		ready = false;
		method = method.toUpperCase();
	
		try {
			if((method=="GET") || (method=="HEAD"))
			{
				myRequest.open(method, url+qs, true);
			}
			else if(method=="POST")
			{
				myRequest.open(method, url, true);
				myRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			}
			myRequest.onreadystatechange = function(){
				if(myRequest.readyState==4 && !ready) {
					ready = true;
					callback(myRequest,cbparam);
				} else {
				return false;
				}
			}
			myRequest.send(qs);
		}
		catch(e) {
			return false;
		}
		return true;
	}
	

// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
function writeJS(player,grp,wide,high,auto,rand,time,aspect){
		
	var requiredMajorVersion = 8;
	var requiredMinorVersion = 0;
	var requiredRevision = 0;
	 
	if(player == 'slideshow'){
		var playerType = 'slideshow_small';	
        var defaultHeight = 225;
        var defaultWidth = 300;
		
	}
	else if(player == 'mp3'){
		var playerType = 'mp3_small';
        var defaultHeight = 80;
        var defaultWidth = 300;
		aspect = (defaultWidth/defaultHeight); // force landscape view
	}
	else if(player == 'video'){
		var playerType = 'video_small';
        var defaultHeight = 225;
        var defaultWidth = 300;
	}
	
	if(grp != null){var mediaPath = grp;}
	if(auto != null){var autoplay = auto;}
	if(rand != null){var ran = rand;}
	if(time != null){var timer = time;}

    if((wide != null)&&(high != null)){
		var width = wide;
		var height = high;
	}
    else if((wide != null)&&(high == null)){
		var width = wide;
		
		// (defaultHeight/defaultWidth) or (defaultWidth/defaultHeight)
		var height = Math.round(width * aspect); 
		
		// force mp3 height to be static - (height < 80)&&
        if((player == 'mp3')){
			height = 80;
         }
	}
	else if((wide == null)&&(high != null)){
		var height = high;
		
		// (defaultWidth/defaultHeight) or (defaultHeight/defaultWidth)
		var width = Math.round(height * aspect);
		
	}
    else if((wide == null)&&(high == null)){
		var width = defaultWidth;
		var height = defaultHeight;
	}

	var filename = "cf_media2/players/"+playerType+".swf";

        var alternateContent = '<div id="tooolds"><p>We have detected that your version of flash is too old.</p><p>This Media Gallery requires Flash 8 or higher</p><p align="center"><a href="http://www.adobe.com/go/getflashplayer" target="_blank"><img src="../images/get_flash_player.gif" alt="Get the Flash Player" border="0" /></a></p></div>';

	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	
	// +' <param name="bgcolor" value="#000000" />'
	if(hasRightVersion) {  // if we've detected an acceptable version
    	var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
   		+ 'width="'+width+'" height="'+height+'"'
    	+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="mm_movie'+grp+'">'
	    + '<param name="movie" value="'+filename+'" />'
	    + '<param name="quality" value="high" /><param name="wmode" value="transparent" />'
                
		+ '<param name="FlashVars" value="high='+height+'&wide='+width+'&autoplay='+autoplay+'&rand='+ran+'&timer='+timer+'&grp='+grp+'" />'
    	+ '<embed src="'+filename+'" quality="high" wmode="transparent"'
    	+ 'width="'+width+'" height="'+height+'" name="mm_movie'+grp+'" align="middle"'
		+ 'FlashVars="high='+height+'&wide='+width+'&autoplay='+autoplay+'&rand='+ran+'&timer='+timer+'&grp='+grp+'" '
    	+ 'play="true"'
	    + 'loop="false"'
	    + 'quality="high"'
    	+ 'allowScriptAccess="sameDomain"'
	    + 'type="application/x-shockwave-flash"'
    	+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
	    + '<\/embed>' 
    	+ '<\/object>';
 	  // document.write(oeTags);   // embed the flash movie
	  return oeTags;
  	} 
 	else {  // flash is too old or we can't detect the plugin
  	 	// document.write(alternateContent);  // insert non-flash content
		return alternateContent;
 	}
}

// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 

// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}


// THIS SCRIPT IS USED TO GET THE DIMENSIONS OF A DIV OR TABLE - mostly for media2
function getStyle(elem, style) {
	if(!document.getElementById){return;}
	
	var value = elem.style[style];
	
	if(!value){
		if(document.defaultView){
			value = document.defaultView.getComputedStyle(elem, "").getPropertyValue(style);
		}
        else if(elem.offsetWidth){
			//value = elem.currentStyle[style];
			value = elem.offsetWidth;
			
		}
	}
	return value;
}

// Output the media html
function writeMediaJS(divID,playername,data1,mediawidth,mediaheight,auto_tog,random_tog,delay_num,data7){
	var theDiv=document.getElementById(divID);
	
	if(mediawidth == null){
		var currWidth = parseInt(getStyle(theDiv,"width"));
		if((currWidth==0)||(isNaN(currWidth))){currWidth = null;}
	} else {
		var currWidth = mediawidth;
	}
	
	if(mediaheight == null){
		var currHeight = parseInt(getStyle(theDiv,"height"));
		if((currHeight==0)||(isNaN(currHeight))){currHeight = null;}
	} else {
		var currHeight = mediaheight;
	}
	
	theDiv.innerHTML = writeJS(playername,data1,currWidth,currHeight,auto_tog,random_tog,delay_num,data7);
}

function printpage(){
	thestring = location.search.substring(1);
	var findid = thestring.indexOf('id=');
	var findp = thestring.indexOf('p=');
	if (thestring.length == 0){thestring = 'p=' + pageid}
	else if (findid == -1 && findp == -1){thestring = thestring + '&p='+pageid}
   
	for (var f = 0; f<document.forms.length; f++)
		{
		for (var i = 0; i<document.forms[f].length; i++)
			{
			if (thestring.indexOf(document.forms[f].elements[i].name) == -1 && document.forms[f].elements[i].value != "" && document.forms[f].elements[i].type != "submit" && document.forms[f].elements[i].name != "" && document.forms[f].elements[i].name.indexOf('savecontent') == -1 && document.forms[f].elements[i].name.indexOf('savetext') == -1 && document.forms[f].elements[i].name != "p" && thestring.indexOf(document.forms[f].elements[i].name) == -1  && document.forms[f].elements[i].name != "do" && document.forms[f].elements[i].name != "calid_pull" && document.forms[f].elements[i].name != "customizeit")
				{
				if (document.forms[f].elements[i].type == 'checkbox') 
					{
						if (document.forms[f].elements[i].checked == true) 
							{
								thestring = thestring + "&" + document.forms[f].elements[i].name + "=" + document.forms[f].elements[i].value;
							} 
					}
				else {
					if (document.forms[f].elements[i].value.indexOf('&') == -1)
						{thestring = thestring + "&" + document.forms[f].elements[i].name + "=" + document.forms[f].elements[i].value;}
					else
						{
							var splitValue = document.forms[f].elements[i].value.split("&");
							for(v = 0; v < splitValue.length; v++){
								if (thestring.indexOf(splitValue[v]) == -1)
									{thestring = thestring + "&" + splitValue[v]}
							}
						}
					}
				}
			}
		}

	var url = 'pageprint.cfm?'+thestring;
	var properties = 'toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=650,height=600';
	printpop = window.open(url,'Print', properties);
	printpop.focus();
}

function emailpage(){
	thestring = location.search.substring(1);
	var findid = thestring.indexOf('id=');
	var findp = thestring.indexOf('p=');
	if (thestring.length == 0){thestring = 'p=' + pageid}
	else if (findid == -1 && findp == -1){thestring = thestring + '&p='+pageid}
	
	for (var f = 0; f<document.forms.length; f++)
		{
		for (var i = 0; i<document.forms[f].length; i++)
			{
			if (thestring.indexOf(document.forms[f].elements[i].name) == -1 && document.forms[f].elements[i].value != "" && document.forms[f].elements[i].type != "submit" && document.forms[f].elements[i].name != "" && document.forms[f].elements[i].name.indexOf('savecontent') == -1 && document.forms[f].elements[i].name.indexOf('savetext') == -1 && document.forms[f].elements[i].name != "p" && thestring.indexOf(document.forms[f].elements[i].name) == -1  && document.forms[f].elements[i].name != "do" && document.forms[f].elements[i].name != "calid_pull" && document.forms[f].elements[i].name != "customizeit")
				{
				if (document.forms[f].elements[i].type == 'checkbox') 
					{
						if (document.forms[f].elements[i].checked == true) 
							{
								thestring = thestring + "&" + document.forms[f].elements[i].name + "=" + document.forms[f].elements[i].value;
							} 
					}
				else {
					if (document.forms[f].elements[i].value.indexOf('&') == -1)
						{thestring = thestring + "&" + document.forms[f].elements[i].name + "=" + document.forms[f].elements[i].value;}
					else
						{
							var splitValue = document.forms[f].elements[i].value.split("&");
							for(v = 0; v < splitValue.length; v++){
								if (thestring.indexOf(splitValue[v]) == -1)
									{thestring = thestring + "&" + splitValue[v]}
							}
						}
					}
				}
			}
		}

	var url = 'pageemail.cfm?'+thestring;
	var properties = 'toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=420,height=300';
	emailpop = window.open(url,'Email', properties);
	emailpop.focus();
}

var x = 1;
var y = x;

function confirmIt(){
	if (x == 1) {}
	else {return("You have not saved the latest changes made to this page. The\nchanges will be discarded if you leave before clicking 'save changes'.")}
}

function writeDate(){
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if(year<1000){year = 1900 + year}
return(lmonth + " " + date + ", " + year);
}

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;
}

function mailMe(which){
	window.location="mailto:"+which.replace(/\[nospam\]/,"@");
}

//-->
