includeStyleSheet('JSCalendar/calendar-system.css');
includeScript('JSCalendar/calendar.js');
includeScript('JSCalendar/lang/calendar-en.js');
includeScript('JSCalendar/calendar-setup.js');
includeScript('FCKeditor/fckeditor.js');
includeScript('Scripts/GUIControls.js');
includeScript('Scripts/Configuration.js');

function Body_Onload()
{
	includeScript('Scripts/LoadGUIControls.js');
	includeScript('Scripts/LanguageConverter.js');
	includeScript('Scripts/pngfix.js');
	
	// Initialise the menus
	initialiseMenus();
	
	// Open current menus.
	var eCurrentMenus = document.getElementById('CurrentMenus');
	if (eCurrentMenus == null && document.getElementsByName('CurrentMenus').length > 0)
		eCurrentMenus = document.getElementsByName('CurrentMenus')[0];
	if (eCurrentMenus != null && eCurrentMenus.value != '')
		openMenus(eCurrentMenus.value);
	
	// Set focus on first control.
	var eFirstControl = document.getElementById('FirstControl');
	if (eFirstControl != null && eFirstControl.value != '')
		document.getElementById(eFirstControl.value).focus();
	else
		focusOnNextControl(null);
	
	// Display message when page loaded.
	var eMessage = document.getElementById('Message');
	var bIsInformationMessage = false;
	if (eMessage != null && eMessage.innerHTML != '')
		if (eMessage.className == 'InformationMessage')
			bIsInformationMessage = true;
		else
			alert(eMessage.innerHTML);
	
	// If openned from another window, close and update parent.
	if (window.opener != null && window.opener.closed == false)
	{
		var eOptionValue = document.getElementById('OptionValue');
		if (eOptionValue != null)
		{
			var sOptionValue = eOptionValue.value;
			if (sOptionValue != '')
			{
				// make sure the openoptionurl of the current "select" control matches this windows url.
				var sOpenOptionURL = window.opener.getSelectOpenOptionURL(null);
				var sHref = window.location.href;
				if (sOpenOptionURL != '' && sHref.substring(sHref.length - sOpenOptionURL.length) == sOpenOptionURL)
				{
					window.close();
					window.opener.loadSelectOption(null, sOptionValue);
					return;
				}
			}
		}
	}
	
	// Set forms to check if valid on submitting.
	for (i = 0; i < document.forms.length; i++)
		document.forms.item(i).onsubmit = isFormValid;
	
	// Redirect when page loaded.
	var eRedirect = document.getElementById('Redirect');
	if (eRedirect != null && eRedirect.value != '')
	{
		var eBody = document.getElementsByTagName('body')[0];
		if (navigator.userAgent.toLowerCase().indexOf("msie") != -1)
			eBody.disabled = true;
		else
			disableChildControls(eBody);
		if (window.navigate)  
			setTimeout('window.navigate(\'' + eRedirect.value.replace(/\\/g,'\\\\').replace(/\'/g, '\\\'') + '\')', (bIsInformationMessage == true) ? 5000 : 0);
		else 
			setTimeout('window.location = \'' + eRedirect.value.replace(/\\/g,'\\\\').replace(/\'/g, '\\\'') + '\'', (bIsInformationMessage == true) ? 5000 : 0);
	}
}

