﻿var DEFAULT_FONT_SIZE = "70%";
var FONT_SIZE_COOKIE_NAME = "fontSize";
var FONT_SIZES_STRING = "55%,70%,85%";
var FONT_SIZES = {};

var urlAddress = "http://www.australianunity.com.au"; 
var pageName = "Australian Unity"; 

function addToFavorites() { 
	if (window.external) { 
		window.external.AddFavorite(urlAddress,pageName); 
	} 
	else { 
		alert("Your browser doesn't support this function."); 
	} 
}

//Initialises, i.e. restores the current font size
function initialiseFontSize()
{
    FONT_SIZES.sizes = FONT_SIZES_STRING.split(",").sort();
    FONT_SIZES.indices = {};

    for(var i=0; i<FONT_SIZES.sizes.length; i++)
    {
        FONT_SIZES.indices[FONT_SIZES.sizes[i]] = i;
    }    

    var fontSizePref = getFontSize();

    if(fontSizePref!=DEFAULT_FONT_SIZE)
    {
        setFontSize(fontSizePref);
    }
}

//Returns the current font size
function getFontSize()
{
    var fontSizePref = readCookie(FONT_SIZE_COOKIE_NAME);

    if(fontSizePref)
    {
        return fontSizePref;
    }

    return DEFAULT_FONT_SIZE;
}

//Increases the current font size
function increaseFontSize()
{
    var fontSize = getFontSize();
    var newIndex = FONT_SIZES.indices[fontSize] + 1;

    if(newIndex > -1 && newIndex<FONT_SIZES.sizes.length)
    {
        setFontSize(FONT_SIZES.sizes[newIndex]);
    }
}

//Decreases the current font size
function decreaseFontSize()
{
    var fontSize = getFontSize();
    var newIndex = FONT_SIZES.indices[fontSize] - 1;

    if(newIndex > -1 && newIndex<FONT_SIZES.sizes.length)
    {
        setFontSize(FONT_SIZES.sizes[newIndex]);
    }
}


//Sets the current font size, as defined with FONT_SIZE_TO_CSS
function setFontSize(fontSize)
{
    var index = FONT_SIZES.indices[fontSize];
    if(index>=0 && index<FONT_SIZES.sizes.length)

    {
		resizeFontSize(fontSize);
		
        if(fontSize != DEFAULT_FONT_SIZE)
        {
            createCookie(FONT_SIZE_COOKIE_NAME, fontSize, 1);
            return;

        }	
    }
    eraseCookie(FONT_SIZE_COOKIE_NAME);
}

function resizeFontSize(inc){
	var body = document.getElementsByTagName('body');
	resize(body,inc);
}

function resize(p,inc){
	for(n=0; n<p.length; n++) {    
		p[n].style.fontSize = inc;   
  	}
}

initialiseFontSize();


function printContent() {
    if (window.print) {
           window.print();
    } else {
        alert("Your browser doesn't support this function.")
    }
}
 
function printPage()
{
    window.print();
}

//Creates a cookie with the given name, valid for the specified number of days
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 var expires = "";
      
      document.cookie = name+"="+value+expires+"; path=/";
}

//Reads the value of the cookie with the given name
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;
}


//Removes the cookie with the given name
function eraseCookie(name) {
    createCookie(name,"",-1);
}

//Attaches the given event handler eventHandler to the given object for the event given with its name (click, mouseover, etc)
function attachEventHandler(object, eventName, eventHandler)

{

    if(window.addEventListener){ // Mozilla and co.
        object.addEventListener(eventName, eventHandler, false);
    } else if(object.attachEvent){ //IE
        object.attachEvent('on' + eventName, eventHandler);
    }
}

function changeFontSize()
{
	//if current font size is medium then increase
	var fontSize = getFontSize();
	
	FONT_SIZES.sizes = FONT_SIZES_STRING.split(",").sort();

    FONT_SIZES.indices = {};

    for(var i=0; i<FONT_SIZES.sizes.length; i++)

    {

        FONT_SIZES.indices[FONT_SIZES.sizes[i]] = i;

    }
    
    var index = FONT_SIZES.indices[fontSize] + 1;
    
    var newIndex = 0;
    
    if(index == (FONT_SIZES.sizes.length))
    {
    	newIndex = 0;
    }
    else 
    {
		newIndex = index;
	}
	setFontSize(FONT_SIZES.sizes[newIndex]);
}

