/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;



/*
* Utility Functions
*
* @author       Seisan Consulting   2-16-2006
*/

/*
* Function to take a standard javascript event object and return the target that triggered the event.
* Pre-Condtion: An javascript event must exist.
* Post-Condition: The target that triggered the event is returned.
*
* @param        e - standard javascript event
* @return		targ - the target that triggered the event.
* @author       Seisan Consulting   2-16-2006
*/
function getEventCurrentTarget(e){
	var targ
	if (!e) var e = window.event
	if (e.currentTarget) targ = e.currentTarget
	else if (e.srcElement) targ = e.srcElement
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode
	return targ;
}

/*
* Function to take a standard javascript event object and return the physical element that triggered the event.
* Pre-Condtion: An javascript event must exist.
* Post-Condition: The physical element that triggered the event is returned.
*
*
* @param        e - standard javascript event.
* @return		targ - Returns the physical element that triggered the event.
* @author       Seisan Consulting   2-16-2006
*/
function getEventElement(e){
	var targ
	if (!e) var e = window.event
	if (e.target) targ = e.target
	else if (e.srcElement) targ = e.srcElement
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode
	return targ;
}

/*
* Function to get the x value of the physical element clicked.
* Pre-Condtion: An javascript event must exist.
* Post-Condition: The x value of the physical element clicked is returned.
*
* @param        e - a standard javascript event
* @return		event.offsetX - the x value of the physical element clicked.
* @author       Seisan Consulting   2-16-2006

function getImageXfromLeft(e) {
  if (!browserCheck.ie) return e.layerX;
  else return event.offsetX;
}


* Function to get the y value of the physical element clicked.
* Pre-Condtion: An javascript event must exist.
* Post-Condition: The y value of the physical element clicked is returned.
*
*
* @param        e - a standard javascript event
* @return		e.layerY - The y value of the physical element clicked.
* @author       Seisan Consulting   2-16-2006

function getImageYfromTop(e) {
  if (!browserCheck.ie) return e.layerY;
  else return event.offsetY;
}


* Function to get the x value of the location clicked in the browser client.
* Pre-Condtion: An javascript event must exist.
* Post-Condition: The x value of the location clicked in the browser client is returned.
*
* @param        e - a standard javascript event
* @return 		event.clientX + scrollx - x location clicked in the browser client.
* @author       Seisan Consulting   2-16-2006

function getClientXfromLeft(e) {
	var scrollx = (document.all)?document.body.scrollLeft:window.pageXOffset;
	if (!browserCheck.ie) return e.clientX + scrollx;
	else return event.clientX + scrollx;
}


* Function to get the y value of the location clicked in the browser client.
* Pre-Condtion: An javascript event must exist.
* Post-Condition: The y value of the location clicked in the browser client is returned.
*
* @param        e - s standard javascript event
* @return 		event.clientY + scrolly - the y value of the location clicked in the browser client.
* @author       Seisan Consulting   2-16-2006

function getClientYfromTop(e) {
	 var scrolly = (document.all)?document.body.scrollTop:window.pageYOffset;
	if (!browserCheck.ie) return e.clientY + scrolly;
	else return event.clientY + scrolly;
}

/*
* Function to append an option to a select statement.
* Pre-Condition: The select statement must exist.
* Post-Condition: The option is added to the select statement passed to the function.
*
* @param        select - the name of the select statement to be appended.
* @param		option - the option to be appeneded to the select statement.
* @return		select - the select statement with the new option appended.
* @author       Seisan Consulting   2-16-2006
*/
function appendOptionToSelect(select, option){
	if(browserCheck.ie){
		var num = select.options.length;
		select.options[num] = option;
	}
	else {
		select.appendChild(option);
	}
	return select;
}


/*
* Function that creates an option for a select statement.
* Post-Condition: An option is created with the text and value pair.
* @param        value - a value of a option
* @param		text - the text of the option
* @return		opt - the completed option statement
* @author       Seisan Consulting   2-16-2006
*/
function getSelectOption(value, text){
	var opt;
	if(browserCheck.ie){
		opt = new Option(text,value);
	}
	else {
		opt = document.createElement("option");
		opt.value = value;
		opt.text = text;
	}
	return opt;
}