function isFormValid(e)
{
	var eForm;
	if (window.event) // IE
		eForm = window.event.srcElement;
	else
		eForm = e.target;

	for (var i = 0; i < eForm.elements.length; i++)
	{
		var eControl = eForm.elements[i];
		if (eControl.getAttribute('required') != null && eControl.getAttribute('required').toLowerCase() == 'true' && eControl.value == '')
		{
			alert('A value is required for ' + getControlDisplayName(eControl.name) + '.');
			eControl.focus();
			return false;
		}
		if (eControl.value != '')
			if (eControl.getAttribute('valuetype') == 'EmailAddress')
			{
				if (isEmailAddressValid(eControl.value) == false)
				{
					alert(getControlDisplayName(eControl.name) + ' is invalid.');
					eControl.focus();
					return false;
				}
			}
	}
	var aDivs = document.getElementsByTagName('div');
	for (var i = 0; i < aDivs.length; i++)
	{
		var eDiv = aDivs[i];
		if (eDiv.className == 'FormLinkingForeignCollectionControl' && eDiv.getAttribute('required') != null && eDiv.getAttribute('required').toLowerCase() == 'true')
		{
			var bHasValueSelected = false;
			var aControls = eDiv.getElementsByTagName('input');
			for (var j = 0; j < aControls.length; j++)
			{
				bHasValueSelected = aControls[j].checked;
				if (bHasValueSelected == true)
					break;
			}
			if (bHasValueSelected == false)
			{
				alert('A value is required for ' + getControlDisplayName(eDiv.id) + '.');
				eDiv.focus();
				return false;
			}
		}
	}
	
	// Launch the upload bar if required.
    return launchUploadBar(eForm);
}


function isEmailAddressValid(sEmailAddress)
{
	var rEmailFormat = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	return rEmailFormat.test(sEmailAddress);
}


function focusOnNextControl(eControl)
{
	var bNext = (eControl == null || eControl.id == '');
	for (i = 0; i < document.forms.length; i++)
	{
		var eForm = document.forms.item(i);
		for (j = 0; j < eForm.elements.length; j++)
		{
			var eElement = eForm.elements.item(j);
			if (bNext == true)
			{
				if ((eElement.tagName.toLowerCase() != 'input' || eElement.type.toLowerCase() != 'hidden') && eElement.style.display != 'none' && eElement.style.visibility != 'hidden')
				{
					eElement.focus();
					return;
				}
			}
			else
				bNext = (eControl.id == eElement.id);
		}
	}
}

function disableChildControls(eElement)
{
	for (var i = 0; i < eElement.childNodes.length; i++) {
		var eControl = eElement.childNodes[i];
		try {
			eControl.disabled = true;
		} catch (e) {}
		disableChildControls(eControl);
	}
}

function setCookie(sName, sValue, iExpiryDays)
{
	var dExpiry = new Date();
	dExpiry.setDate(dExpiry.getDate() + iExpiryDays);
	document.cookie = sName + '=' + escape(sValue) + ((iExpiryDays == null) ? '' : ';expires=' + dExpiry.toGMTString());
}


function getCookie(sName)
{
	if (document.cookie.length > 0)
	{
		iStartPosition = document.cookie.indexOf(sName + '=');
		if (iStartPosition != -1)
		{ 
			iStartPosition = iStartPosition + sName.length + 1;
			iEndPosition = document.cookie.indexOf(';', iStartPosition);
			if (iEndPosition == -1)
				iEndPosition = document.cookie.length;
			return unescape(document.cookie.substring(iStartPosition, iEndPosition));
		}
	}
	return '';
}


function getControlDisplayName(sName)
{
	if (sName.substring(sName.length - 8, sName.length) == '_Control')
		return spaceName(sName.substring(0, sName.length - 8));
	else
		return spaceName(sName);
}


function spaceName(sName)
{
	// to be written: put spaces before capitals
	return sName;
}


var sBrowserLanguage = null;
function getBrowserLanguage()
{
	if (sBrowserLanguage == null)
	{
		var aElements = document.getElementsByName('browser-language');
		if (aElements != null)
			sBrowserLanguage = aElements[0].attributes.getNamedItem('content').value;
		else if (navigator.language)
			sBrowserLanguage = navigator.language.toLowerCase();
		else if (navigator.userLanguage)
			sBrowserLanguage = navigator.userLanguage.toLowerCase();
		else if (navigator.systemLanguage)
			sBrowserLanguage = navigator.systemLanguage.toLowerCase();
		else if (navigator.browserLanguage)
			sBrowserLanguage = navigator.browserLanguage.toLowerCase();
	}
	return sBrowserLanguage;
}