function focusItem(item)
{
	document.getElementById(item).focus();
}

/* Identify browser */
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

function changeCSSifIE()
{

}

function hidePreviousButton()
{
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	if(sPage == 'ChangePassword'){
	var previousButton = document.getElementById('PreviousPageUI');
	previousButton.style.visibility = "hidden";
	}
}

function openPopup(theUrl) {
    var resize = '';                                                                                    
    var titlebar = '';
    var wvalue = screen.width - 7;
    var hvalue = screen.height - 75;	
	
    	if (navigator.appName == 'Netscape') {      
			if (screen.height >= 600) {                                  
				wvalue = 1022;
				hvalue = 766;
				resize = ',resizable';
			} else {                                                                          
				hvalue = hvalue - 2;
				}                       
				titlebar = ',titlebar=0';
			} else {                                                                                      
				resize = ',resizable';
            }
	window.open(theUrl,'Investments', 'top=0,left=0,scrollbars=yes,status=yes,menubar=no,toolbar=no,location=no,width=' + wvalue + ',height=' + hvalue + resize + titlebar + ',hotkeys=0');
	return false;
}

function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  return null;
}

// written by Dean Edwards, 2005
// with input from Tino Zijdel, Matthias Miller, Diego Perini
// http://dean.edwards.name/weblog/2005/10/add-event/
function addEvent(element, type, handler) {
	// Modification by Tanny O'Haley, http://tanny.ica.com to add the
	// DOMContentLoaded for all browsers.
	if (type == "DOMContentLoaded" || type == "domload") {
		addDOMLoadEvent(handler);
		return;
	}
	
	if (element.addEventListener) {
		element.addEventListener(type, handler, false);
	} else {
		// assign each event handler a unique ID
		if (!handler.$$guid) handler.$$guid = addEvent.guid++;
		// create a hash table of event types for the element
		if (!element.events) element.events = {};
		// create a hash table of event handlers for each element/event pair
		var handlers = element.events[type];
		if (!handlers) {
			handlers = element.events[type] = {};
			// store the existing event handler (if there is one)
			if (element["on" + type]) {
				handlers[0] = element["on" + type];
			}
		}
		// store the event handler in the hash table
		handlers[handler.$$guid] = handler;
		// assign a global event handler to do all the work
		element["on" + type] = handleEvent;
	}
};
// a counter used to create unique IDs
addEvent.guid = 1;

function removeEvent(element, type, handler) {
	if (element.removeEventListener) {
		element.removeEventListener(type, handler, false);
	} else {
		// delete the event handler from the hash table
		if (element.events && element.events[type]) {
			delete element.events[type][handler.$$guid];
		}
	}
};

function handleEvent(event) {
	var returnValue = true;
	// grab the event object (IE uses a global event object)
	event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
	// get a reference to the hash table of event handlers
	var handlers = this.events[event.type];
	// execute each event handler
	for (var i in handlers) {
		this.$$handleEvent = handlers[i];
		if (this.$$handleEvent(event) === false) {
			returnValue = false;
		}
	}
	return returnValue;
};

function fixEvent(event) {
	// add W3C standard event methods
	event.preventDefault = fixEvent.preventDefault;
	event.stopPropagation = fixEvent.stopPropagation;
	return event;
};
fixEvent.preventDefault = function() {
	this.returnValue = false;
};
fixEvent.stopPropagation = function() {
	this.cancelBubble = true;
};

// End Dean Edwards addEvent.

// Tino Zijdel - crisp@xs4all.nl This little snippet fixes the problem that the onload attribute on 
// the body-element will overwrite previous attached events on the window object for the onload event.
if (!window.addEventListener) {
	document.onreadystatechange = function(){
		if (window.onload && window.onload != handleEvent) {
			//addEvent(window, 'load', window.onload);
			window.onload = handleEvent;
		}
	}
}

// Here are my functions for adding the DOMContentLoaded event to browsers other
// than Mozilla.

// Array of DOMContentLoaded event handlers.
window.onDOMLoadEvents = new Array();
window.DOMContentLoadedInitDone = false;

// Function that adds DOMContentLoaded listeners to the array.
function addDOMLoadEvent(listener) {
	window.onDOMLoadEvents[window.onDOMLoadEvents.length]=listener;
}