/*
* Function to get an XML Request object.
* Pre-Condition: The client browser must support XML transfers
* Post-Condition: The correct XML request object is returned based on the client browser
*
* @return		An XML Rquest Object
* @author       Seisan Consulting   2-16-2006

function getHTTPRequest(){
	if (window.XMLHttpRequest) {
        return new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        return new ActiveXObject("Microsoft.XMLHTTP");
    }
	else {
		alert("You browser doesn't support xml transfers, you cannot view this!");
	}
}

/*
* Function to retrieve an XML Document.
* Post-Condition: The XML document is returned.
*
* @return		xmlDoc - an XML document
* @author       Seisan Consulting   2-16-2006

function getXMLDocument() {
	var xmlDoc;
	// code for IE
	if (window.ActiveXObject){
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	}
	// code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation && document.implementation.createDocument){
		xmlDoc=document.implementation.createDocument("","",null);
	}
	else{
		alert('Your browser cannot handle this script');
	}
	return xmlDoc;
}

/*
* Function to retrieve a node from an XML document.
* Pre-Condition: The XMl node must exist.
* Post-Condition: An array of values are returned from the node specified.
*
* @param        xmlDoc - the XML document the node is retrieved from.
* @param		str - the node requested.
* @return		An Array of the node values.
* @author       Seisan Consulting   2-16-2006

function getNode(xmlDoc, str){
	//gets node from xmlDoc, node tree is split by '/'
	try{
		var arr = str.split('/');
		return getNodeViaArray(xmlDoc.responseXML.documentElement, 0, arr);
	}
	catch(exc){
		return null;
	}
}

/*
* Function that recursively finds an XML node at the end of an array.
* Pre-Condition: The XML node exists.
* Post-Condition: If found an XML node is returned.
*
* @param        node - element currently at
* @param		num - number of the element in the current array
* @param 		arr - array containing xml node names
* @return		If found an XML node, if not null is returned.
* @author       Seisan Consulting   2-16-2006

function getNodeViaArray(node, num, arr){
	//recursive function finds node at the end of the arr array
	if(num == arr.length){
		return node;
	}
	else if(arr[num] == ""){
		return getNodeViaArray(node, num+1, arr);
	}
	else if(arr[num] == node.nodeName){
		return getNodeViaArray(node, num+1, arr);
	}
	else {
		var children = node.childNodes;
		for(i=0; i < children.length;i++){

			if(children[i].nodeName == arr[num]){
				return getNodeViaArray(children[i], num+1, arr);
			}
		}
		return null;
	}
}

/*
* Function to check whether an object is in an array.
* Post-Condition: A boolean value is returned evaluating if the object is found in the array.
*
* @param        needle - an object
* @param		haystack - an array
* @return 		Boolean value holding whether the object is found in the array or not.
* @author       Seisan Consulting   2-16-2006

function isIn(needle, haystack){
	for(var i=0; i < haystack.length; i++){
		if(haystack[i].match(needle) != null)
			return true;
	}
	return false;
}

/*
* Function to some of the children from a node with the exception of those specified as exempt.
* Pre-Condition: The node is an html element
* Post-Condition: All child elements are removed from the node
*
* @param        node - node to which the children are to be removed from
* @param		exempt - children exceptions - not to be removed
* @author       Seisan Consulting   2-16-2006

function removeSomeChildren(node, exempt){
	if(!node){
		return;
	}

	var len = node.childNodes.length;

	for(var i = 0; i < len; i++){
		try{
			if(!isIn(node.childNodes[i].id, exempt)){
				node.removeChild(node.childNodes[i]);
			}
		}
		catch(ex){}
	}

}

/*
* Function to remove all children from a node.
* Pre-Condition: The node is an html element.
* Post-Condition: All children are removed from the node.
*
* @param        node - node to have all children removed from.
* @author       Seisan Consulting   2-16-2006
*/
function removeAllChildren(node){
	if(!node){
		return;
	}

	var len = node.childNodes.length;

	for(var i = 0; i < len; i++){
		try{
			node.removeChild(node.childNodes[i]);
		}
		catch(ex){}
	}

	node.innerHTML = "";

}