// This will close sub menus and set events
// They are initially openned due to SEO
function initialiseMenus()
{
	var aMenus = document.getElementsByTagName('ul');
	for (var i = aMenus.length - 1; i >= 0; i--) // in reverse due to IE not closing properly
	{
		var eMenu = aMenus.item(i);
		if (eMenu.className.split(' ').indexOf('Menu') >= 0)
		{
			var eParentItem = eMenu.parentNode;
			if (eParentItem.tagName.toLowerCase() == 'li')
			{
				var aClassNames = eParentItem.className.split(' ');
				if (aClassNames.indexOf('Item') >= 0)
				{
					if (aClassNames.indexOf('ToggleSubMenu') >= 0)
						eParentItem.onclick = toggleSubMenu;
					else
					{
						eParentItem.onmouseover = new Function('openSubMenu(this);');
						eParentItem.onmouseout = new Function('closeSubMenu(this);');
					}
					eMenu.className = eMenu.className + ' Closed';
				}
			}
		}
	}
}

// This will open the passed menus
function openMenus(sMenus)
{
	var aMenus = sMenus.split(';');
	for (var iMenu = 0; iMenu < aMenus.length; iMenu++)
	{
		var aSubMenus = aMenus[iMenu].split('.');
		var eSubMenu = document.getElementById(aSubMenus[0]).childNodes[0];
		for (var iSubMenu = 1; iSubMenu < aSubMenus.length; iSubMenu++)
		{
			var sSubMenuClassName = aSubMenus[iSubMenu];
			var aItems = eSubMenu.childNodes;
			for (var iItem = 0; iItem < aItems.length; iItem++)
			{
				var eItem = aItems[iItem];
				var aClassNames = eItem.className.split(' ');
				if (aClassNames.indexOf(sSubMenuClassName) >= 0 && aClassNames.indexOf('HasSubMenu') >= 0)
				{
					openSubMenu(eItem);
					eSubMenu = eItem.getElementsByTagName('ul').item(0);
					break;
				}
			}
		}
	}
}


function openSubMenu(eItem)
{
	var eSubMenu = eItem.getElementsByTagName('ul').item(0);
	eSubMenu.className = eSubMenu.className.replace(' Closed', ' Opened');
}


function closeSubMenu(eItem)
{
	var eSubMenu = eItem.getElementsByTagName('ul').item(0);
	eSubMenu.className = eSubMenu.className.replace(' Opened', ' Closed');
}


function toggleSubMenu(e)
{
	var eItem = getEventTarget(e);
	var eSubMenu = eItem.getElementsByTagName('ul').item(0);
	var bIsOpen = (eSubMenu.className.indexOf(' Closed') == -1);
	eSubMenu.className = eSubMenu.className.replace((bIsOpen)?' Opened':' Closed', (bIsOpen)?' Closed':' Opened');
	stopEventPropagation(e);
}


function stopEventPropagation(e)
{
	if (!e)
		var e = window.event;
	if (e.stopPropagation)
		e.stopPropagation();
	else
		e.cancelBubble = true;
}