// Function to process the DOMContentLoaded events array.
function DOMContentLoadedInit() {
	// quit if this function has already been called
	if (window.DOMContentLoadedInitDone) return;

	// flag this function so we don't do the same thing twice
	window.DOMContentLoadedInitDone = true;

	// iterates through array of registered functions 
	for (var i=0; i<window.onDOMLoadEvents.length; i++) {
		var func = window.onDOMLoadEvents[i];
		func();
	}
}

function DOMContentLoadedScheduler() {
	// quit if the init function has already been called
	if (window.DOMContentLoadedInitDone) return true;
	
	// First, check for Safari or KHTML.
	// Second, check for IE.
	//if DOM methods are supported, and the body element exists
	//(using a double-check including document.body, for the benefit of older moz builds [eg ns7.1] 
	//in which getElementsByTagName('body')[0] is undefined, unless this script is in the body section)
	if(/KHTML|WebKit/i.test(navigator.userAgent)) {
		if(/loaded|complete/.test(document.readyState)) {
			DOMContentLoadedInit();
		} else {
			// Not ready yet, wait a little more.
			setTimeout("DOMContentLoadedScheduler()", 250);
		}
	} else if(document.getElementById("__ie_onload")) {
		return true;
	} else if(typeof document.getElementsByTagName != 'undefined' && (document.getElementsByTagName('body')[0] != null || document.body != null)) {
		DOMContentLoadedInit();
	} else {
		// Not ready yet, wait a little more.
		setTimeout("DOMContentLoadedScheduler()", 250);
	}
	
	return true;
}

// Schedule to run the init function.
setTimeout("DOMContentLoadedScheduler()", 250);

// Just in case window.onload happens first, add it there too.
addEvent(window, "load", DOMContentLoadedInit);

// If addEventListener supports the DOMContentLoaded event.
if(document.addEventListener)
	document.addEventListener("DOMContentLoaded", DOMContentLoadedInit, false);

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
	document.write("<script id=__ie_onload defer src=\"//:\"><\/script>");
	var script = document.getElementById("__ie_onload");
	script.onreadystatechange = function() {
		if (this.readyState == "complete") {
			DOMContentLoadedInit(); // call the onload handler
		}
	};
/*@end @*/

if (typeof window.event != 'undefined')
    document.onkeydown = function()
    {
	    if (event.srcElement.tagName.toUpperCase() != 'INPUT')
	    {
		    if ( (event.altKey) || ((event.keyCode == 8) &&
			    (event.srcElement.type != "text" &&
			    event.srcElement.type != "textarea" &&
			    event.srcElement.type != "password")) ||
			    ((event.ctrlKey) && ((event.keyCode == 82)) ) ||
			    (event.keyCode == 122) ) 
		    {
				    event.keyCode = 0;
				    event.returnValue = false;
		    }
		    if(event.keyCode == 122)
		    {
			    return false;
		    }
	    }
    }
else
    document.onkeypress = function(e)
    {
	    if (e.target.nodeName.toUpperCase() != 'INPUT')
	    {
		    if(e.keyCode == 122){
			    return false;
		    }
		    if ( (e.altKey) || ((e.keyCode == 8) &&
			    (e.srcElement.type != "text" &&
			    e.srcElement.type != "textarea" &&
			    e.srcElement.type != "password")) ||
			    ((e.ctrlKey) && ((e.keyCode == 82)) ) ||
			    (e.keyCode == 122) ) {
				    e.keyCode = 0;
				    e.returnValue = false;
		    }
	    }
    }

var breadcrumbsId = 'breadcrumbs';
var footerId = 'footer';
var sectionHeadClass = 'section_head';
var topNavID = 'top_level_nav';
var stripedTableId = 'striped';
var groupLinksId = 'au_group_links';


// register page to receive custom DOMContentLoaded event
// fired when HTML has finished loading but before images are loaded
addEvent(window, 'DOMContentLoaded', initPage);

//MM Removed below onload init, no longer required.

/*window.onload = function () {
	initPage();	
}*/