/*
* Function to create a web cookie.
* Pre-Condition: The String passed is in the format yyyy-mm-dd hh:mm:ss.
* Post-Condition: A javascript Date object is created and returned.
*
* @param        str - a formatted string containing a date and time
* @return		date - a standard javascript date object
* @author       Seisan Consulting   2-16-2006

function odbcCanonicalToJSDate(str){
	var year = str.substring(0,4);
	var month = str.substring(5,7);
	var day = str.substring(8,10);
	var hours = str.substring(11,13);
	var minutes = str.substring(14,15);
	var seconds = str.substring(17,19);

	var date = new Date();
	date.setDate(parseInt(day));
	date.setMonth(parseInt(month-1));
	date.setFullYear(parseInt(year));
	date.setHours(parseInt(hours));
	date.setMinutes(parseInt(minutes));
	date.setSeconds(parseInt(seconds));
	return date;

}

/*
* Function to display all member functions of an object through standard output.
* Pre-Condition: A web cookie is created with the name "name", a value of "value" and set to expire on the time specified in "days" converted to UTC.
* Post-Condition: All member functions are displayed of the object passed in.
*
* @param        obj - the object that contains member functions.
* @param		parent - second parameter.
* @author       Seisan Consulting   2-16-2006

function dumpProps(obj, parent) {
   // Go through all the properties of the passed-in object
   for (var i in obj) {
      // if a parent (2nd parameter) was passed in, then use that to
      // build the message. Message includes i (the object's property name)
      // then the object's property value on a new line
      if (parent) { var msg = parent + "." + i + "\n" + obj[i]; } else { var msg = i + "\n" + obj[i]; }
      // Display the message. If the user clicks "OK", then continue. If they
      // click "CANCEL" then quit this level of recursion
      if (!confirm(msg)) { return; }
      // If this property (i) is an object, then recursively process the object
      if (typeof obj[i] == "object") {
         if (parent) { dumpProps(obj[i], parent + "." + i); } else { dumpProps(obj[i], i); }
      }
   }
}

/*
* Function to read a CSS type Stylesheet.
* Pre-Condition: Information exists in a CSS type Stylesheet
* Post-Condition: A string is returned displaying information in a CSS Stylesheet.
*
* @param        oElm - element
* @param		strCssRule - callback function
* @return 		strValue - value of the information read from the stylesheet.
* @author       Seisan Consulting   2-16-2006

function getStyle(oElm, strCssRule){
    var strValue = "";
    if(document.defaultView && document.defaultView.getComputedStyle){
        strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
    }
    else if(oElm.currentStyle){
        strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
            return p1.toUpperCase();
        });
        strValue = oElm.currentStyle[strCssRule];
    }
    return strValue;
}


/*
* Function retrieve the value of the inner window height of the client browser.
* Post-Condition: The value of the inner window height of the client browser is returned.
*
* @return		myHeight - value of the height of the inner window of the client browser.
* @author       Seisan Consulting   2-16-2006

function getBrowserWindowHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

/*
* Function retrieve the value of the inner window wifth of the client browser.
* Post-Condition: The value of the inner window width of the client browser is returned.
*
* @return		myWidth - value of the width of the inner window of the client browser.
* @author       Seisan Consulting   2-16-2006

function getBrowserWindowWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}

/*
* Function to format a number passed into Currency.
* Pre-Condition: The value passed into the function must be a valid number.
* Post-Condition: The number is converted and displayed as currency in dollars and cents.
*
* @param        num - a value to be converted into currency
* @return		A string that contains the formatted value of the currency.
* @author       Seisan Consulting   2-16-2006

function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
		num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + '$' + num + '.' + cents);
}

/*
* Function to change the visibility status of an html element.
* Pre-Condition; The element must be an html element.
* Post-Condition: The visibility status of the html element is switched based on the initial status of the element.
*
* @param        element - an html element
* @param		status - visibility status
* @author       Seisan Consulting   2-16-2006

function changeElementVisibility(element, status)
{
	if (document.layers)
	{
		if(status == "visible")
			status = "show";
		else
			status = "hide";
		element.visibility = status;
	}
	else if (document.all || document.getElementById)
	{
		element.style.visibility = status;
	}
}



* Function to build an html input element.
* Pre-Condition: none
* Post-Condition: An html input element is constructed based on the type, name and value.
*
* @param        type - input type
* @param		name - input name
* @param		value - input value
* @return       input - an html input element
* @author       Seisan Consulting   2-16-2006
*/
function createInputElement(type, name, value){
	if(browserCheck.ie)
		return document.createElement("<input type=\"" + type + "\" name=\"" + name + "\" value=\"" + value + "\"/>");
	else {
		input = document.createElement("input");
		input.type = type;
		input.name = name;
		input.value = value;
		return input;
	}
}