function getEventTarget(e)
{
	var targ;
	if (!e)
		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 toggleRecordSelectors()
{
	var bChecked = document.getElementById('RecordSelectorToggler').checked;
	var aInputs = document.getElementsByTagName('input');
	for (var i = 0; i < aInputs.length; i++)
	{
		var oRecordSelector = aInputs[i];
		if (oRecordSelector.type == 'checkbox')
			if (oRecordSelector.id != null)
				if (oRecordSelector.id != 'RecordSelectorToggler')
					if (oRecordSelector.id.substring(0, 14) == 'RecordSelector')
						oRecordSelector.checked = bChecked;
	}
}


function selectedRecords()
{
	var aInputs = document.getElementsByTagName('input');
	var sRecords = '';
	for (var i = 0; i < aInputs.length; i++)
	{
		var oRecordSelector = aInputs[i];
		if (oRecordSelector.type == 'checkbox')
			if (oRecordSelector.id != null)
				if (oRecordSelector.id != 'RecordSelectorToggler')
					if (oRecordSelector.id.substring(0, 14) == 'RecordSelector')
						if (oRecordSelector.checked == true)
						{
							if (sRecords != '')
								sRecords += ',';
							sRecords += oRecordSelector.id.substring(14);
						}
	}
	return sRecords;
}


function addEvent(fFunction, fFunctionToAdd)
{   
	if (typeof fFunction != 'function')
		return fFunctionToAdd;
	else if (typeof fFunctionToAdd != 'function') 
		return fFunction;
	else
		return function(e) {fFunction(e); fFunctionToAdd(e);}
}


function includeScript(sPath)
{
    var eHead = document.getElementsByTagName('head').item(0);
    var eScript = document.createElement('script');
    eScript.setAttribute('language', 'javascript');
    eScript.setAttribute('type', 'text/javascript');
    eScript.setAttribute('src', sPath);
    eHead.appendChild(eScript);
    return false;
}


function includeStyleSheet(sPath)
{
    var eHead = document.getElementsByTagName('head').item(0);
    var eLink = document.createElement('link');
    eLink.setAttribute('type', 'text/css');
    eLink.setAttribute('rel', 'stylesheet');
    eLink.setAttribute('href', sPath);
    eHead.appendChild(eLink);
    return false;
}


function loadXMLString(sURL)
{
	// returns text result of call to URL
	var oXML;
	if (window.ActiveXObject)
	{
		oXML = new ActiveXObject('Microsoft.XMLDOM');
		oXML.async = false;
		oXML.load(sURL);
		return oXML.xml;
	}
	else
	{
		var oXMLHttpRequest = getXMLHttpRequest();
		oXMLHttpRequest.open('GET', sURL, false);
		oXMLHttpRequest.send('');
		if (oXMLHttpRequest.status == 200)
			return oXMLHttpRequest.responseText;
		else
			throw 'Unable to retrieve information from the server.';
	}
}


function loadXML(sURL)
{
	var oXML;
	if (window.ActiveXObject)
	{
		oXML = new ActiveXObject('Microsoft.XMLDOM');
		oXML.async = false;
		oXML.load(sURL);
	}
	else
		oXML = (new DOMParser()).parseFromString(loadXMLString(sURL), "text/xml");
	return(oXML);
}


function getXMLHttpRequest()
{
	if (window.XMLHttpRequest)
		return new XMLHttpRequest();
    else if(window.ActiveXObject)
        return new ActiveXObject('Microsoft.XMLHTTP');
    else
		throw 'Your browser is unable to retrieve information from the server.';
}


Array.prototype.indexOf = function(value)
{
	for (var i = 0; i < this.length; i++)
		if (this[i] == value)
			return i;
	return -1;
}


function getAttributeValue(eElement, sName)
{
	var a = eElement.attributes.getNamedItem(sName);
	if (a == null)
		return '';
	else
		return a.value;
}


function calculateElementTop(eElement)
{
	return eElement.offsetTop + (eElement.offsetParent == null ? 0 : calculateElementTop(eElement.offsetParent));
}


function calculateElementLeft(eElement)
{
	return eElement.offsetLeft + (eElement.offsetParent == null ? 0 : calculateElementLeft(eElement.offsetParent));
}


function getURLParameter(sName)
{
	var r = new RegExp('[\\?&]' + sName + '=([^&#]*)');
	var aResults = r.exec(window.location.href);
	if( aResults == null )
		return '';
	else
		return unescape(aResults[1]);
}


function generateShortUid()
{
    var result, i, j;
    result = '';
    for(j=0; j<8; j++)   {
        i = Math.floor(Math.random()*16).toString(16).toUpperCase();
        result = result + i;
    }
    return result
}


var meSubmitForm;
var msSubmitFormOrigAction;
var meAddedUploadDiv;

function launchUploadBar(eForm) {

// Look for all the File Input elements.

    var sFilenames = '';
    var aFileInputs = eForm.getElementsByTagName('input');
    var eBody = document.getElementsByTagName('body')[0];
   
    if (aFileInputs != null) {
        var HasFileInputs = 0;
	    for (var i = 0; i < aFileInputs.length; i++)   {
		    var eInput = aFileInputs[i];
		    if (eInput.type == 'file') {
		        if (eInput.value != '') {
		            HasFileInputs = 1;
		            if (sFilenames != '') {
		                sFilenames = sFilenames + ', ';
		            }
	                var nLastBackslash = eInput.value.lastIndexOf('\\');
	                var sNameOnly = eInput.value.substring(nLastBackslash+1);
	                sFilenames += escape(sNameOnly);
			    }
		    }
	    }
	    if (HasFileInputs) {
            meSubmitForm = eForm; // aForms[0];
            msSubmitFormOrigAction = meSubmitForm.action;
            var uid =  generateShortUid();
            meSubmitForm.action = msSubmitFormOrigAction + '&PageUid=' + uid;

            removeUploadDiv();
            var sOpenURL ='UploadStatus.aspx?PageUid=' + uid + '&Files=' + sFilenames;	 
            var aUploadDiv = document.createElement('div');
            aUploadDiv.setAttribute('id','UploadDisplay');
            // Use inner HTML since any other technique produces a inset frame in IE.
            aUploadDiv.innerHTML = '<iframe frameborder="0" scrolling="no" height="100%" width="100%" src="' + sOpenURL + '"/>';
            eBody.insertBefore(aUploadDiv, eBody.childNodes[0]);
            meAddedUploadDiv = document.getElementById('UploadDisplay');
			// Don't submit now: submit in 1000ms so the GUI has time to draw the new elements.
            setTimeout('submitForm()',1000);
            // return false so the form is not submitted by the Submit button, but by the submitForm() code instead.
            return false;
        } else {
            return true;
        }
	}
    return true;
}


function removeUploadDiv()
{
    if (meAddedUploadDiv != null) {
        meAddedUploadDiv.parentNode.removeChild(meAddedUploadDiv);
        meAddedUploadDiv = null;
    }
}


function submitForm() {
    meSubmitForm.submit();
	// Restore the URL.
	meSubmitForm.action = msSubmitFormOrigAction;
}

/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
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,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"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(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={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.push(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");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_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");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_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{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(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[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(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;




