﻿// Site Java Scripts
	function fInputStyle_focusout(input, value){
		if(input.value=="" || input.value==value){	
			input.value=value;
		}
	}
	
	function fInputStyle_focusin(input, value){
		if(input.value==value){	
			input.value="";
		}
	}


function jsf_EmbedFlashObjectx(sElement, sFlashPath, sFlashID, lWidth, lHeight, sAlignment, sBackgroundColor, sFlashVariables) {
//This function creates an external reference to a flash object - fixes the 'click to active' in IE
var sBaseURL="";
	 var oElement = document.getElementById(sElement);
	oElement.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="' + lWidth + '" height="' + lHeight + '" id="' + sFlashID + '" name="' + sFlashID + '"> '
		+ '<param name="movie" value="' + sFlashPath + '">'
		+ '<param name="allowscriptaccess" value="always">'
		+ '<param name="salign" value="' + sAlignment + '">'
		+ '<param name="play" value="true">'
		+ '<param name="loop" value="false">'
		+ '<param name="menu" value="false">'
		+ '<param name="quality" value="autohigh">'
		+ '<param name="scale" value="noscale">'
		+ '<param name="bgcolor" value="' + sBackgroundColor + '"> '
		+ '<param name="wmode" value="transparent">'
		+ '<param name="base" value="' + sBaseURL + '">'
		+ '<param name="flashvars" value="' + sFlashVariables + '">'
		+ '<param name="type" value="application/x-shockwave-flash"> '
			+ '<embed width="' + lWidth + '" height="' + lHeight + '" src="' + sFlashPath + '" pluginspace="https://www.macromedia.com/go/getflashplayer" ' 
				+ 'id="' + sFlashID + '" name="' + sFlashID + '" allowscriptaccess="always" salign="' + sAlignment + '" play="true" loop="false" menu="false" '
				+ 'quality="autohigh" scale="exactfit" bgcolor="' + sBackgroundColor + '" wmode="transparent" base="' + sBaseURL + '" flashvars="' + sFlashVariables + '" '
				+ 'type="application/x-shockwave-flash" '
			+ '</embed> '
		+ '</object>' ;
	document.close();
}


function jsf_executeFunction_AutoUpdater(sElementId, sURL, sContainer) {
//this function posts the specified form to the specified url and posts the fragment back to the container
var postData=sURL, postBuffer, oForm;

	oForm=document.getElementById(cs_Form(sElementId).id)

	if(oForm) { postBuffer=$(oForm).serialize(); } else { postBuffer=''; }
	postBuffer=cs_appendString(postBuffer, 'postback='+sElementId, '&')

	new Ajax.Updater(sContainer, postData, {
		method: 'post',
		parameters: postBuffer,
		evalScripts: true, 
		asynchronous: true
	} );

}

function jsf_executeFunction_UpdateFragment(oForm, sURL, sContainer) {
//this function posts the specified form to the specified url and posts the fragment back to the container
var postData=sURL, postBuffer;

	if(oForm) { postBuffer=$(oForm).serialize(); } else { postBuffer=''; }

	new Ajax.Updater(sContainer, postData, {
		method: 'post',
		parameters: postBuffer,
		evalScripts: true
	} );
}





var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function dock_DoFSCommand(command, args) {
	var dockObj = isInternetExplorer ? document.all.dock : document.dock;
	//
	// Place your code here.
	if (command == "fActivateDock"){
		document.getElementById('flash_cont').style.zIndex=60;
		document.getElementById('main').style.zIndex=6;
	}
	if (command == "fDeactivateDock"){
		document.getElementById('flash_cont').style.zIndex=6;
		document.getElementById('main').style.zIndex=60;
	}
	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub dock_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call dock_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}