// Code executed on page load to initialise various display and interaction elements
function initPage() {	
	if (document.getElementById(breadcrumbsId)) removeFirstItemBg(breadcrumbsId,false);
	if (document.getElementById(footerId)) removeFirstItemBg(footerId);
	if (document.getElementById(topNavID)) initNav(document.getElementById(topNavID));
	cleanupStripedTables();
	//if (getElementsByClassName(groupLinksId)) cleanupGroupLinks();
	
	//addSectionheadCaps();	
}

/**
 * Remove the background seperator image and left padding
 * from the first or last item in an unordered or ordered list
 * specifically for use with breadcrumbs and footer items
 * but could be used for any other list that needs it
 */
function removeFirstItemBg (elementName) {
	var items = document.getElementById(elementName).getElementsByTagName('li');
	if(items.length > 0)
	{
	    var targetItem = items[0];	
	    addClass(targetItem,"first");
	}
}

/**
 * Remove the white border-left from the th elements inside thead inside striped tables
 * to ensure that the backgroudn color aligns perfectly with the left edge of the divider above it
 */
function cleanupStripedTables() {
	var tables = getElementsByClassName(stripedTableId,document,'table');
	for (var i=0; i<tables.length; i++) {
		var thisTable = tables[i];
		if (thisTable.getElementsByTagName('thead')) {
			
			if (thisTable.getElementsByTagName('thead')[0]) {
				var tableHead = thisTable.getElementsByTagName('thead')[0];
				var rows =  tableHead.getElementsByTagName('tr');
				for (var j=0; j<rows.length; j++) {
					var firstCell = rows[j].getElementsByTagName('th')[0];
					firstCell.style.borderLeft = "none";
				}
			}
			
			
		}
	}
}

function cleanupGroupLinks() {
	
	var linksElement = document.getElementById(groupLinksId)
	var linksList = linksElement.getElementsByTagName("li");
	var linkCount = linksList.length;
	var current = getElementsByClassName('current',document.linksElement)[0];
 	var lastLinkWasCurrent = false;
	
	for (var i=0; i<linkCount; i++) {
		
		var thisLink = linksList[i];
		
		if (i==0 && thisLink != current) {
			addClass(thisLink,"first");
		} else if (lastLinkWasCurrent) {
			addClass(thisLink,"follows_current");
		}

		lastLinkWasCurrent = (thisLink == current); 
			
	}
	
}
/**
 * Find all items on the page with class == sectionHeadClass 
 * and put a top and bottom cap on them
 * This keeps the non-semantic markup required for caps out of the main code
 * to help keep the html clean
 */
function addSectionheadCaps() {
	var items = getElementsByClassName(sectionHeadClass);
	var itemCount = items.length;
	
	if (!items || itemCount == 0) return;
	
	for (var i=0; i<itemCount; i++) {
		var thisItem = items[i];
		var itemText = thisItem.innerHTML;
		var html = "<span class='section_head_cap_top'></span>";
		html +=  "<span class='section_head_middle'>"+itemText+"</span>"
		html += "<span class='section_head_cap_bottom'></span>";
		thisItem.innerHTML = html;
    }
}

function addClass(element, value) {
	if (!element.className) {
		element.className = value;
	} else {
		var newClassName = element.className;
		newClassName += " ";
		newClassName += value;
		element.className = newClassName;
	}
}

function getElementsByClassName(cl,rootNode,tag) {
	
	var retnode = [];
	var myclass = new RegExp('\\b'+cl+'\\b');
	var rootNode = rootNode ? rootNode : document;
	var tag = tag ? tag : '*'
	var elem = rootNode.getElementsByTagName(tag);
		
	for (var i = 0; i < elem.length; i++) {
		var classes = elem[i].className;
		if (myclass.test(classes))  {
			retnode.push(elem[i]);
		}
	}

	return retnode;
}

function initNav (element) {
	
	var items = element.getElementsByTagName('li');
	var itemCount = items.length;
	
	if (!items || itemCount == 0) return;
	
	var firstItem = items[0];
	var lastItem = items[items.length-1];
	addClass(firstItem, 'first');
	addClass(lastItem, 'last');
}

function ValidateMultiMandText(sender, args, items)
{
    var valid = false;

    for (var i = 0; i < items.length && !valid; i++)
    {
        if (items[i].value.trim() != '')
        {
            valid = true;
        }
    }

    args.IsValid = valid;
}