/* 

  ================================================
  PVII Accordian Panel scripts
  Copyright (c) 2007-2008 Project Seven Development
  www.projectseven.com
  Version: 1.0.8 -build version 28
  ================================================
 
*/

var p7AB=false;
var p7ABi=false;
function P7_setAB(){
	if(!document.getElementById){
		return;
	}
	var h,tA=navigator.userAgent.toLowerCase();
	if(window.opera){
		if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){
			return;
		}
	}
	h=String.fromCharCode(60,115,116,121,108,101,32,116,121,112,101,61,34,116,101,120,116,47,99,115,115,34,62,46,112,55,65,66,99,111,110,116,101,110,116,123,100,105,115,112,108,97,121,58,110,111,110,101,59,125,60,47,115,116,121,108,101,62);
	h+='\n'+String.fromCharCode(60,33,45,45,91,105,102,32,108,116,101,32,73,69,32,55,93,62,60,115,116,121,108,101,62,46,112,55,65,66,44,46,112,55,65,66,32,100,105,118,123,122,111,111,109,58,49,48,48,37,59,125,60,47,115,116,121,108,101,62,60,33,91,101,110,100,105,102,93,45,45,62);
	h+='\n'+String.fromCharCode(60,33,45,45,91,105,102,32,108,116,101,32,73,69,32,54,93,62,60,115,116,121,108,101,62,46,112,55,65,66,44,46,112,55,65,66,99,111,110,116,101,110,116,44,46,112,55,65,66,116,114,105,103,32,97,123,104,101,105,103,104,116,58,49,37,59,125,60,47,115,116,121,108,101,62,60,33,91,101,110,100,105,102,93,45,45,62);
	document.write(h);
}
P7_setAB();
function P7_opAB(){
	var x,c,tC,ab,tB;
	if(document.getElementById){
		ab='p7ABW'+arguments[0];
		tB=document.getElementById(ab);
		tB.p7Aba=arguments;
		x=arguments[3];
		if(x>0&&x<11){
			c='p7ABc'+arguments[0]+'_'+x;
			tC=document.getElementById(c);
			if(tC){
				tC.style.display='block';
			}
		}
		if(!p7ABi){
			p7ABi=true;
			if(window.addEventListener){
				window.addEventListener("load",P7_initAB,false);
			}
			else if(document.addEventListener){
				document.addEventListener("load",P7_initAB,false);
			}
			else if(window.attachEvent){
				window.attachEvent("onload",P7_initAB);
			}
			else if(typeof window.onload=='function'){
				var p7loadit=onload;
				window.onload=function(){
					p7loadit();
					P7_initAB();
				};
			}
			else{
				window.onload=P7_initAB;
			}
		}
	}
}
function P7_initAB(){
	var i,j,ab,tB,tD,tA,op,ob,tg;
	if(!document.getElementById){
		return;
	}
	for(i=10;i>0;i--){
		ab='p7ABW'+i;
		tB=document.getElementById(ab);
		if(tB){
			tA=tB.getElementsByTagName("A");
			tg='p7ABt'+i;
			for(j=0;j<tA.length;j++){
				if(tA[j].id && tA[j].id.indexOf(tg)==0){
					tA[j].onclick=function(){
						return P7_ABtrig(this);
					};
					tA[j].p7ABstate=0;
					tA[j].p7ABpr=ab;
				}
			}
			ob=i+'_'+tB.p7Aba[3];
			P7_ABopen(ob);
		}
	}
	p7AB=true;
	P7_ABurl();
	P7_ABauto();
}
function P7_ABopen(s){
	var a,g,d='p7ABt'+s;
	a=document.getElementById(d);
	g=s.split("_");
	if(g&&g.length>1&&g[1]==99){
		a=P7_randAB(g[0]);
	}
	if(g&&g.length>1&&g[1]=='a'){
		P7_ABall(s);
	}
	else{
		if(a&&a.p7ABpr){
			if(a.p7ABstate==0){
				P7_ABtrig(a);
			}
		}
	}
}
function P7_ABclose(s){
	var a,d='p7ABt'+s;
	a=document.getElementById(d);
	if(a&&a.p7ABpr){
		if(a.p7ABstate==1){
			P7_ABtrig(a);
		}
	}
}
function P7_ABclick(s){
	var a,d='p7ABt'+s;
	a=document.getElementById(d);
	if(a&&a.p7ABpr){
		P7_ABtrig(a);
	}
}
function P7_randAB(r){
	var i,k,j=0,d,dd,tA,a,rD=new Array();
	dd='p7ABW'+r;
	d=document.getElementById(dd);
	if(d){
		tA=d.getElementsByTagName("A");
		for(i=0;i<tA.length;i++){
			if(tA[i].p7ABpr && tA[i].p7ABpr==dd){
				rD[j]=tA[i].id;
				j++;
			}
		}
		if(j>0){
			k=Math.floor(Math.random()*j);
			a=document.getElementById(rD[k]);
		}
	}
	return a;
}
function P7_ABall(s){
	var i,m,d,dd,st,et,tA,g=s.split("_");
	if(g&&g.length==2){
		st=parseInt(g[0]);
		if(st){
			et=st+1;
		}
		else{
			st=1;
			et=11;
		}
		m=p7AB;
		p7AB=false;
		for(i=st;i<et;i++){
			dd='p7ABW'+i;
			d=document.getElementById(dd);
			if(d){
				tA=d.getElementsByTagName("A");
				for(j=0;j<tA.length;j++){
					if(tA[j].p7ABpr && tA[j].p7ABpr==dd){
						if(g[1]=='a' && tA[j].p7ABstate==0){
							P7_ABtrig(tA[j]);
						}
						else if(g[1]=='c' && tA[j].p7ABstate==1){
							P7_ABtrig(tA[j]);
						}
					}
				}
			}
		}
		p7AB=m;
	}
}
function P7_ABurl(){
	var i,h,s,x,d='pab';
	if(document.getElementById){
		h=document.location.search;
		if(h){
			h=h.replace('?','');
			s=h.split(/[=&]/g);
			if(s&&s.length){
				for(i=0;i<s.length;i+=2){
					if(s[i]==d){
						x=s[i+1];
						if(x){
							P7_ABopen(x);
						}
					}
				}
			}
		}
		h=document.location.hash;
		if(h){
			x=h.substring(1,h.length);
			if(x && x.indexOf("pab")==0){
				P7_ABopen(x.substring(3));
			}
		}
	}
}
function P7_ABtrig(a){
	var i,j=null,op,pD,ad,aT,m=true,cp='p7ABc'+a.p7ABpr.substring(a.p7ABpr.length-1);
	var iD=a.id.replace('t','c'),tD=document.getElementById(iD);
	if(tD){
		m=false;
		pD=document.getElementById(a.p7ABpr);
		op=pD.p7Aba;
		if(op[4]==1&&op[1]==1&&a.p7ABstate==1){
			return m;
		}
		tD=pD.getElementsByTagName("DIV");
		for(i=0;i<tD.length;i++){
			if( tD[i].id && tD[i].id.indexOf(cp)>-1 ){
				if(tD[i].id==iD){
					j=i;
					if( a.className=="p7ABtrig_down"){
						a.p7ABstate=0;
						a.className='';
						P7_ABhide(tD[j],op);
					}
					else{
						a.p7ABstate=1;
						a.className="p7ABtrig_down";
						P7_ABshow(tD[j],op);
					}
				}
				else{
					if(op[1]==1){
						ad=tD[i].id.replace('c','t');
						aT=document.getElementById(ad);
						aT.className='';
						aT.p7ABstate=0;
						P7_ABhide(tD[i],op);
					}
				}
			}
		}
	}
	P7_checkEQH();
	return m;
}
function P7_checkEQH(){
	if(typeof(P7_colH2)=='function'){
		P7_colH2();
	}
	if(typeof(P7_colH)=='function'){
		P7_colH();
	}
}
function P7_ABshow(d,op){
	var h,wd,wP,isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
	if(p7AB&&op[2]==3){
		d.style.display='block';
		P7_ABfadeIn(d.id,0);
	}
	else if( (p7AB&&op[2]==1||p7AB&&op[2]==2) && !isIE5 ){
		wd=d.id.replace("c","w");
		wP=document.getElementById(wd);
		if(P7_hasOverflow(d)||P7_hasOverflow(wP)){
			d.style.display='block';
			return;
		}
		wP.style.overflow="hidden";
		wP.style.height="1px";
		d.style.display='block';
		h=d.offsetHeight;
		P7_ABglide(wd,1,h,op[2]);
	}
	else{
		d.style.display='block';
	}
}
function P7_ABhide(d,op){
	var h,wd,wP,isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
	if((p7AB&&op[2]==1||p7AB&&op[2]==2)&&!isIE5){
		wd=d.id.replace("c","w");
		wP=document.getElementById(wd);
		if(d.style.display!="none"){
			if(P7_hasOverflow(d)||P7_hasOverflow(wP)){
				d.style.display='none';
				return;
			}
			h=wP.offsetHeight;
			wP.style.overflow="hidden";
			P7_ABglide(wd,h,0,op[2]);
		}
	}
	else{
		d.style.display='none';
	}
}
function P7_hasOverflow(ob){
	var s,m;
	if(navigator.userAgent.toLowerCase().indexOf('gecko')>-1){
		s=ob.style.overflow;
		if(!s){
			if(ob.currentStyle){
				s=ob.currentStyle.overflow;
			}
			else if(document.defaultView.getComputedStyle(ob,"")){
				s=document.defaultView.getComputedStyle(ob,"").getPropertyValue("overflow");
			}
		}
	}
	m=(s&&s=='auto')?true:false;
	return m;
}
function P7_ABfadeIn(id,op){
	var d=document.getElementById(id);
	op+=.05;
	op=(op>=1)?1:op;
	if((navigator.appVersion.indexOf("MSIE")>-1)){
		d.style.filter='alpha(opacity='+op*100+')';
	}
	else{
		d.style.opacity=op;
	}
	if(op<1){
		setTimeout("P7_ABfadeIn('"+id+"',"+op+")",40);
	}
}
function P7_ABglide(dd,ch,th,p){
	var w,m,d,wd,wC,tt,dy=10,inc=10,pc=.15;
	d=document.getElementById(dd);
	m=(ch<=th)?0:1;
	if(p==1){
		tt=Math.abs( parseInt( Math.abs(th)-Math.abs(ch) ) );
		inc=(tt*pc<1)?1:tt*pc;
	}
	inc=(m==1)?inc*-1:inc;
	d.style.height=ch+"px";
	if(ch==th){
		if(th==0){
			wd=d.id.replace("w","c");
			wC=document.getElementById(wd);
			wC.style.display="none";
			d.style.height="auto";
		}
		else{
			d.style.height="auto";
		}
		P7_checkEQH();
	}
	else{
		ch+=inc;
		if(m==0){
			ch=(ch>=th)?th:ch;
		}
		else{
			ch=(ch<=th)?th:ch;
		}
		if(d.p7abG){
			clearTimeout(d.p7abG);
		}
		d.p7abG=setTimeout("P7_ABglide('"+dd+"',"+ch+","+th+","+p+")",dy);
	}
}
function P7_ABauto(){
	var i,k,ab,tB,wH,tr,pp;
	wH=window.location.href;
	for(k=1;k<11;k++){
		tr=null;
		ab='p7ABW'+k;
		tB=document.getElementById(ab);
		if(tB&&tB.p7Aba[5]&&tB.p7Aba[5]==1){
			tA=tB.getElementsByTagName('A');
			if(tA){
				for(i=0;i<tA.length;i++){
					if(tA[i].href==wH){
						if(tA[i].p7ABpr){
							tr=tA[i].id.replace('p7ABt','');
							break;
						}
						else{
							tA[i].className="p7ap_currentmark";
							pp=tA[i].parentNode;
							while(pp){
								if(pp.id&&pp.id.indexOf('p7ABc')==0){
									tr=pp.id.replace('p7ABc','');
									break;
								}
								pp=pp.parentNode;
							}
							break;
						}
					}
				}
				if(tr){
					P7_ABopen(tr);
				}
				else{
					if(typeof(p7ABcm)!='undefined'&&p7ABcm.length){
						for(i=0;i<p7ABcm.length;i++){
							if(p7ABcm[i]&&p7ABcm[i].length>0){
								if(k==p7ABcm[i].charAt(0)){
									P7_ABopen(p7ABcm[i]);
								}
							}
						}
					}
				}
			}
		}
	}
}