function ValidateMultiMandCheck(sender, args, items) {
    var valid = false;

    for (var i = 0; i < items.length && !valid; i++) {
        if (items[i].checked) 
        {
            valid = true;
        }
    }

    args.IsValid = valid;
}

function IAMChanged(type)
{
    var adviserNoRow = document.getElementById('adviserNoRow');
    var dealershipNameRow = document.getElementById('dealershipNameRow');
    var investorIDRow = document.getElementById('investorIDRow');
    var accountNoRow = document.getElementById('accountNoRow');
    
    switch (type)
    {
        case 'investor':
            adviserNoRow.style.display = dealershipNameRow.style.display = 'none';
            investorIDRow.style.display = accountNoRow.style.display = '';
            break;
        case 'adviser':
            adviserNoRow.style.display = dealershipNameRow.style.display = '';
            investorIDRow.style.display = accountNoRow.style.display = 'none';
            break;
        default:
            adviserNoRow.style.display = dealershipNameRow.style.display = investorIDRow.style.display = accountNoRow.style.display = 'none';
    }
}

function ValidateTextIfShown(sender, args, blnValidate, blnShownID, strTextID)
{
    var radioButton = document.getElementById(blnShownID);
    var blnIsValid = true;
    
    if (blnValidate)
    {
        blnIsValid = document.getElementById(strTextID).value.trim() != '';
    }
    else if (radioButton)
    {
        blnIsValid = !radioButton.checked || document.getElementById(strTextID).value.trim() != '';
    }
    
    args.IsValid = blnIsValid;
}

function SetupIAMOnLoad(iamInvestorID, iamAdviserID)
{
    if (document.getElementById(iamInvestorID).checked)
    {
        IAMChanged('investor');
    }
    else if (document.getElementById(iamAdviserID).checked)
    {
        IAMChanged('adviser');
    }
    else
    {
        IAMChanged('');
    }
}

//This is used in Find A Fund to modify the selected top nav item and sub nav 
//on the client side
function setCurrentNavigation(selectedValue, selectedSubNav)
    {
        var nav = document.getElementById('TopNavigation');
        
        //removing the 'current' navigation css
        for(var i = 1; i < nav.childNodes.length; i++)
        {
            nav.childNodes[i].className = '';
            var inside = nav.childNodes[i].innerHTML;
        }
        
        //setting the 'current' navigation css
        var currentIndex = parseInt(selectedValue) + 2;
        
        var innerIndex = 0;
        for(var i = 0; i < nav.childNodes.length; i++)
        {
            if(nav.childNodes[i].nodeName == "LI")
            {
                if(innerIndex == currentIndex)
                {
                    nav.childNodes[i].className = 'current';    
                }
                innerIndex += 1;   
            }
        }
        
        //hiding the 'subnavigation'
        var subNavDiv = document.getElementById('sub_level_nav');
        
        var subNavInnerDiv;
        
        for(var i = 0; i < subNavDiv.childNodes.length; i++)
        {
            if(subNavDiv.childNodes[i].nodeName == "DIV")
            {
                subNavInnerDiv = subNavDiv.childNodes[i];
            }
        }
        
        var subNav; 
        for(var i = 0; i < subNavInnerDiv.childNodes.length; i++)
        {
            if(subNavInnerDiv.childNodes[i].nodeName == "UL")
            {
                subNav = subNavInnerDiv.childNodes[i];
            }
        }           

        var displaySubNav = -1;
        if(selectedValue == 1)
        {
            displaySubNav = 0;
        }
        else if(selectedValue == 2)
        {
            displaySubNav = 2;
        }
        else if(selectedValue == 3)
        {
            displaySubNav = 1;
        }
        
        var subNavIndex = 0;
        for(var i = 0; i< subNav.childNodes.length; i++)
        {
            if(subNav.childNodes[i].nodeName == "LI")
            {
                if(subNavIndex == displaySubNav)
                {
                    //activating the subnav
                    if(subNavIndex  == selectedSubNav)
                    {
	                    subNav.childNodes[i].className = 'current';
                    }
                    else
                    {
	                    subNav.childNodes[i].className = '';
                    }
                }
                else
                {
	                subNav.childNodes[i].className = 'dontDisplay';
                }
                subNavIndex += 1;
            }
        }
    }


String.prototype.trim = function() {
    return this.replace(/^\s*|\s*$/g, '');
}

/**
 * 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;