/*
Author:		Peakey Enterprise LLC
Designer:		Randall Hankins
Copyright:		Peakey Enterprise LLC 2010	All Rights Reserved
Created:		2004-10-23
Last Modified:	2010-02-26

Copyright 2010 Peakey Enterprise LLC
All Rights Reserved
*/
var ioncreative = ioncreative || {};
var objMenu, objMenuPop;

ioncreative.isReady = false;
ioncreative.isShutDown = false;
ioncreative.rootURL = '';


ioncreative.init = function()
{
    if (ioncreative.rootURL.length == 0)
    {
        
        ioncreative.rootURL = 'http://www.ioncreative.co.uk/';
        ioncreative.xml.init(ioncreative.rootURL);     // DO FIRST FOR AUTO-BUG POSTING
    }
    if (typeof(ioncreative.PageLoaded) == 'undefined')
    {
        ioncreative.PageLoaded = false;
    }
    if (ioncreative.PageLoaded == true)
    {
        ioncreative._init();
    }
    else
    {
        setTimeout('ioncreative.init();', 100);
    }
}


ioncreative._init = function()
{

    /*  INITIALIZE FUNCTION */
    ioncreative.accessibility.init();
    ioncreative.visitor.init();
    ioncreative.catalog.init();
    ioncreative.document.addBeforeUnload(ioncreative.shutDown);


    /*  INITIALIZE SITE CONFIGURATIONS */

	objMenu = ioncreative.menus.create();
	objMenu.opacityRate = 18;
	objMenu.cssClassPanel = 'ioncreative-Category-Navigation-Popup-Panel'; //PopupMenuNoMouse
	objMenu.cssClassTable = 'ioncreative-Category-Navigation-Popup-Table'; //PopupMenuNoMouse
	objMenu.cssClassNoMouse = 'ioncreative-Category-Navigation-Popup-NoMouse';
	objMenu.cssClassMouseOver = 'ioncreative-Category-Navigation-Popup-Mouse';
	objMenu.cssClassMore = 'ioncreative-Category-Navigation-Popup-More';
	objMenu.menuItemIdPrep = '_ioncreative_Category';
	objMenuPop = ioncreative.menus.create();
objMenuPop.opacityRate = 18;
objMenuPop.cssClassPanel = 'ioncreative-Menu-Popup-Panel';
objMenuPop.cssClassTable = 'ioncreative-Menu-Popup-Table';
objMenuPop.cssClassNoMouse = 'ioncreative-Menu-Popup-NoMouse';
objMenuPop.cssClassMouseOver = 'ioncreative-Menu-Popup-Mouse';
objMenuPop.cssClassMore = 'ioncreative-Menu-Popup-More';
objMenuPop.menuItemIdPrep = 'ioncreative-MenuItem-';
objMenuPop.addItem('00000000-0000-0000-0000-000000000000', '62b3b2e0-3d29-405b-9045-565186242d50', '', '<a href="" title=""><div style="width:40px;"></div></a>');
objMenuPop.registerItem('ioncreative-MenuItem-62b3b2e0-3d29-405b-9045-565186242d50');
objMenuPop.addItem('00000000-0000-0000-0000-000000000000', '951d6e3d-aaaf-4b57-9fae-3ffdd59d8046', '', '<a href="http://www.ioncreative.co.uk/home/" title="home">Home</a>');
objMenuPop.registerItem('ioncreative-MenuItem-951d6e3d-aaaf-4b57-9fae-3ffdd59d8046');
objMenuPop.addItem('00000000-0000-0000-0000-000000000000', '11e3077d-7eeb-45ac-a89a-39b7536af89d', '', '<a href="" title="">More Info</a>');
objMenuPop.registerItem('ioncreative-MenuItem-11e3077d-7eeb-45ac-a89a-39b7536af89d');
objMenuPop.addItem('00000000-0000-0000-0000-000000000000', '0ccba13a-bc1c-4e89-8526-d8469b4492a8', '', '<a href="" title="">Services</a>');
objMenuPop.registerItem('ioncreative-MenuItem-0ccba13a-bc1c-4e89-8526-d8469b4492a8');
objMenuPop.addItem('00000000-0000-0000-0000-000000000000', 'a6798e48-5fbd-4111-b04d-632758bfef02', '', '<a href="Newsletter.aspx" title="Newsletter.aspx">News</a>');
objMenuPop.registerItem('ioncreative-MenuItem-a6798e48-5fbd-4111-b04d-632758bfef02');
objMenuPop.addItem('00000000-0000-0000-0000-000000000000', '5be62ca3-1a49-4a0d-94ea-235194570ca4', '', '<a href="" title="">Contact Us</a>');
objMenuPop.registerItem('ioncreative-MenuItem-5be62ca3-1a49-4a0d-94ea-235194570ca4');

// JS Menu Generated


	ioncreative.document.rightClickEnabled = true;
	ioncreative.document.rightClickImageEnabled = true;

	

    
    ioncreative.isReady = true;
    ioncreative.marketing.seo.google.urchin.init('UA-10059159-1');
    ioncreative.xml.checkQueue();

}


ioncreative.shutDown = function()
{
    ioncreative.isReady = false;
    ioncreative.isShutDown = true;
    onerror = null;     // DON'T REPORT ERRORS AS PAGE IS CHANGING
    ioncreative.scrollers.stop();
    ioncreative.slideShows.pause();
    ioncreative.customerService.chat.stopPolling();
}

var ioncreative = ioncreative || {};


if (typeof ioncreative.exception == 'undefined')
{
    ioncreative.exception = {};
    ioncreative.exception.debug = false;


    ioncreative.exception.report = function(strMessage, strURL, intLine)
    {
        if (typeof(strMessage) == 'undefined')
        {
            strMessage = 'Javascript Message Not Provided';
        }
        if (typeof(strURL) == 'undefined')
        {
            strURL = 'Javascript URL Not Provided';
        }
        if (typeof(intLine) == 'undefined')
        {
            intLine = 'Javascript Line Not Provided';
        }
	    var objInfo = ioncreative.visitor.info;
	    if (ioncreative.exception.debug == true)
	    {
        	    alert(
			    'Error: [' + strMessage + ']\r\n' + 
			    'URL: [' + strURL + ']\r\n' + 
			    'Line: [' + intLine + ']\r\n' +
                 'Browser: ' + objInfo.browser.name + ' (' + objInfo.browser.version.major + '.' + objInfo.browser.version.minor + ')' + '\r\n' +
                 'Platform: ' + objInfo.OS.name + ' (' + objInfo.OS.version + ')');
	            return true;
	    }
	    else
	    {
	        if (!ioncreative.exception.shouldReport(strMessage, strURL, intLine))
	        {   // SHOULD NOT BE REPORTED
	            return true;
	        }
		    var strXMLRequest = 
		        '<?xml version="1.0" ?>' +
		        '<System>' +
			        '<Request type="ERROR">' +
				        '<Error>' +
					        '<Message>' + escape(strMessage) + '</Message>' +
					        '<URL>' + escape(strURL.replace('&', '&amp;')) + '</URL>' +
					        '<Line>' + escape(intLine) + '</Line>' +
					        '<Browser>' + escape(objInfo.browser.name + ' (' + objInfo.browser.version.major + '.' + objInfo.browser.version.minor + ')') + '</Browser>' +
					        '<Platform>' + escape(objInfo.OS.name + ' (' + objInfo.OS.version + ')') + '</Platform>' +
				        '</Error>' +
			        '</Request>' +
		        '</System>';
	        ioncreative.xml.queueRequest('system/', 'VERSION=1&DATA=' + strXMLRequest, ioncreative.exception.reportCompleted);
	        return true;
	    }
    }


    ioncreative.exception.shouldReport = function(strMessage, strURL, intLine)
    {
        if (strMessage == 'Unspecified error.')
        {   // WE ARE UNABLE TO TRACK DOWN / FIX UNKNOWN ERROR
            return false;
        }
        else if ((strMessage == 'Syntax error') && (parseInt(intLine) == 2))
        {   // UNKNOWN AS TO WHY THIS GETS REPORTED POSSIBLY EXTERNAL SUCH AS BROWSER PLUGINS
            return false;
        }
        else if (strMessage == '\'JSON\' is undefined')
        {   // WE DON'T USE JSON, SO MUST BE A BROWSER PLUGIN ETC
            return false;
        }
        else if (strMessage == 'Can\'t execute code from a freed script')
        {   // WE WERE GETTING THESE FROM ALL SORTS OF 3RD PARTY SCRIPTS
            return false;
        }
        else if (strMessage == '\'console\' is undefined')
        {   // GOOGLE ANALYTICS ISSUE
            return false;
        }
        else if (strMessage == 'DOM Exception: HIERARCHY_REQUEST_ERR (3)')
        {   // SEEMS TO BE A JQUERY EXCEPTION
            return false;
        }
        else if (strMessage.indexof('JSON') != -1)
        {   // JSON ERROR, WE DON'T USE JSON
            return false;   
        }
        else if (strMessage == 'No such interface supported')
        {   // AN IE ISSUE (DLL REGISTRATION ISSUE)
            return false;
        }
        else if (strURL.toLowerCase().indexOf('jquery') == -1)
        {   // A JQUERY ERROR, WE DON'T USE JQUERY, I DON'T WANT THE BUG REPORT
            return false;
        }
        var strTestURL = strURL;
        var intTestLength = ioncreative.rootURL.length;
        var intURLLength = strTestURL.length;
        if (intTestLength < intURLLength)
        {
            strTestURL = strTestURL.substring(0, intTestLength);
        }
        if ((strURL.toLowerCase() == ioncreative.rootURL) && (intLine == 1))
        {   //THIS IS DYNAMICALLY LOADED SCRIPT BLOCK, USUALLY GOOGLE ANALYTICS OR OTHER BAD FLASH SCRIPTS
            return false;
        }
        if (ioncreative.rootURL.toLowerCase() != strTestURL.toLowerCase())
        {   //OFF SITE JAVACRIPT ERROR (GOOGLE ANALYTICS, TWITTER ETC)
            return false;
        }
	    return true;
    }


    ioncreative.exception.reportCompleted = function(objResponse, e)
    {
	    //alert('Reported: ' + objResponse.responseText);
	    window.status = 'Javascript Bug Reported.';
    }


    ioncreative.exception.simulate = function()
    {
        throw "This is a test Javascript Error";
    }


    onerror = ioncreative.exception.report;


}
var ioncreative = ioncreative || {};


if (typeof ioncreative.accessibility == 'undefined')
{
    ioncreative.accessibility = {};


    ioncreative.accessibility.init = function()
    {
        ioncreative.accessibility.font.init = {};
    };


}
var ioncreative = ioncreative || {};
ioncreative.accessibility = ioncreative.accessibility || {};


if (typeof ioncreative.accessibility.font == 'undefined')
{

    ioncreative.accessibility.font = {};
    ioncreative.accessibility.font.sizeDelta = 0;


	ioncreative.accessibility.font.init = function()
	{
	    var intDelta = ioncreative.cookies.getCookie("RelativeFontSize");
	    intDelta = parseInt(intDelta);
	    if (isNaN(intDelta))
	    {
	        intDelta = 0;
	    }
		if (intDelta == 0)
		{
			return true;
		}
		ioncreative.accessibility.font.sizeChange(intDelta);
		return true;
	}


	ioncreative.accessibility.font.sizeUpdateDisplay = function()
	{
	    var objDisplay = document.getElementById('TD_RELATIVE_FONT_SIZE');
	    if (objDisplay)
	    {
		    if ((ioncreative.accessibility.font.sizeDelta - 0) > 0)
		    {
			    objDisplay.innerHTML = '+&nbsp;' + ioncreative.accessibility.font.sizeDelta;
		    }
		    else if((ioncreative.accessibility.font.sizeDelta - 0) < 0)
		    {
			    objDisplay.innerHTML = '&nbsp;' + ioncreative.accessibility.font.sizeDelta;
		    }
		    else
		    {
			    objDisplay.innerHTML = '0';
		    }
		}
	}


	ioncreative.accessibility.font.sizeReset = function()
	{
		intReset = -1 * (ioncreative.accessibility.font.sizeDelta)
		ioncreative.accessibility.font.sizeChange(intReset);
		ioncreative.accessibility.font.sizeDelta = 0;
		return true;
	}


	ioncreative.accessibility.font.sizeIncrease = function()
	{
	    ioncreative.accessibility.font.sizeChange(1);
	}


	ioncreative.accessibility.font.sizeDecrease = function()
	{
	    ioncreative.accessibility.font.sizeChange(-1);
	}


	ioncreative.accessibility.font.sizeChange = function(intSizeDelta)
	{
		var intNewDelta = ioncreative.accessibility.font.sizeDelta + intSizeDelta;
		if (intNewDelta > 30)
		{
			alert('30 is the Largest Relative Size This Site Supports');
			return false;
		}
		else if (intNewDelta < -8)
		{
			alert('-8 is the Smallest Relative Size This Site Supports');
			return false;
		}
	    ioncreative.accessibility.font.sizeDelta = intNewDelta;
		ioncreative.cookies.setCookie("RelativeFontSize", ioncreative.accessibility.font.sizeDelta, "[1_YEAR]");
		ioncreative.accessibility.font.sizeUpdateDisplay();
        ioncreative.accessibility.font.sizeAlterStyleSheets(intSizeDelta);
        ioncreative.accessibility.font.sizeAlterTag('body', intSizeDelta);
        ioncreative.accessibility.font.sizeAlterTag('a', intSizeDelta);
        ioncreative.accessibility.font.sizeAlterTag('p', intSizeDelta);
        ioncreative.accessibility.font.sizeAlterTag('font', intSizeDelta);
        ioncreative.accessibility.font.sizeAlterTag('div', intSizeDelta);
		return true;
	}


    ioncreative.accessibility.font.sizeAlterStyleSheets = function(intAdjustment)
    {
		if (typeof(document.styleSheets) == 'undefined')
		{
		    //alert('Your Browser Does Not Support Style Sheets');
			return false;
		}
        var intCounter, intSubCounter, blnPT;
        for (intCounter = 0; intCounter < document.styleSheets.length; intCounter++)
        {
            if (typeof(document.styleSheets[intCounter].rules) == 'undefined')
            {
                objRules = document.styleSheets[intCounter].cssRules;
            }
            else
            {
                objRules = document.styleSheets[intCounter].rules;
            }
            for (intSubCounter = 0; intSubCounter < objRules.length; intSubCounter++)
            {
                objStyle = objRules[intSubCounter].style;
			    var strFontSize = objStyle.fontSize;
                blnPT = (strFontSize.indexOf('pt') != 1);
                intSize = parseInt(strFontSize);
                if (isNaN(intSize))
                {
                    intSize = 12;
                }
                intSize += intAdjustment;
                if (blnPT)
                {
                    strFontSize = intSize + 'pt';
                }
                else
                {
                    strFontSize = intSize + 'px';
                }
                objStyle.fontSize = strFontSize;
            }     
        }
        return true;
    }
    

    ioncreative.accessibility.font.sizeAlterTag = function(strTag, intAdjustment)
    {
        var objElements = document.getElementsByTagName(strTag);
        var intCounter, intSize, blnPT;
        for(intCounter = 0; intCounter < objElements.length; intCounter++)
        {
            var objStyle = objElements[intCounter].style;
			var strFontSize = objStyle.fontSize;
            if (typeof(strFontSize) == 'string')
            {
                blnPT = (strFontSize.indexOf('pt') != 1);
                intSize = parseInt(strFontSize);
                if (isNaN(intSize))
                {
                    intSize = 12;
                }
                intSize += intAdjustment;
                if (blnPT)
                {
                    strFontSize = intSize + 'pt';
                }
                else
                {
                    strFontSize = intSize + 'px';
                }
                objStyle.fontSize = strFontSize;
            }
        }
        return true;
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.calendar == 'undefined')
{
    ioncreative.calendar = {};

}
var ioncreative = ioncreative || {};
ioncreative.calendar = ioncreative.calendar || {};


if (typeof ioncreative.calendar.events == 'undefined')
{
    ioncreative.calendar.events = {};


    ioncreative.calendar.events.createEventWindow = function(strNewID)
    {
        var objMyRef = this;

	    this.ID = strNewID;


        this.objWindow = ioncreative.window.create(strNewID);
        this.objWindow.cssTitle = 'display:none;';
        this.objWindow.setWindowType('HTML');


	    this.show = function(strTitle, strHTML)
	    {
	        objMyRef.objWindow.setInnerHTML('');
		    objMyRef.objWindow.setPosition(ioncreative.document.mouseCoords.x, ioncreative.document.mouseCoords.y);
	        objMyRef.objWindow.show(); // CREATE THE WINDOW FOR ADDITIONS TO BE MADE BELOW
            objMyRef.objWindow.objDiv.className = 'ioncreative-Calendar-Popup-' + strNewID + '-Event';
            /*  TITLE BAR   */
            objMyRef.objTitleBar = document.createElement('div');
            objMyRef.objTitleBar.setAttribute('id', 'cew' + strNewID + 'TitleBar');
            objMyRef.objTitleBar.className = 'ioncreative-Calendar-Popup-' + strNewID + '-Title';
	        objMyRef.objTitleBar.innerHTML = strTitle;
            objMyRef.objWindow.objDiv.appendChild(this.objTitleBar);
            /*  HTML PLACE  */
            objMyRef.objHTML = document.createElement('div');
            objMyRef.objHTML.setAttribute('id', 'cew' + strNewID + 'HTML');
            objMyRef.objHTML.className = 'ioncreative-Calendar-Popup-' + strNewID + '-HTML';
	        objMyRef.objHTML.innerHTML = strHTML;
            objMyRef.objWindow.objDiv.appendChild(this.objHTML);
            /*  CLOSE WINDOW    */
            objMyRef.objClose = document.createElement('div');
            objMyRef.objClose.setAttribute('id', 'cew' + strNewID + 'Close');
            objMyRef.objClose.className = 'ioncreative-Calendar-Popup-' + strNewID + '-Close';
            objMyRef.objClose.innerHTML = 'Close';
            objMyRef.objClose.onclick = function() {objMyRef.hide();};
            objMyRef.objWindow.objDiv.appendChild(this.objClose);
//	        _db.Setup(objMyRef.objHTML);
	        return true;
	    }
    	
	    this.hide = function()
	    {
	        objMyRef.objWindow.hide();
	        return true;
	    }


        objMyRef.hide();

        return this;
    }

}
var ioncreative = ioncreative || {};

if (typeof ioncreative.catalog == 'undefined')
{
    ioncreative.catalog = {};
    ioncreative.catalog.taxText = ' (Plus Tax)';
    ioncreative.catalog.currencyCode = '$';


    ioncreative.catalog.init = function()
    {
        ioncreative.catalog.product.init();
    }

}
var ioncreative = ioncreative || {};
ioncreative.catalog = ioncreative.catalog || {};

if (typeof ioncreative.catalog.product == 'undefined')
{
    ioncreative.catalog.product = {};
    ioncreative.catalog.product.priceOriginal  = 0;
    ioncreative.catalog.product.priceSale      = 0;
    ioncreative.catalog.product.priceBase      = 0;
    ioncreative.catalog.product.priceOptions   = [];
    ioncreative.catalog.product.isTaxable      = false;
    ioncreative.catalog.product.discountText   = '';


    ioncreative.catalog.product.init = function()
    {
    }


    ioncreative.catalog.product.switchAlternateImage = function(strImage, strLarge)
    {
	    var objImage = document.getElementById("ioncreative-imgProduct")
	    if (objImage)
	    {
		    objImage.src = strImage;
	    }
	    var objLarge = document.getElementById("ioncreative-aLarge")
	    if (objLarge)
	    {
		    objLarge.href = strLarge;
	    }
    }


    ioncreative.catalog.product.updatePrice = function()
    {
        var fltAdditional = 0;
        var intCounter = 1;
        while (1 == 1)
        {
            var intCheckCounter = 0;
            var objOptionCategory = document.getElementById('ioncreative-OPTION-' + intCounter);
            if (objOptionCategory == null)
            {
                break;
            }
            if (objOptionCategory.tagName.toLowerCase() == 'select')
            {
                fltAdditional += parseFloat(ioncreative.catalog.product.priceOptions[intCounter - 1][objOptionCategory.selectedIndex]);
                intCheckCounter = 0;
            }
            else
            {
                if (objOptionCategory.checked)
                {
                    fltAdditional += parseFloat(ioncreative.catalog.product.priceOptions[intCounter - 1][intCheckCounter]);
                    intCheckCounter += 1;
                }
            }
            intCounter++;
        }
        var strTaxText = '';
        if (ioncreative.catalog.product.isTaxable)
        {
            strTaxText = ioncreative.catalog.taxText;
        }
        var intQuantity = parseInt(1);
        var objQuantity = document.getElementById('id-ioncreative-Add-Quantity');
        if (objQuantity)
        {
            intQuantity = parseInt(objQuantity.value);
            if ((isNaN(intQuantity)) || (intQuantity < 1))
            {
                objQuantity.value = 1;
                intQuantity = 1;
            }
        }
        var objPrice = document.getElementById('ioncreative-Product-Page-Original-Price');
        if (objPrice)
        {   // DISCOUNT APPLICABLE PRODUCT
            objPrice.innerHTML = 'Price: ' + ioncreative.catalog.currencyCode + (intQuantity * (ioncreative.catalog.product.priceOriginal + fltAdditional)).toFixed(2) + strTaxText;
            objPrice = document.getElementById('ioncreative-Product-Page-Sale-Price-Link');
            if (objPrice)
            {
                objPrice.innerHTML = ioncreative.catalog.product.discountText + ': ' + ioncreative.catalog.currencyCode + (intQuantity * (ioncreative.catalog.product.priceSale + fltAdditional)).toFixed(2) + strTaxText;
            }
        }
        else
        {
            objPrice = document.getElementById('ioncreative-Product-Page-Price');
            if (objPrice)
            {
                objPrice.innerHTML = 'Price: ' + ioncreative.catalog.currencyCode + (intQuantity * (ioncreative.catalog.product.priceBase + fltAdditional)).toFixed(2) + strTaxText;
            }
        }
    }


    ioncreative.catalog.product.initDynamicPricing = function()
    {
        var blnMore = true;
        var intCounter = 1;
        while (blnMore)
        {
            var objOptionCategory = document.getElementById('ioncreative-OPTION-' + intCounter);
            if (objOptionCategory)
            {
                if (objOptionCategory.tagName.toLowerCase() == 'select')
                {
                    var intOptionCounter;
                    for (intOptionCounter = 0; intOptionCounter < objOptionCategory.options.length; intOptionCounter++)
                    {
                        var objOption = objOptionCategory.options[intOptionCounter];
                        var strText = objOption.text;
                        var intIndex = strText.indexOf(' + ');
                        if (intIndex > -1)
                        {
                            var strNewText = strText.substr(0, intIndex);
                            objOption.text = strNewText;
                        }
                    }
                    objOptionCategory.onchange = ioncreative.catalog.product.updatePrice;
                }
                else
                {
                    objOptionCategory.onclick = ioncreative.catalog.product.updatePrice;
                    objOptionCategory = document.getElementById('ioncreative-OPTION-' + (intCounter + '') + '-LABEL');
                    var strText = objOptionCategory.innerHTML;
                    var intIndex = strText.indexOf(' + ');
                    if (intIndex > -1)
                    {
                        var strNewText = strText.substr(0, intIndex);
                        objOptionCategory.innerHTML = strNewText;
                    }
                    objOptionCategory.onclick = ioncreative.catalog.product.updatePrice;
                }
                intCounter++;
            }
            else
            {
                blnMore = false;
            }
        }
        var objQuantity = document.getElementById('id-ioncreative-Add-Quantity');
        if (objQuantity)
        {
            objQuantity.onkeyup = ioncreative.catalog.product.updatePrice;
            objQuantity.onchange = ioncreative.catalog.product.updatePrice;
        }
    }


}
var ioncreative = ioncreative || {};


if (typeof ioncreative.cookies == 'undefined')
{
    ioncreative.cookies = {};


    ioncreative.cookies.setCookie = function(strName, strValue, strExpires)
	{
	    var strCookie = strName + "=" + escape(strValue) + "; domain=www.ioncreative.co.uk; path=/; expires=" + strExpires;
		document.cookie = strCookie;
		if(!ioncreative.cookies.getCookie(name))
		{
			return false;
		}
		else
		{
			return true;
		}
    } 


    ioncreative.cookies.getCookie = function(strName)
	{
		var strCookie = "" + document.cookie;
		var intIndex1 = strCookie.indexOf(strName);
		if (intIndex1 == -1 || strName == "")
		{
			return "";
		}
		var intIndex2 = strCookie.indexOf(';', intIndex1);
		if (intIndex2 == -1)
		{
			intIndex2 = strCookie.length;
		}
		return unescape(strCookie.substring(intIndex1 + strName.length + 1, intIndex2));
	}


    ioncreative.cookies.deleteCookie = function(strName)
	{
		if (ioncreative.cookies.getCookie(strName))
		{
			document.cookie = strName + "=0; domain=www.ioncreative.co.uk; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
		}
	}


}
var ioncreative = ioncreative || {};


if (typeof ioncreative.customerService == 'undefined')
{
    ioncreative.customerService = {};

}
var ioncreative = ioncreative || {};
ioncreative.customerService = ioncreative.customerService || {};


if (typeof ioncreative.customerService.chat == 'undefined')
{
    ioncreative.customerService.chat = {};
    ioncreative.customerService.chat.displayElement = [];
    ioncreative.customerService.chat.tmrIsAvailable = 0;
    ioncreative.customerService.chat.isAvailable_MILLISECONDS = 10 * 1000;    //10 SECONDS
    ioncreative.customerService.chat.unavailableFormID = '';


    ioncreative.customerService.chat.startPolling = function()
    {
        ioncreative.customerService.chat.isAvailable();
    }


    ioncreative.customerService.chat.stopPolling = function()
    {
	    ioncreative.customerService.chat.tmrIsAvailable = clearTimeout(ioncreative.customerService.chat.tmrIsAvailable);
    }


    ioncreative.customerService.chat.isAvailableSchedule = function()
    {
        ioncreative.customerService.chat.tmrIsAvailable = setTimeout(ioncreative.customerService.chat.isAvailable, ioncreative.customerService.chat.isAvailable_MILLISECONDS);
    }


    ioncreative.customerService.chat.registerDisplayElement = function(strElementID)
    {
        var intIndex = ioncreative.customerService.chat.displayElement.length;
        ioncreative.customerService.chat.displayElement[intIndex] = strElementID;
    }


    ioncreative.customerService.chat.unRegisterDisplayElement = function(strElementID)
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.customerService.chat.displayElement.length; intCounter++)
        {
            if (ioncreative.customerService.chat.displayElement[intIndex] = strElementID)
            {
                ioncreative.customerService.chat.displayElement.splice(intIndex);
                return;
            }
        }
    }


    ioncreative.customerService.chat.isAvailable = function()
    {
        var strXMLRequest = '<?xml version="1.0" ?><System><Request type="CHAT"><CHAT type="CHAT_AVAILABLE" /></Request></System>';
        ioncreative.xml.queueRequest('system/', 'VERSION=1&DATA=' + strXMLRequest, ioncreative.customerService.chat.isAvailableComplete);
    }


    ioncreative.customerService.chat.isAvailableComplete = function(objResponse, e)
    {
        if (e != null)
        {
            alert(e.description);
            return;
        }
        if (ioncreative.customerService.chat.displayElement.length > 0)
        {
            // VALIDATE RESPONSE, FAILOVER TO ACTUAL PAGE
            var xmlResponse = objResponse.responseXML;
            var objSysResponse = xmlResponse.selectSingleNode("System/Response");
            if (objSysResponse == null)
            {
                alert('not found ' + objResponse.responseText);
                return true;
            }
            var objResult = objSysResponse.attributes.getNamedItem("result");
            if (objResult == null)
            {
                alert('not found');
                return true;
            }
            if (objResult.value == 'ERROR')
            {
                alert('error');
                return true;
            }
            var objAvailability = objSysResponse.selectSingleNode("Availability");
            if (objAvailability == null)
            {
                alert('error');
//                window.location = ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL;
                return true;
            }
            var strAvailability = objAvailability.childNodes[0].nodeValue;
            var strHTML;
            if (strAvailability == 'FALSE')
            {
                strHTML = 'Live Chat is unavailable';
                if (ioncreative.customerService.chat.unavailableFormID != '')
                {
                    strHTML += '<br /><a href="http://www.ioncreative.co.uk/form/?form=' + ioncreative.customerService.chat.unavailableFormID + '" target="_blank">Click to Ask Question</a>';
                }
            }
            else
            {
                strHTML = 
                    'Live Chat is available<br />' +
                    '<a href="http://www.ioncreative.co.uk/customer-service/chat-request/" target="_blank">Click Here to Chat</a>';
            }
            for (intCounter = 0; intCounter < ioncreative.customerService.chat.displayElement.length; intCounter++)
            {
                var objElement = document.getElementById(ioncreative.customerService.chat.displayElement[intCounter]);
                if (objElement)
                {
                    objElement.innerHTML = strHTML;
                }
            }
        }
        ioncreative.customerService.chat.isAvailableSchedule();
    }

}
var ioncreative = ioncreative || {};
ioncreative.customerService = ioncreative.customerService || {};
ioncreative.customerService.chat = ioncreative.customerService.chat || {};


if (typeof ioncreative.customerService.chat.session == 'undefined')
{
    ioncreative.customerService.chat.session = {};
    ioncreative.customerService.chat.session.strInputElementID = null;
    ioncreative.customerService.chat.session.strHistoryElementID = null;
    ioncreative.customerService.chat.session.strRepsElementID = null;
    ioncreative.customerService.chat.session.dvHistory = null;
    ioncreative.customerService.chat.session.tblHistory = null;
    ioncreative.customerService.chat.session.tbbHistory = null;
    ioncreative.customerService.chat.session.dtLastCheck = '1/1/2007';


    ioncreative.customerService.chat.session.requestChat = function()
    {
        var strXMLRequest = '<?xml version="1.0" ?><System><Request type="CHAT"><CHAT type="REQUEST_CHAT" /></Request></System>';
        ioncreative.xml.queueRequest('system/', 'VERSION=1&DATA=' + strXMLRequest, ioncreative.customerService.chat.session.requestChatComplete);
    }

    ioncreative.customerService.chat.session.requestChatComplete = function(objResponse, e)
    {
        if (e != null)
        {
            alert(e.description);
            return;
        }
        //GOOD
    }


    ioncreative.customerService.chat.session.checkLogSchedule = function()
    {
        ioncreative.customerService.chat.session.tmrCheck = setTimeout('ioncreative.customerService.chat.session.checkLog();', 5000);
    }

    ioncreative.customerService.chat.session.checkLog = function()
    {
        var objSend = document.getElementById('txtSend');
        if (objSend)
        {
            var strXMLRequest = 
                '<?xml version="1.0" ?>' +
                '<System>' +
                    '<Request type="CHAT">' +
                        '<CHAT type="CHAT_LOG">' +
                            '<Visitor>[VISITOR_ID]</Visitor>' +  //[VISITOR_ID]</Visitor>' +
                            '<Since>' + ioncreative.customerService.chat.session.dtLastCheck + '</Since>' +
                        '</CHAT>' +
                    '</Request>' +
                '</System>';
            ioncreative.xml.queueRequest('system/', 'VERSION=1&DATA=' + strXMLRequest, ioncreative.customerService.chat.session.checkLogComplete);
        }
    }

    ioncreative.customerService.chat.session.checkLogComplete = function(objResponse, e)
    {
        if (e != null)
        {
            alert(e.description);
            return;
        }
        ioncreative.customerService.chat.session.checkLogSchedule();
        var xmlResponse = objResponse.responseXML;
        var objSysResponse = xmlResponse.selectSingleNode("System/Response");
        if (objSysResponse == null)
        {
            alert('not found');
            return true;
        }
        var objResult = objSysResponse.attributes.getNamedItem("result");
        if (objResult == null)
        {
            alert('not found');
            return true;
        }
        switch (objResult.value)
        {
            case 'ERROR':
                alert('error');
                alert(objResponse.responseText);
                return true;
                break;
            case 'FAILURE':
                //Check_Log();
                alert(objResponse.responseText);
                return true;
            default:
                break;
        }
        var objError = objSysResponse.selectSingleNode("Error");
        if (objError != null)
        {
            alert('error');
            return true;
        }
        var objNodes = objSysResponse.selectNodes('Entry');
        var intCounter;
        for (intCounter = 0; intCounter < objNodes.length; intCounter++)
        {
            ioncreative.customerService.chat.session.blnHistoryBackground = !ioncreative.customerService.chat.session.blnHistoryBackground;
            var objFrom = objNodes[intCounter].selectSingleNode('ChatFrom');
            var objMessage = objNodes[intCounter].selectSingleNode('Message');
            var objDateTime = objNodes[intCounter].selectSingleNode('DateTime');
            var strFrom = '';
            if (objFrom.childNodes.length > 0)
            {
                strFrom = objFrom.childNodes[0].nodeValue;
            }
            var strMessage = '';
            if (objMessage.childNodes.length > 0)
            {
                strMessage = objMessage.childNodes[0].nodeValue;
            }
            var objTR, objTD;
            objTR = document.createElement("tr");
            if (ioncreative.customerService.chat.session.blnHistoryBackground)
            {
                objTR.style.backgroundColor = '#C2D3FC';
            }
            objTD = document.createElement("td");
            objTD.innerHTML = strFrom + ' said:<br />' + strMessage;
            objTR.appendChild(objTD);
            ioncreative.customerService.chat.session.tbbHistory.appendChild(objTR);
            ioncreative.customerService.chat.session.dtLastCheck = objDateTime.childNodes[0].nodeValue;
            ioncreative.customerService.chat.session.assureRep(objNodes[intCounter], strMessage);
        }
        if (objNodes.length > 0)
        {
            ioncreative.customerService.chat.session.dvHistory.scrollTop = 0;
            ioncreative.customerService.chat.session.dvHistory.scrollTop = ioncreative.customerService.chat.session.dvHistory.scrollHeight;
            ioncreative.customerService.chat.session.displayReps();
        }
    }


    ioncreative.customerService.chat.session.assureRep = function(objNode, strMessage)
    {
        var objRepName = objNode.selectSingleNode('REP_NAME');
        if (objRepName != null)
        {
            var strRepName = objRepName.childNodes[0].nodeValue;
            var objRepPanel = objNode.selectSingleNode('REP_PANEL');
            var strRepPanel = '';
            if (objRepPanel != null)
            {
                strRepPanel = ioncreative.utility.unescapeHTML(objRepPanel.childNodes[0].nodeValue);
            }
            var intCounter, blnFound;
            for (intCounter = 0; intCounter < ioncreative.customerService.chat.session.Reps.length; intCounter++)
            {
                if (ioncreative.customerService.chat.session.Reps[intCounter].Name == strRepName)
                {
                    break;
                }
            }
            ioncreative.customerService.chat.session.Reps[intCounter] = {};
            ioncreative.customerService.chat.session.Reps[intCounter].Name = strRepName;
            ioncreative.customerService.chat.session.Reps[intCounter].Panel = strRepPanel
            ioncreative.customerService.chat.session.Reps[intCounter].LastMessage = new Date().getTime();
            if (strMessage.substring(strMessage.length - 23) == 'has left chat.</strong>')
            {
                var objTR = document.getElementById('tr_rep' + strRepName);
                if (objTR)
                {
                    objTR.parentNode.removeChild(objTR);
                }
                ioncreative.customerService.chat.session.Reps.splice(intCounter, 1);
            }
        }
    }


    ioncreative.customerService.chat.session.displayReps = function()
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.customerService.chat.session.Reps.length; intCounter++)
        {
            var objTR, objTD;
            objTR = document.getElementById('tr_rep' + ioncreative.customerService.chat.session.Reps[intCounter].Name);
            if (objTR == null)
            {
                ioncreative.customerService.chat.session.blnRepBackground = !ioncreative.customerService.chat.session.blnRepBackground;
                objTR = document.createElement('tr');
                objTR.setAttribute('id', 'tr_rep' + ioncreative.customerService.chat.session.Reps[intCounter].Name);
                objTR.verticalAlign = 'top';
                if (ioncreative.customerService.chat.session.blnRepBackground)
                {
                    objTR.style.backgroundColor = '#EFEFEF';
                }
                objTD = document.createElement('td');
                objTR.appendChild(objTD);
                ioncreative.customerService.chat.session.tbbReps.appendChild(objTR);
            }
            else
            {
                objTD = objTR.firstChild;
            }
            objTD.innerHTML = ioncreative.customerService.chat.session.Reps[intCounter].Panel;
        }
    }


    ioncreative.customerService.chat.session.send = function(strSend)
    {
        var strXMLRequest = 
            '<?xml version="1.0" ?>' +
            '<System>' +
                '<Request type="CHAT">' +
                    '<CHAT type="SEND">' +
                        '<Visitor>[VISITOR_ID]</Visitor>' +
                        '<Message>' + escape(strSend) + '</Message>' +
                    '</CHAT>' +
                '</Request>' +
            '</System>';
        ioncreative.xml.queueRequest('system/', 'VERSION=1&DATA=' + strXMLRequest, ioncreative.customerService.chat.session.sendComplete);
    }

    ioncreative.customerService.chat.session.sendComplete = function(objResponse, e)
    {
        var xmlResponse = objResponse.responseXML;
        var objSysResponse = xmlResponse.selectSingleNode("System/Response");
        if (objSysResponse == null)
        {
            alert('not found');
            return true;
        }
        var objResult = objSysResponse.attributes.getNamedItem("result");
        if (objResult == null)
        {
            alert('not found');
            return true;
        }
        switch (objResult.value)
        {
            case 'ERROR':
                alert('error');
                return true;
                break;
            case 'FAILURE':
                Check_Log();
                return true;
            default:
                break;
        }
        var objError = objSysResponse.selectSingleNode("Error");
        if (objError != null)
        {
            alert('error');
            return true;
        }
        ioncreative.customerService.chat.session.checkLog();
    }


    ioncreative.customerService.chat.session.exit = function()
    {
        var strResult = confirm('Would you like an email copy of this chat?') + '';
        strResult = strResult.toUpperCase();
        var strXMLRequest = 
            '<?xml version="1.0" ?>' +
            '<System>' +
                '<Request type="CHAT">' +
                    '<CHAT type="EXIT">' +
                        '<Visitor>[VISITOR_ID]</Visitor>' +
                        '<Email>' + strResult + '</Email>' +
                    '</CHAT>' +
                '</Request>' +
            '</System>';
        ioncreative.xml.queueRequest('system', 'VERSION=1&DATA=' + strXMLRequest, ioncreative.customerService.chat.session.exitComplete);
    }

    ioncreative.customerService.chat.session.exitComplete = function(objResponse, e)
    {
        if (e != null)
        {
            alert(e.description);
            return;
        }
        var xmlResponse = objResponse.responseXML;
        var objSysResponse = xmlResponse.selectSingleNode("System/Response");
        if (objSysResponse == null)
        {
            alert('not found');
            return true;
        }
        var objResult = objSysResponse.attributes.getNamedItem("result");
        if (objResult == null)
        {
            alert('not found');
            return true;
        }
        switch (objResult.value)
        {
            case 'ERROR':
                alert('error');
                break;
            case 'FAILURE':
                alert('failure');
                break;
            default:
                break;
        }
        var objError = objSysResponse.selectSingleNode("Error");
        if (objError != null)
        {
            alert('error');
            return true;
        }
        window.close();
    }


    ioncreative.customerService.chat.session.start = function(InputElementID, HistoryElementID, RepsElementID)
    {
        ioncreative.customerService.chat.session.Reps = [];
        ioncreative.customerService.chat.session.strInputElementID = InputElementID;
        /*  SETUP CHAT LOG TABLE */
        ioncreative.customerService.chat.session.blnHistoryBackground = false;
        ioncreative.customerService.chat.session.strHistoryElementID = HistoryElementID;
        ioncreative.customerService.chat.session.dvHistory = document.getElementById(ioncreative.customerService.chat.session.strHistoryElementID);
        ioncreative.customerService.chat.session.tblHistory = document.createElement("table");
        ioncreative.customerService.chat.session.tblHistory.style.width = '100%';
        ioncreative.customerService.chat.session.tblHistory.style.border = 'none';
        ioncreative.customerService.chat.session.tbbHistory = document.createElement("tbody");
        ioncreative.customerService.chat.session.tblHistory.appendChild(ioncreative.customerService.chat.session.tbbHistory);
        ioncreative.customerService.chat.session.dvHistory.appendChild(ioncreative.customerService.chat.session.tblHistory);
        /*  SETUP REP TABLE */
        ioncreative.customerService.chat.session.blnRepBackground = false;
        ioncreative.customerService.chat.session.strRepsElementID = RepsElementID;
        ioncreative.customerService.chat.session.dvReps = document.getElementById(ioncreative.customerService.chat.session.strRepsElementID);
        ioncreative.customerService.chat.session.tblReps = document.createElement("table");
        ioncreative.customerService.chat.session.tbbReps = document.createElement("tbody");
        ioncreative.customerService.chat.session.tblReps.appendChild(ioncreative.customerService.chat.session.tbbReps);
        ioncreative.customerService.chat.session.dvReps.appendChild(ioncreative.customerService.chat.session.tblReps);
        /*  ACTUALLY START THE CHAT SESSION */
        ioncreative.customerService.chat.session.requestChat();
        ioncreative.customerService.chat.session.checkLogSchedule();
        ioncreative.customerService.chat.session.tmrReps = setInterval('ioncreative.customerService.chat.session.displayReps();', 30000);
        ioncreative.customerService.chat.session.checkLog();
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.dataservices == 'undefined')
{
    ioncreative.dataservices = {};

}
var ioncreative = ioncreative || {};
ioncreative.dataservices = ioncreative.dataservices || {};


if (typeof ioncreative.dataservices.atom == 'undefined')
{
    ioncreative.dataservices.atom = {};
    ioncreative.dataservices.atom.queue = [];
    ioncreative.dataservices.atom.queueBusy = false;


    ioncreative.dataservices.atom.queueRequest = function(strURL, CallBackComplete)
    {
        var intIndex = ioncreative.dataservices.atom.queue.length;
        ioncreative.dataservices.atom.queue[intIndex] = {};
        ioncreative.dataservices.atom.queue[intIndex].url = strURL;
        ioncreative.dataservices.atom.queue[intIndex].callBack = CallBackComplete;
        ioncreative.dataservices.atom.checkQueue();
    }


    ioncreative.dataservices.atom.checkQueue = function()
    {
        if (ioncreative.dataservices.atom.queueBusy)
        {
            setTimeout('ioncreative.dataservices.atom.checkQueue()', 100);
            return;
        }
        if (ioncreative.dataservices.atom.queue.length == 0)
        {
            return;
        }
        ioncreative.dataservices.atom.queueBusy = true;
        var strXMLRequest = '<?xml version="1.0" ?><System><Request type="DATA-FEED"><feed>' + ioncreative.dataservices.atom.queue[0].url + '</feed></Request></System>';
        ioncreative.xml.queueRequest('system/', 'VERSION=1&DATA=' + strXMLRequest, ioncreative.dataservices.atom.callBack);
    }


    ioncreative.dataservices.atom.callBack = function(objResponse, e)
    {
        if (e != null)
        {
            if (typeof(ioncreative.dataservices.atom.queue[0].callBack) == 'function')
            {
                ioncreative.dataservices.atom.queue[0].callBack(null, e);
            }
            ioncreative.dataservices.atom.queue.splice(0, 1);
            ioncreative.dataservices.atom.queueBusy = false;
            return;
        }
        var objAF = new ioncreative.dataservices.atom.feed(objResponse.responseXML);
        if (typeof(ioncreative.dataservices.atom.queue[0].callBack) == 'function')
        {
            ioncreative.dataservices.atom.queue[0].callBack(objAF, null);
        }
        ioncreative.dataservices.atom.queue.splice(0, 1);
        ioncreative.dataservices.atom.queueBusy = false;
    }



    ioncreative.dataservices.atom.feed = function(objXML)
    {
	    this.xml = objXML;
	    this.id = '';
	    this.updated = '';
	    this.title = '';
	    this.subTitle = '';
	    this.generator = '';
	    this.links = [];
	    this.author = {};
	    this.entry = [];


	    this.parse = function()
	    {
		    var objFeed = objXML.getElementsByTagName('feed')[0];
		    this.id = this.getValue(objFeed, 'id');
		    this.updated = this.getValue(objFeed, 'updated');
		    this.title = this.getValue(objFeed, 'title');
		    this.subTitle = this.getValue(objFeed, 'subtitle');
		    this.generator = this.getValue(objFeed, 'generator');
		    this.links = this.parseLinks(objFeed);
		    this.author = this.parseAuthor(objFeed);
		    this.parseEntries();
	    }


	    this.parseLinks = function(objParent)
	    {
	        var objReturn = [];
		    var objLinks = objParent.getElementsByTagName('link');
		    var intCounter;
		    for (intCounter = 0; intCounter < objLinks.length; intCounter++)
		    {
                if (objLinks[intCounter].parentNode == objParent)
                {
                    var intIndex = objReturn.length;
		            objReturn[intIndex] = {};
		            objReturn[intIndex].rel = '';
		            objReturn[intIndex].type = '';
		            objReturn[intIndex].href = '';
		            var intAttribute;
                    for (intAttribute = 0; intAttribute < objLinks[intCounter].attributes.length; intAttribute++)
                    {
                        switch (objLinks[intCounter].attributes[intAttribute].nodeName)
                        {
                            case 'rel':
		                        objReturn[intIndex].rel = objLinks[intCounter].attributes[intAttribute].nodeValue;
                                break;
                            case 'type':
		                        objReturn[intIndex].type = objLinks[intCounter].attributes[intAttribute].nodeValue;
                                break;
                            case 'href':
		                        objReturn[intIndex].href = objLinks[intCounter].attributes[intAttribute].nodeValue;
                                break;
                            default:
                                break;
                        }
                    }
                }
		    }
		    return objReturn;
	    }


	    this.parseAuthor = function(objParent)
	    {
	        var objReturn = {};
	        objReturn.name = '';
	        objReturn.uri = '';
	        objReturn.email = '';
		    var objAuthor = objParent.getElementsByTagName('author');
		    var intCounter;
		    for (intCounter = 0; intCounter < objAuthor.length; intCounter++)
		    {
                if (objAuthor[intCounter].parentNode == objParent)
                {
                    objReturn.name = this.getValue(objAuthor[intCounter], 'name');
                    objReturn.uri = this.getValue(objAuthor[intCounter], 'uri');
                    objReturn.email = this.getValue(objAuthor[intCounter], 'email');
                    return objReturn;
                }
            }
            return objReturn;
	    }


	    this.parseEntries = function()
	    {
		    var objFeed = objXML.getElementsByTagName('feed')[0];
		    var objEntries = objFeed.getElementsByTagName('entry');
		    var intCounter;
		    for (intCounter = 0; intCounter < objEntries.length; intCounter++)
		    {
                if (objEntries[intCounter].parentNode == objFeed)
                {
                    var intIndex = this.entry.length;
		            this.entry[intIndex] = {};
		            this.entry[intIndex].id = this.getValue(objEntries[intCounter], 'id');
		            this.entry[intIndex].published = this.getValue(objEntries[intCounter], 'published');
		            this.entry[intIndex].updated = this.getValue(objEntries[intCounter], 'updated');
		            this.entry[intIndex].title = this.getValue(objEntries[intCounter], 'title');
		            this.entry[intIndex].content = this.getValue(objEntries[intCounter], 'content');
		            this.entry[intIndex].links = this.parseLinks(objEntries[intCounter]);
		            this.entry[intIndex].author = this.parseAuthor(objEntries[intCounter]);
                }
		    }
	    }


	    this.getValue = function(objNode, strElement)
	    {
		    var objElements = objNode.getElementsByTagName(strElement);
		    if (objElements.length > 0)
		    {
			    if (objElements[0].childNodes.length > 0)
			    {
			        return objElements[0].childNodes[0].nodeValue;
			    }
		    }
		    return '';
	    }


        this.parse();
    }
    
    
}
var ioncreative = ioncreative || {};


if (typeof ioncreative.dialogs == 'undefined')
{
    ioncreative.dialogs = {};
    ioncreative.dialogs._dialogs = [];


    ioncreative.dialogs.callBack = function(ID, Value)
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.dialogs._dialogs.length; intCounter++)
        {
            if (ioncreative.dialogs._dialogs[intCounter].ID == ID)
            {
                ioncreative.dialogs._dialogs[intCounter].dialogCallBack(Value);
                return;
            }
        }
    }


    ioncreative.dialogs.create = function(strNewID)
    {
        var intIndex = ioncreative.dialogs._dialogs.length;
        ioncreative.dialogs._dialogs[intIndex] = this;

        this.ID = strNewID;
        this.HTML = '';
        this.title = '';
        this.buttons = {};
        this.buttons.yes = false;
        this.buttons.no = false;
        this.buttons.cancel = false;
        this.buttons.ok = true;
        this.buttons.save = false;
        this.fnCallBack = null;


        this.objWindow = ioncreative.window.create('bw_' + strNewID);


        this.dialogCallBack = function(Value)
        {
            this.hide();
            if (this.fnCallBack)
            {
                this.fnCallBack(Value);
            }
        }
        

        this.setHTML = function(NewHTML)
        {
            this.HTML = NewHTML;
            this.render();
        }


        this.hide = function()
        {
            this.objWindow.hide();
        }


        this.showModal = function()
        {
            this.objWindow.controlBox = false;
            this.render();
            this.objWindow.show();
        }
        

        this.render = function()
        {
            var strHTML = '';
            if
                (
                    (this.buttons.yes == true) ||
                    (this.buttons.no == true) ||
                    (this.buttons.cancel == true) ||
                    (this.buttons.ok == true) ||
                    (this.buttons.save == true)
                )
            {
                strHTML = 
                    '<table border="0" cellspacing="2" cellpadding="0" width="100%">' +
                        '<tr><td>' + this.HTML + '</td></tr>' +
                        '<tr>' +
                            '<td align="right">';
                if (this.buttons.ok == true)
                {
                    strHTML += '<input type="submit" value="OK" onclick="ioncreative.dialogs.callBack(\'' + this.ID + '\', \'OK\')" />';
                }
                if (this.buttons.save == true)
                {
                    strHTML += '<input type="submit" value="Save" onclick="ioncreative.dialogs.callBack(\'' + this.ID + '\', \'SAVE\')" />';
                }
                if (this.buttons.yes == true)
                {
                    strHTML += '<input type="submit" value="Yes" onclick="ioncreative.dialogs.callBack(\'' + this.ID + '\', \'YES\')" />';
                }
                if (this.buttons.no == true)
                {
                    strHTML += '<input type="submit" value="No" onclick="ioncreative.dialogs.callBack(\'' + this.ID + '\', \'NO\')" />';
                }
                if (this.buttons.cancel == true)
                {
                    strHTML += '<input type="submit" value="Cancel" onclick="ioncreative.dialogs.callBack(\'' + this.ID + '\', \'CANCEL\')" />';
                }
                strHTML +=
                            '</td>' +
                        '</tr>' +
                    '</table>';
            }
            else
            {
                strHTML = this.HTML;
            }
            this.objWindow.setInnerHTML(strHTML);
        }
        
        return this;
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.dynamicBrowsing == 'undefined')
{
    ioncreative.dynamicBrowsing = new function()
    {
        this.ROOT_URL = '';
        this.TEST_ROOT_URL = '';
        this.RelativeURL = '';
        this.divHistory = null;
        this.trHelp = null;
        this.divHelp = null;
        this.imgBack = null;
        this.imgBackDisabled = null;
        this.imgForward = null;
        this.imgForwardDisabled = null;
        this.sltHistory = null;


        this.init = function(strURL)
        {
            ioncreative.dynamicBrowsing.ROOT_URL = strURL;
            ioncreative.dynamicBrowsing.TEST_ROOT_URL = ioncreative.dynamicBrowsing.ROOT_URL.toUpperCase().replace("HTTPS://", "HTTP://");
            //ADD ORIGINAL PAGE
            var strLink = window.location.href;
            var intLength = ioncreative.dynamicBrowsing.ROOT_URL.length;
            if (strLink.toUpperCase().indexOf("HTTPS://") > -1)
            {
                intLength++;
            }
            strLink = strLink.substring(intLength);
            if (strLink.indexOf("#") > -1)
            {
                strLink = strLink.substring(0, strLink.indexOf("#"));
            }
            ioncreative.dynamicBrowsing.history.url[0] = strLink;
            ioncreative.dynamicBrowsing.history.index = 0;
            ioncreative.dynamicBrowsing.initHistoryBox();
            ioncreative.dynamicBrowsing.updateToggle();
            ioncreative.dynamicBrowsing.configureElements();
        }


        this.initHistoryBox = function()
        {
            ioncreative.dynamicBrowsing.divHistory = document.createElement("div");
            ioncreative.dynamicBrowsing.divHistory.style.position = ioncreative.utility.getFixedStyle();
            ioncreative.dynamicBrowsing.divHistory.style.top = "0px";
            ioncreative.dynamicBrowsing.divHistory.style.left = "0px";
            ioncreative.dynamicBrowsing.divHistory.style.border = "solid 1px black";
            ioncreative.dynamicBrowsing.divHistory.style.backgroundColor = "#ffffff";
            ioncreative.dynamicBrowsing.divHistory.style.width = "99%";
            ioncreative.dynamicBrowsing.divHistory.style.margin = "0 0 0 0";
            ioncreative.dynamicBrowsing.divHistory.style.padding = "2px";
            ioncreative.dynamicBrowsing.divHistory.style.display = 'none';
            var objTable = document.createElement("table");
            objTable.style.width = "100%";
            ioncreative.dynamicBrowsing.divHistory.appendChild(objTable);
            var objTR = objTable.insertRow(objTable.rows.length);
            var objTD = objTR.insertCell(objTR.cells.length);
            //NAVIGATION SELECT
            ioncreative.dynamicBrowsing.sltHistory = document.createElement("select");
            ioncreative.dynamicBrowsing.sltHistory.style.width = "80%";
            ioncreative.dynamicBrowsing.sltHistory.onchange = function ()
                {
                    ioncreative.dynamicBrowsing.history.setIndex(
                        ioncreative.dynamicBrowsing.sltHistory.options[ioncreative.dynamicBrowsing.sltHistory.selectedIndex].value
                        );
                };
            objTD.appendChild(ioncreative.dynamicBrowsing.sltHistory);
            //BACK BUTTON
            ioncreative.dynamicBrowsing.imgBack = document.createElement("img");
            ioncreative.dynamicBrowsing.imgBack.onclick = ioncreative.dynamicBrowsing.history.back;
            ioncreative.dynamicBrowsing.imgBack.style.cursor = 'pointer';
            ioncreative.dynamicBrowsing.imgBack.style.margin = "0 10px 0 10px";
            ioncreative.dynamicBrowsing.imgBack.alt = "Back";
            ioncreative.dynamicBrowsing.imgBack.src = ioncreative.dynamicBrowsing.ROOT_URL + 'images/default/arrowleft.png';
            objTD.appendChild(ioncreative.dynamicBrowsing.imgBack);
            ioncreative.dynamicBrowsing.imgBackDisabled = document.createElement("img");
            ioncreative.dynamicBrowsing.imgBackDisabled.style.margin = "0 10px 0 10px";
            ioncreative.dynamicBrowsing.imgBackDisabled.alt = "Back";
            ioncreative.dynamicBrowsing.imgBackDisabled.src = ioncreative.dynamicBrowsing.ROOT_URL + 'images/default/arrowleftdisabled.png';
            ioncreative.dynamicBrowsing.imgBackDisabled.style.display = 'none';
            objTD.appendChild(ioncreative.dynamicBrowsing.imgBackDisabled);
            //FORWARD BUTTON
            ioncreative.dynamicBrowsing.imgForward = document.createElement("img");
            ioncreative.dynamicBrowsing.imgForward.onclick = ioncreative.dynamicBrowsing.history.forward;
            ioncreative.dynamicBrowsing.imgForward.style.cursor = 'pointer';
            ioncreative.dynamicBrowsing.imgForward.style.margin = "0 10px 0 0px";
            ioncreative.dynamicBrowsing.imgForward.alt = "Forward";
            ioncreative.dynamicBrowsing.imgForward.src = ioncreative.dynamicBrowsing.ROOT_URL + 'images/default/arrowright.png';
            objTD.appendChild(ioncreative.dynamicBrowsing.imgForward);
            ioncreative.dynamicBrowsing.imgForwardDisabled = document.createElement("img");
            ioncreative.dynamicBrowsing.imgForwardDisabled.style.margin = "0 10px 0 0px";
            ioncreative.dynamicBrowsing.imgForwardDisabled.alt = "Forward";
            ioncreative.dynamicBrowsing.imgForwardDisabled.src = ioncreative.dynamicBrowsing.ROOT_URL + 'images/default/arrowrightdisabled.png';
            ioncreative.dynamicBrowsing.imgForwardDisabled.style.display = 'none';
            objTD.appendChild(ioncreative.dynamicBrowsing.imgForwardDisabled);
            //HELP BUTTON
            var objHelp = document.createElement("img");
            objHelp.onclick = ioncreative.dynamicBrowsing.toggleHelp;
            objHelp.style.cursor = 'pointer';
            objHelp.src = ioncreative.dynamicBrowsing.ROOT_URL + 'images/default/help.png';
            objTD.appendChild(objHelp);
            ioncreative.dynamicBrowsing.trHelp = objTable.insertRow(objTable.rows.length);
            ioncreative.dynamicBrowsing.trHelp.style.display = 'none';
            objTD = ioncreative.dynamicBrowsing.trHelp.insertCell(ioncreative.dynamicBrowsing.trHelp.cells.length);
            ioncreative.dynamicBrowsing.divHelp = document.createElement("div");
            objTD.appendChild(ioncreative.dynamicBrowsing.divHelp);
            if (document.body)
            {
                document.body.appendChild(ioncreative.dynamicBrowsing.divHistory); 
            }
            else
            {
                document.documentElement.appendChild(ioncreative.dynamicBrowsing.divHistory); 
            }
        }

        
        this.configureElements = function(objParent)
        {
            if (ioncreative.dynamicBrowsing.divHistory == null)
            {
                return;
            }
            if (typeof(objParent) == 'undefined')
            {
                objParent = document;
            }
            ioncreative.dynamicBrowsing.configureLinks(objParent);
            ioncreative.dynamicBrowsing.configureButtons(objParent);
        }
        
        
        this.configureLinks = function(objParent)
        {
            var objLinks = objParent.getElementsByTagName("a");
            for (var intCounter = 0; intCounter < objLinks.length; intCounter++)
            {
                if (objLinks[intCounter].target == '')
                {
                    if (typeof(objLinks[intCounter].onclick) != 'function')
                    {
                        //alert(objLinks[intCounter].href + '\r\n' + typeof(objLinks[intCounter].onclick));
                        objLinks[intCounter].onclick = Function('return ioncreative.dynamicBrowsing.clickLink(this);');
                    }
                }
            }     
        }
        
        
        this.configureButtons = function(objParent)
        {
            var objInput = objParent.getElementsByTagName("input");
            for (var intCounter = 0; intCounter < objInput.length; intCounter++)
            {
                if (objInput[intCounter].name == 'DYNAMIC-BROWSE')
                {
                    var strLink = objInput[intCounter].value;
                    var blnCalendar = false;
                    var blnPage = false;
                    var blnSearch = false;
                    var intIndex = strLink.indexOf("|");
                    if (intIndex > -1)
                    {
                        var strParam = strLink.substring(intIndex + 1);
                        switch (strParam)
                        {
                            case "CALENDAR-MONTH":
                                blnCalendar = true;
                                break;
                            case "PAGE":
                                blnPage = true;
                                break;
                            case "SEARCH":
                                blnSearch = true;
                                break;
                        }
                    }
                    var objForm = objInput[intCounter].form;
                    objForm.onsubmit = Function('return ioncreative.dynamicBrowsing.submitForm(this);');
                    var objFormElement = objForm.getElementsByTagName("input");
                    for (var intCounter2 = 0; intCounter2 < objFormElement.length; intCounter2++)
                    {
                        if ((objFormElement[intCounter2].type == "submit") || (objFormElement[intCounter2].type == "image"))
                        {
                            objFormElement[intCounter2].onclick = Function('return ioncreative.dynamicBrowsing.clickButton(this);');
                        }
                    }
                    if (blnCalendar)
                    {
                        var objSelect = objForm.getElementsByTagName("select");
                        for (var intCounter2 = 0; intCounter2 < objSelect.length; intCounter2++)
                        {
                            if ((objSelect[intCounter2].name == 'YEAR') || (objSelect[intCounter2].name == 'MONTH'))
                            {
                                objSelect[intCounter2].onchange = Function('return ioncreative.dynamicBrowsing.clickButton(this);');
                            }
                        }
                    }
                    if (blnPage || blnSearch)
                    {
                        var objSelect = objForm.getElementsByTagName("select");
                        for (var intCounter2 = 0; intCounter2 < objSelect.length; intCounter2++)
                        {
                            if (objSelect[intCounter2].name == 'PAGE')
                            {
                                objSelect[intCounter2].onchange = Function('return ioncreative.dynamicBrowsing.clickButton(this);');
                            }
                        }
                    }
                }
            }     
        }    

        
        this.setEnabled = function(blnEnabled)
        {
            if (blnEnabled == true)
            {
                ioncreative.cookies.setCookie("DISABLE-DYNAMIC-BROWSING", "FALSE", "[1_YEAR]");
            }
            else
            {
                ioncreative.cookies.setCookie("DISABLE-DYNAMIC-BROWSING", "TRUE", "[1_YEAR]");
            }
        }

        
        this.getEnabled = function()
        {
            if ((ioncreative.cookies.getCookie("DISABLE-DYNAMIC-BROWSING") == "FALSE") || (ioncreative.cookies.getCookie("DISABLE-DYNAMIC-BROWSING") == ""))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        
        this.toggleEnabled = function()
        {
            if (ioncreative.dynamicBrowsing.getEnabled() == true)
            {
                ioncreative.dynamicBrowsing.setEnabled(false);
            }
            else
            {
                ioncreative.dynamicBrowsing.setEnabled(true);
            }
            ioncreative.dynamicBrowsing.updateToggle();
        }

        
        this.updateToggle = function()
        {
            var objClick = document.getElementById('ioncreative-Dynamic-Browsing');
            if (objClick)
            {
                if (ioncreative.dynamicBrowsing.getEnabled() == true)
                {
                    objClick.innerHTML = 'Dynamic Browsing ON';
                }
                else
                {
                    objClick.innerHTML = 'Dynamic Browsing OFF';
                }
            }
        }


        this.clickButton = function(objButton)
        {
            var objForm = objButton.form;
            return ioncreative.dynamicBrowsing.submitForm(objForm);
        }


        this.submitForm = function(objForm)
        {
            if (ioncreative.dynamicBrowsing.getEnabled() != true)
            {
                return true;
            }
            var objInputs = objForm.getElementsByTagName("input");
            var objURL = null;
            for (var intCounter = 0; intCounter < objInputs.length; intCounter++)
            {
                if (objInputs[intCounter].name == "DYNAMIC-BROWSE")
                {
                    objURL = objInputs[intCounter];
                    break;
                }
            }
            if (objURL == null)
            {   // NO DYNAMIC URL ELEMENT FOUND
                return true;
            }
            var strLink = objURL.value;
            var intIndex = strLink.indexOf("|");
            if (intIndex > -1)
            {
                var strParam = strLink.substring(intIndex + 1);
                strLink = strLink.substring(0, intIndex);
                switch (strParam)
                {
                    case "CALENDAR-MONTH":
                        var dtCurrent = new Date();
                        var intYear = dtCurrent.getFullYear();
                        var intMonth = dtCurrent.getMonth();
                        var objSelect = objForm.getElementsByTagName("select");
                        for (var intCounter = 0; intCounter < objSelect.length; intCounter++)
                        {
                            if (objSelect[intCounter].name == "YEAR")
                            {
                                intYear = parseInt(objSelect[intCounter].value);
                            }
                            else if (objSelect[intCounter].name == "MONTH")
                            {
                                intMonth = parseInt(objSelect[intCounter].value);
                            }
                        }
                        strLink += 'month/' + intYear + '/' + intMonth + '/';
                        break;
                    case "PAGE":
                        var intPage = 1;
                        var objSelect = objForm.getElementsByTagName("select");
                        for (var intCounter = 0; intCounter < objSelect.length; intCounter++)
                        {
                            if (objSelect[intCounter].name == "PAGE")
                            {
                                intPage = parseInt(objSelect[intCounter].value);
                                break;
                            }
                        }
                        if (intPage > 1)
                        {
                            strLink += 'page' + intPage + '/';
                        }
                        break;
                    case "SEARCH":
                        var strSearch = '';
                        var intPage = 1;
                        var objInput = objForm.getElementsByTagName("input");
                        for (var intCounter = 0; intCounter < objInput.length; intCounter++)
                        {
                            switch (objInput[intCounter].name)
                            {
                                case "SEARCH":
                                    strSearch = escape(objInput[intCounter].value);
                                    break;
                                case "PAGE":
                                    intPage = parseInt(objInput[intCounter].value);
                                    break;
                            }
                        }
                        var strCategory = '';
                        var objSelect = objForm.getElementsByTagName("select");
                        for (var intCounter = 0; intCounter < objSelect.length; intCounter++)
                        {
                            switch (objSelect[intCounter].name)
                            {
                                case "SEARCH_CATEGORY":
                                    strCategory = escape(objSelect[intCounter].value);
                                    break;
                                case "PAGE":
                                    intPage = parseInt(objSelect[intCounter].value);
                                    break;
                            }
                        } 
                        strLink = ioncreative.dynamicBrowsing.ROOT_URL + 'search/page' + intPage + '/?search=' + strSearch + '%26amp%3Bcategory=' + strCategory;
                        break;
                }
            }
            var strTest = strLink.toUpperCase().replace("HTTPS://", "HTTP://").substring(0, ioncreative.dynamicBrowsing.TEST_ROOT_URL.length);
            if (strTest != ioncreative.dynamicBrowsing.TEST_ROOT_URL)
            {
                return true;
            }
            var intLength = ioncreative.dynamicBrowsing.ROOT_URL.length;
            if (strLink.toUpperCase().indexOf("HTTPS://") > -1)
            {
                intLength++;
            }
            ioncreative.dynamicBrowsing.history.add(strLink.substring(intLength));
            return false;
        }
        

        this.clickLink = function(objAnchor)
        {
            if (ioncreative.dynamicBrowsing.getEnabled() != true)
            {
                return true;
            }
            var strLink = objAnchor.href;
            var strTest = strLink.toUpperCase().replace("HTTPS://", "HTTP://").substring(0, ioncreative.dynamicBrowsing.TEST_ROOT_URL.length);
            if (strTest != ioncreative.dynamicBrowsing.TEST_ROOT_URL)
            {
                return true;
            }
            var intLength = ioncreative.dynamicBrowsing.ROOT_URL.length;
            if (strLink.toUpperCase().indexOf("HTTPS://") > -1)
            {
                intLength++;
            }
            ioncreative.dynamicBrowsing.history.add(strLink.substring(intLength));
            return false;
        }


        this.toggleHelp = function()
        {
            if (ioncreative.dynamicBrowsing.trHelp.style.display == 'none')
            {
                ioncreative.dynamicBrowsing.trHelp.style.display = '';
            }
            else
            {
                ioncreative.dynamicBrowsing.trHelp.style.display = 'none';
            }
            var objBody;
            if (document.body)
            {
                objBody = document.body;
            }
            else
            {
                objBody = document.documentElement;
            }
            objBody.style.marginTop = ioncreative.dynamicBrowsing.divHistory.offsetHeight + 'px';
        }


        this.xmlReady = function(objResponse, e)
        {
            if (e != null)
            {
                alert(e.description);
                return;
            }
            // VALIDATE RESPONSE, FAILOVER TO ACTUAL PAGE
            var xmlResponse = objResponse.responseXML;
            var objSysResponse = xmlResponse.selectSingleNode("System/Response");
            if (objSysResponse == null)
            {
                alert('not found');
//                window.location = ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL;
                return true;
            }
            var objResult = objSysResponse.attributes.getNamedItem("result");
            if (objResult == null)
            {
                alert('not found');
//                window.location = ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL;
                return true;
            }
            if (objResult.value == 'ERROR')
            {
                alert('error');
//                window.location = ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL;
                return true;
            }
            var objHTML = objSysResponse.selectSingleNode("HTML");
            if (objHTML == null)
            {
                alert('error');
//                window.location = ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL;
                return true;
            }
            var strHTML = objHTML.childNodes[0].nodeValue;
            var objSeperated = ioncreative.utility.seperateHTMLJavascript(strHTML);
            // SHUT DOWN ANY JAVASCRIPTS THAT MIGHT BE REMOVED
            ioncreative.slideShows.pause();
            ioncreative.scrollers.stop();
            // DISPLAY CONTENT
            var objContent = document.getElementById('ioncreative-Page-Content');
            objContent.innerHTML = objSeperated.HTML;
            ioncreative.dynamicBrowsing.configureElements(objContent);
            ioncreative.utility.executeJavascript(objSeperated.Javascript);
            ioncreative.dynamicBrowsing.history.updateDisplay()
            //RESTART ANY SCRIPTS THAT STILL EXIST
            ioncreative.slideShows.start();
            ioncreative.scrollers.start();
        }


        this.history = {};
        this.history.url = new Array();
        this.history.index = -1;

        this.history.add = function(strRelativeURL)
        {
            for (var intCounter = (ioncreative.dynamicBrowsing.history.url.length - 1); intCounter > ioncreative.dynamicBrowsing.history.index; intCounter--)
            {
                ioncreative.dynamicBrowsing.history.url.splice(intCounter, 1);
            }
            ioncreative.dynamicBrowsing.history.url[ioncreative.dynamicBrowsing.history.url.length] = strRelativeURL;
            ioncreative.dynamicBrowsing.RelativeURL = strRelativeURL;
            ioncreative.dynamicBrowsing.history.setIndex(ioncreative.dynamicBrowsing.history.url.length - 1);
        }


        this.history.back = function()
        {
            return ioncreative.dynamicBrowsing.history.setIndex(parseInt(ioncreative.dynamicBrowsing.history.index) - 1);
        }


        this.history.forward = function()
        {
            return ioncreative.dynamicBrowsing.history.setIndex(parseInt(ioncreative.dynamicBrowsing.history.index) + 1);
        }


        this.history.setIndex = function(intNewIndex)
        {
            if ((intNewIndex < 0) || (intNewIndex >= ioncreative.dynamicBrowsing.history.url.length))
            {
                return;
            }
            ioncreative.dynamicBrowsing.history.index = intNewIndex;
            ioncreative.dynamicBrowsing.RelativeURL = ioncreative.dynamicBrowsing.history.url[ioncreative.dynamicBrowsing.history.index];
            var strXMLRequest = 
                '<?xml version="1.0" ?>' +
                '<System>' +
                    '<Request type="DYNAMIC-BROWSE">' +
                        '<DynamicBrowse>' +
                            '<URL>' + ioncreative.dynamicBrowsing.RelativeURL + '</URL>' +
                        '</DynamicBrowse>' +
                    '</Request>' +
                '</System>';
            ioncreative.xml.queueRequest('system/', 'VERSION=1&DATA=' + strXMLRequest, ioncreative.dynamicBrowsing.xmlReady);
            var objContent = document.getElementById('ioncreative-Page-Content');
            objContent.innerHTML = 
                'Loading...<br /><br />' +
                '<img src="http://www.ioncreative.co.uk/images/default/loading.gif" alt="Loading..." /><br /><br />' +
                'If your page does not refresh you can click the link below.<br />' +
                '<a href="' + ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL + '">' + ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL + '</a>';
            window.location.hash = '#dynamic-browsing';
            return false;
        }


        this.history.updateDisplay = function()
        {
            if (ioncreative.dynamicBrowsing.history.index == 0)
            {
                ioncreative.dynamicBrowsing.imgBack.style.display = 'none';
                ioncreative.dynamicBrowsing.imgBackDisabled.style.display = '';
            }
            else
            {
                ioncreative.dynamicBrowsing.imgBack.style.display = '';
                ioncreative.dynamicBrowsing.imgBackDisabled.style.display = 'none';
            }
            if (ioncreative.dynamicBrowsing.history.index == (ioncreative.dynamicBrowsing.history.url.length - 1))
            {
                ioncreative.dynamicBrowsing.imgForward.style.display = 'none';
                ioncreative.dynamicBrowsing.imgForwardDisabled.style.display = '';
            }
            else
            {
                ioncreative.dynamicBrowsing.imgForward.style.display = '';
                ioncreative.dynamicBrowsing.imgForwardDisabled.style.display = 'none';
            }
            ioncreative.dynamicBrowsing.sltHistory.options.length = 0;
            for (var intCounter = (ioncreative.dynamicBrowsing.history.url.length - 1); intCounter > -1; intCounter--)
            {
                if (ioncreative.dynamicBrowsing.history.url[intCounter].length > 0)
                {
                    ioncreative.dynamicBrowsing.sltHistory.options[ioncreative.dynamicBrowsing.sltHistory.options.length] = 
                        new Option(
                            ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.history.url[intCounter], 
                            intCounter);
                }
                else
                {
                    ioncreative.dynamicBrowsing.sltHistory.options[ioncreative.dynamicBrowsing.sltHistory.options.length] = 
                        new Option('http://www.ioncreative.co.uk/', intCounter);
                }
                if (intCounter == ioncreative.dynamicBrowsing.history.index)
                {
                    ioncreative.dynamicBrowsing.sltHistory.selectedIndex = (ioncreative.dynamicBrowsing.sltHistory.options.length - 1)
                }
            }
            ioncreative.dynamicBrowsing.divHistory.style.display = '';
            ioncreative.dynamicBrowsing.divHelp.innerHTML = 
                'In order to improve your experience on this website your page is not completely reloading.<br />' +
                'This box allows you to navigate forward and backward in a familiar manner.<br />' +
                'The actual web page address of this page is ' +
                '<a href="' + ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL + '">' + ioncreative.dynamicBrowsing.ROOT_URL + ioncreative.dynamicBrowsing.RelativeURL + '</a>';
            var objBody;
            if (document.body)
            {
                objBody = document.body;
            }
            else
            {
                objBody = document.documentElement;
            }
            objBody.style.marginTop = ioncreative.dynamicBrowsing.divHistory.offsetHeight + 'px';
        }
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.marketing == 'undefined')
{
    ioncreative.marketing = {};

}
/*
var ioncreative = ioncreative || {};
ioncreative.marketing = ioncreative.marketing || {};


if (typeof ioncreative.marketing.livePerson == 'undefined')
{
    ioncreative.marketing.livePerson = {};
    ioncreative.marketing.livePerson.lpNumber = null;


    ioncreative.marketing.livePerson.init = function(strLPNumber)
    {
        ioncreative.marketing.livePerson.lpNumber = strLPNumber;
        var strURL = 'https://server.iad.liveperson.net/hc/' + strLPNumber + '/x.js?cmd=file&amp;file=chatScript3&amp;site=' + strLPNumber;
        ioncreative.scripts.assure(strURL, ioncreative.marketing.livePerson.scriptReady);
    }


    ioncreative.marketing.livePerson.scriptReady = function()
    {
    }

}
*/var ioncreative = ioncreative || {};
ioncreative.marketing = ioncreative.marketing || {};


if (typeof ioncreative.marketing.seo == 'undefined')
{
    ioncreative.marketing.seo = {};

}
var ioncreative = ioncreative || {};
ioncreative.marketing = ioncreative.marketing || {};
ioncreative.marketing.seo = ioncreative.marketing.seo || {};


if (typeof ioncreative.marketing.seo.google == 'undefined')
{
    ioncreative.marketing.seo.google = {};


}
var ioncreative = ioncreative || {};
ioncreative.marketing = ioncreative.marketing || {};
ioncreative.marketing.seo = ioncreative.marketing.seo || {};
ioncreative.marketing.seo.google = ioncreative.marketing.seo.google || {};


if (typeof ioncreative.marketing.seo.google.translate == 'undefined')
{
    ioncreative.marketing.seo.google.translate = {};
    ioncreative.marketing.seo.google.translate.readyAttempts = 0;
    ioncreative.marketing.seo.google.translate.translator = null;


    ioncreative.marketing.seo.google.translate.init = function()
    {
        if (ioncreative.isReady == false)
        {   //WAIT UNTIL THE SITE IS READY
            setTimeout('ioncreative.marketing.seo.google.translate.init();', 500);
            return;
        }
        //https://ssl.google-analytics.com/ga.js
        //http://www.google-analytics.com/ga.js
        var strURL = '';
        if ("https:" == document.location.protocol)
        {
            strURL = 'https';
        }
        else
        {
            strURL = 'http';
        }
        strURL += '://translate.google.com/translate_a/element.js?cb=ioncreative.marketing.seo.google.translate.scriptReady';
        ioncreative.scripts.assure(strURL, ioncreative.marketing.seo.google.translate.scriptReady);
    }


    ioncreative.marketing.seo.google.translate.scriptReady = function()
    {
        var blnReady = true;
        if (typeof(google) != 'object')
        {
            blnReady = false;
        }
        else if (typeof(google.translate) != 'object')
        {
            blnReady = false;
        }
        else if (typeof(google.translate.TranslateElement) != 'function')
        {
            blnReady = false;
        }
        if (!blnReady)
        {
            if (ioncreative.marketing.seo.google.translate.readyAttempts < 20)
            {
                ioncreative.marketing.seo.google.translate.readyAttempts++;
                setTimeout('ioncreative.marketing.seo.google.translate.scriptReady();', 500);
            }
            return;
        }
        ioncreative.marketing.seo.google.translate.translator = new google.translate.TranslateElement({pageLanguage: 'en'}, 'ioncreative-Translator');
    }


}
var ioncreative = ioncreative || {};
ioncreative.marketing = ioncreative.marketing || {};
ioncreative.marketing.seo = ioncreative.marketing.seo || {};
ioncreative.marketing.seo.google = ioncreative.marketing.seo.google || {};


if (typeof ioncreative.marketing.seo.google.urchin == 'undefined')
{

    ioncreative.marketing.seo.google.urchin = {};
    ioncreative.marketing.seo.google.urchin.accountID = '';
    ioncreative.marketing.seo.google.urchin.trackOnSite = false;
    ioncreative.marketing.seo.google.urchin.trackAtGoogle = true;
    ioncreative.marketing.seo.google.urchin.readyAttempts = 0;
    ioncreative.marketing.seo.google.urchin.pageTracker = null;
    ioncreative.marketing.seo.google.urchin.running = false;


    ioncreative.marketing.seo.google.urchin.init = function(strAccountID)
    {
        ioncreative.marketing.seo.google.urchin.accountID = strAccountID;
        ioncreative.marketing.seo.google.urchin._init();
    }
    
    
    ioncreative.marketing.seo.google.urchin._init = function()
    {
        if (ioncreative.isReady == false)
        {   //WAIT UNTIL THE SITE IS READY
            setTimeout('ioncreative.marketing.seo.google.urchin._init();', 500);
            return;
        }
        //https://ssl.google-analytics.com/ga.js
        //http://www.google-analytics.com/ga.js
        var strURL = '';
        if ("https:" == document.location.protocol)
        {
            strURL = 'https://ssl';
        }
        else
        {
            strURL = 'http://www';
        }
        strURL += '.google-analytics.com/ga.js';
        ioncreative.scripts.assure(strURL, ioncreative.marketing.seo.google.urchin.scriptReady);
    }


    ioncreative.marketing.seo.google.urchin.scriptReady = function()
    {
        if (typeof(_gat) != 'object')
        {
            if (ioncreative.marketing.seo.google.urchin.readyAttempts < 20)
            {
                ioncreative.marketing.seo.google.urchin.readyAttempts++;
                setTimeout('ioncreative.marketing.seo.google.urchin.scriptReady();', 500);
            }
            return;
        }
        ioncreative.marketing.seo.google.urchin.pageTracker = _gat._getTracker(ioncreative.marketing.seo.google.urchin.accountID);
        if (ioncreative.marketing.seo.google.urchin.trackLocally == true)
        {
            ioncreative.marketing.seo.google.urchin.pageTracker._setLocalGifPath(ioncreative.rootURL + '');
            if (ioncreative.marketing.seo.google.urchin.trackAtGoogle == true)
            {
                ioncreative.marketing.seo.google.urchin.pageTracker._setLocalRemoteServerMode();
            }
            else
            {
                ioncreative.marketing.seo.google.urchin.pageTracker._setLocalServerMode();
            }
        }
        else
        {
            if (typeof(ioncreative.marketing.seo.google.urchin.pageTracker._setRemoteServerMode) == 'function')
            {
                ioncreative.marketing.seo.google.urchin.pageTracker._setRemoteServerMode();
            }
        }
        ioncreative.marketing.seo.google.urchin.pageTracker._initData();
        ioncreative.marketing.seo.google.urchin.pageTracker._trackPageview();
        ioncreative.marketing.seo.google.urchin.running = true;
    }


}
var ioncreative = ioncreative || {};


if (typeof ioncreative.menus == 'undefined')
{
    ioncreative.menus = {};


    ioncreative.menus.create = function()
    {
        return new ioncreative.menus._create();
    }


    ioncreative.menus._create = function()
    {
        var objMyRef = this;

        this.menuItem = [];
        this.opacity = 0;
        this.cssClassPanel = '';
        this.cssClassTable = '';
        this.cssClassNoMouse = '';
        this.cssClassMouseOver = '';
        this.cssClassMore = '';
        this.menuItemIdPrep = '';
        this.opacityRate = 100;
        this.lingerTime = 1000;
        this.tmrHide;
        this.selectedMenuItem;
        this.tmrFadeIn;


        this.addItem = function(ParentID, NewID, Direction, InnerHTML, MenuImage)
        {
	        var MenuParent;
	        var intIndex;
	        MenuParent = this.getMenuById(ParentID);
	        if (MenuParent)
	        {
                if (!MenuParent.Children)
                {
                    MenuParent.Children = [];
                }
                intIndex = MenuParent.Children.length
                MenuParent.Children[intIndex] = new Object;
                MenuParent.Children[intIndex].ID = NewID;
                MenuParent.Children[intIndex].Direction = Direction;
                MenuParent.Children[intIndex].innerHTML = InnerHTML;
                MenuParent.Children[intIndex].MenuImage = MenuImage;
            }
            else
            {
                intIndex = this.menuItem.length;
                this.menuItem[intIndex] = new Object;
                this.menuItem[intIndex].ID = NewID;
                this.menuItem[intIndex].Direction = Direction;
                this.menuItem[intIndex].innerHTML = InnerHTML;
                this.menuItem[intIndex].MenuImage = MenuImage;
            }
        }


        this.registerItem = function(strID)
        {
	        var objElement = document.getElementById(strID);
	        if (objElement != null)
	        {
		        objElement.onmouseover = function(){objMyRef.renderSubMenu(this);};
		        objElement.onmouseout = function(){objMyRef.registerForRemoval(this);};
		    }
        }


        this.registerForRemoval = function(objHovered)
        {
	        var strID = objHovered.id;
	        if (strID.substring(0, (objMyRef.menuItemIdPrep.length + 3)) == (objMyRef.menuItemIdPrep + '_tr'))
	        {
		        strID = strID.substring((objMyRef.menuItemIdPrep.length + 3), strID.length);
		    }
	        else if (strID.substring(0, objMyRef.menuItemIdPrep.length) == (objMyRef.menuItemIdPrep))
	        {
		        strID = strID.substring((objMyRef.menuItemIdPrep.length), strID.length);
		    }
	        if (objMyRef.selectedMenuItem == strID)
	        {
		        objMyRef.selectedMenuItem = '';
		    }
	        this.tmrHide = setTimeout(function(){objMyRef.removeSubMenus();}, this.lingerTime);
	        var objTR = document.getElementById(objMyRef.menuItemIdPrep + '_tr' + strID);
	        if (objTR != null)
	        {
	            if (objTR.className == objMyRef.cssClassMouseOver)
	            {
		            objTR.className = objMyRef.cssClassNoMouse;
		        }
		    }
        }


        this.removeSubMenus = function(Parent)
        {
	        var intCounter, objMenu, blnKeepMe;
	        blnKeepMe = false;
	        if (typeof(Parent) == 'undefined')
		        for (intCounter = 0; intCounter < this.menuItem.length; intCounter++)
			        this.removeSubMenus(this.menuItem[intCounter]);
	        else
	        {
		        if (typeof(Parent.Children) != 'undefined')
		        {
			        for (intCounter = 0; intCounter < Parent.Children.length; intCounter++)
			        {
				        if (blnKeepMe == true)
				        {
					        this.removeSubMenus(Parent.Children[intCounter]);
					    }
				        else
				        {
					        blnKeepMe = this.removeSubMenus(Parent.Children[intCounter]);
					    }
				    }
			    }
		        if (blnKeepMe == false)
		        {
			        if (Parent.ID == this.selectedMenuItem)
				        return true;
			        else
				        this.removeMenu(this.menuItemIdPrep + '_Panel' + Parent.ID);
		        }
		        else
			        return true;
	        }
	        return false;
        }


        this.removeMenu = function(strID)
        {
	        var objElement = document.getElementById(strID);
	        if (!objElement)
	        {
		        return true;
		    }
		    this.removeElement(objElement);
	        return true;
        }


        this.removeElement = function(objElement)
        {
            while (objElement.lastChild)
            {
                this.removeElement(objElement.lastChild);
            }
		    if (objElement.onmouseover != null)
		    {
		        objElement.onmouseover = null;
		    }
		    if (objElement.onmouseout != null)
		    {
		        objElement.onmouseout = null;
		    }
            if (objElement.clearAttributes)
            {
                objElement.clearAttributes();
            }
	        objElement.parentNode.removeChild(objElement);
	        return true;
        }


        this.fadeIn = function(strID)
        {
	        if(objMyRef.opacity <= 100)
	        {
		        var objRef = document.getElementById(strID);
		        if (typeof(objRef) == 'undefined')
		        {
		            return;
		        }
		        if (objRef == null)
		        {
		            return;
		        }
		        if (typeof(objRef.filters) != 'undefined')
		        {
		            if (typeof(objRef.filters.alpha) != 'undefined')
		            {
		                if (typeof(objRef.filters.alpha.opacity) != 'undefined')
		                {
			                objRef.filters.alpha.opacity = objMyRef.opacity;
			            }
			        }
			    }
		        if (typeof(objRef.style) != 'undefined')
		        {
		            if (typeof(objRef.style.MozOpacity) != 'undefined')
		            {
			            objRef.style.MozOpacity = (objMyRef.opacity / 100);
			        }
		            if (objRef.style.visibility != 'visible')
		            {
			            objRef.style.visibility = 'visible';
			        }
			    }
		        objMyRef.opacity += objMyRef.opacityRate;
		        objMyRef.tmrFadeIn = setTimeout(function(){objMyRef.fadeIn(strID);}, 5);
	        }
	        else
	        {
		        var objRef = document.getElementById(strID);
		        if (typeof(objRef) == 'undefined')
		        {
		            return;
		        }
		        if (objRef == null)
		        {
		            return;
		        }
		        if (typeof(objRef.filters) != 'undefined')
		        {
		            if (typeof(objRef.filters.alpha) != 'undefined')
		            {
		                if (typeof(objRef.filters.alpha.opacity) != 'undefined')
		                {
			                objRef.filters.alpha.opacity = 100;
			            }
			        }
			    }
		        if (typeof(objRef.style) != 'undefined')
		        {
		            if (typeof(objRef.style.MozOpacity) != 'undefined')
		            {
			            objRef.style.MozOpacity = 1;
			        }
		            if (objRef.style.visibility != 'visible')
		            {
			            objRef.style.visibility = 'visible';
			        }
			    }
	        }
        }


        this.renderSubMenu = function(objHovered)
        {
            var objTR;
	        var strID = objHovered.id;
	        if (strID.substring(0, (objMyRef.menuItemIdPrep.length + 3)) == (objMyRef.menuItemIdPrep + '_tr'))
	        {
		        strID = strID.substring((objMyRef.menuItemIdPrep.length + 3), strID.length);
		    }
	        else if (strID.substring(0, objMyRef.menuItemIdPrep.length) == (objMyRef.menuItemIdPrep))
	        {
		        strID = strID.substring((objMyRef.menuItemIdPrep.length), strID.length);
		    }
	        objMyRef.setMenuItemSelected(strID);
	        var MenuParent;
	        MenuParent = objMyRef.getMenuById(strID);
	        this.selectedMenuItem = strID;
	        if (MenuParent == null)
	        {
		        return;
		    }
	        if (typeof(MenuParent.Children) == 'undefined')
	        {
		        return;
		    }
	        if (MenuParent.Children.length == 0)
	        {
		        return;
		    }
	        var objDiv = document.getElementById(objMyRef.menuItemIdPrep + '_Panel' + MenuParent.ID);
	        if (objDiv != null)
	        {
		        objDiv.Selected = true;
		        return true;
	        }
	        var strCursor = 'pointer';
            if (ioncreative.visitor.info.browser.name == 'Internet Explorer')
            {
                if (ioncreative.visitor.info.browser.version.major <= 5)
                {
                    strCursor = 'hand';
                }
            }
	        var intLeft, intTop;
	        if (MenuParent.Direction == 'DOWN')
	        {
	            intLeft = objMyRef.offsetLeft(objHovered);
	            intTop = objMyRef.offsetTop(objHovered) + objHovered.offsetHeight - 1;
	        }
	        else if (MenuParent.Direction == 'DOWN RIGHT')
	        {
	            intLeft = objMyRef.offsetLeft(objHovered) + 15;
	            intTop = objMyRef.offsetTop(objHovered) + 15;
	        }
	        else
	        {
	            intLeft = objMyRef.offsetLeft(objHovered) + objHovered.offsetWidth - 1;
	            intTop = objMyRef.offsetTop(objHovered);
	        }
	        objDiv = document.createElement('div');
	        objDiv.setAttribute('id', objMyRef.menuItemIdPrep + '_Panel' + MenuParent.ID);
    	    objDiv.className = objMyRef.cssClassPanel;
	        objDiv.style.left = intLeft + 'px';
	        objDiv.style.top = intTop + 'px';
	        /*  ALTERED FOR XHTML  */
	        objDiv.style.position = 'absolute';
	        if (typeof(objDiv.style.filter) != 'undefined')
	        {
	            objDiv.style.filter = 'alpha(opacity=0)';
	        }
	        var objTable = document.createElement('table');
	        objTable.setAttribute('id', objMyRef.menuItemIdPrep + '_Table' + MenuParent.ID);
	        //objTable.setAttribute('border', '1');
	        objTable.setAttribute('cellspacing', '0');
	        objTable.setAttribute('cellpadding', '3');
    	    objDiv.className = objMyRef.cssClassTable;
	        objDiv.appendChild(objTable);
	        objDiv.innerHTML += '';
	        document.body.appendChild(objDiv);
	        objTable = document.getElementById(objMyRef.menuItemIdPrep + '_Table' + MenuParent.ID);
	        var intCounter
	        for (intCounter = 0; intCounter < MenuParent.Children.length; intCounter++)
	        {
		        var MenuItem = MenuParent.Children[intCounter];
		        var strID = MenuItem.ID;
		        var objTD;
		        objTR = objTable.insertRow(-1);
		        objTR.setAttribute('id', objMyRef.menuItemIdPrep + '_tr' + strID);
    	        objTR.className = objMyRef.cssClassNoMouse;
                if (typeof(MenuItem.MenuImage) != 'undefined')
                {
		            objTD = document.createElement('td');
		            objTD.style.cursor = strCursor;
		            objTD.innerHTML = MenuItem.MenuImage;
		            objTR.appendChild(objTD);
		        }
		        objTD = document.createElement('td');
		        objTD.style.cursor = strCursor;
		        objTD.innerHTML = MenuItem.innerHTML;
		        objTR.appendChild(objTD);
		        objTD = document.createElement('td');
		        if (typeof(MenuItem.Children) != 'undefined')
		        {
			        if (MenuItem.Children.length > 0)
			        {
    	                objTD.className = objMyRef.cssClassMore;
			        }
			    }
		        objTR.appendChild(objTD);
		        var objTR1 = document.getElementById(objMyRef.menuItemIdPrep + '_tr' + strID);
		        objTR1.onmouseover = function(){objMyRef.renderSubMenu(this);};
		        objTR1.onmouseout = function(){objMyRef.registerForRemoval(this);};
	        }
	        objMyRef.opacity = 0;
	        objMyRef.fadeIn(objMyRef.menuItemIdPrep + '_Panel' + MenuParent.ID);
	        //_db.Setup(objDiv);
        }


        this.getPanelID = function(objTR)
        {
	        if (objTR)
	        {
                if (objTR.offsetParent)
                {
                    if (objTR.offsetParent.offsetParent)
                    {
                        var intLength = (objMyRef.menuItemIdPrep + '_Panel').length;
                        var strParentID = objTR.offsetParent.offsetParent.id;
                        strParentID = strParentID.substring(intLength, strParentID.length);
                        return strParentID;
                    }
                }
            }
            return null;
        }


        this.setMenuItemSelected = function(strID)
        {
	        var objTR = document.getElementById(this.menuItemIdPrep + '_tr' + strID);
	        if (objTR)
	        {
	            if (objTR.className == this.cssClassNoMouse)
	            {
		            var strParentID = this.getPanelID(objTR);
		            if (strParentID)
		            {
                        this.setMenuItemUnSelected(strParentID);
                        this.setMenuItemSelected(strParentID);
                    }
		            objTR.className = this.cssClassMouseOver;
                }
            }
        }


        this.setMenuItemUnSelected = function(strPanelID)
        {
            var MenuParent = this.getMenuById(strPanelID);
            if (MenuParent)
            {
                if (MenuParent.Children)
                {
                    var intCounter;
                    for (intCounter = 0; intCounter < MenuParent.Children.length; intCounter++)
                    {
                        var MenuItem = MenuParent.Children[intCounter];
                        var objTR = document.getElementById(this.menuItemIdPrep + '_tr' + MenuItem.ID);
                        if (objTR)
                        {
                            if (objTR.className == this.cssClassMouseOver)
                            {
                                objTR.className = this.cssClassNoMouse;
                            }
                        }
                    }
                }
            }
        }


        this.getMenuById = function(strID, Parent)
        {
	        var intCounter, objMenu;
	        if (typeof(Parent) == 'undefined')
	        {
		        for (intCounter = 0; intCounter < this.menuItem.length; intCounter++)
		        {
			        if (this.menuItem[intCounter].ID == strID)
			        {
				        return this.menuItem[intCounter];
				    }
			        objMenu = this.getMenuById(strID, this.menuItem[intCounter]);
			        if (objMenu != null)
			        {
				        return objMenu;
				    }
		        }
		    }
	        else
	        {
		        if (typeof(Parent.Children) != 'undefined')
		        {
			        for (intCounter = 0; intCounter < Parent.Children.length; intCounter++)
			        {
				        if (Parent.Children[intCounter].ID == strID)
				        {
					        return Parent.Children[intCounter];
					    }
				        objMenu = this.getMenuById(strID, Parent.Children[intCounter]);
				        if (objMenu != null)
				        {
					        return objMenu;
					    }
			        }
			    }
		    }
	        return null;
        }


        this.offsetLeft = function(objElement)
        {
	        var intOffset;
	        intOffset = 0;
	        if (objElement.offsetParent)
	        {
		        intOffset = this.offsetLeft(objElement.offsetParent);
		    }
	        intOffset = intOffset + objElement.offsetLeft;
	        return intOffset;
        }


        this.offsetTop = function(objElement)
        {
	        var intOffset;
	        intOffset = 0;
	        if (objElement.offsetParent)
	        {
		        intOffset = this.offsetTop(objElement.offsetParent);
		    }
	        intOffset = intOffset + objElement.offsetTop;
	        return intOffset;
        }
        
        
        return this;
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.scripts == 'undefined')
{
    ioncreative.scripts = {};
    ioncreative.scripts.items = [];


    ioncreative.scripts.assure = function(strURL, cbFunction)
    {
        //GET FULL URL
        if (strURL.substr(0, 4).toLowerCase() != "http")
        {
            strURL = ioncreative.rootURL + strURL;
        }
        //ONLY INCLUDE SCRIPT ONCE
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.scripts.items.length; intCounter++)
        {
            if (ioncreative.scripts.items[intCounter].URL.toLowerCase() == strURL.toLowerCase())
            {
                return true;
            }
        }
        //CREATE THE SCRIPT
        var objAdd = {};
        objAdd.URL = strURL;
        objAdd.Script = document.createElement("script");
        objAdd.Script.type = "text/javascript"; 
        objAdd.Script.src = strURL;
        //OPTIONALLY MAKE A CALLBACK
        if (typeof cbFunction != "undefined")
        {
            objAdd.Script.onload = objAdd.Script.onreadystatechange = function()
            {
                if((cbFunction != null) && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete"))
                {
                    done = true;
                    cbFunction();
                    cbFunction = null;
                }
            };
        }
        //ADD SCRIPT TO PAGE
        var objHead = document.getElementsByTagName('head')[0];
        objHead.appendChild(objAdd.Script);
        //ADD TO ARRAY OF LOADED SCRIPTS
        ioncreative.scripts.items[ioncreative.scripts.items.length] = objAdd;
        return true;
    }


}
var ioncreative = ioncreative || {};


if (typeof ioncreative.scrollers == 'undefined')
{
    ioncreative.scrollers = {};
    ioncreative.scrollers._scrollers = [];


    ioncreative.scrollers.start = function()
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.scrollers._scrollers.length; intCounter++)
        {
            ioncreative.scrollers._scrollers[intCounter].start();
        }
    }


    ioncreative.scrollers.stop = function()
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.scrollers._scrollers.length; intCounter++)
        {
            ioncreative.scrollers._scrollers[intCounter].stop();
        }
    }


    ioncreative.scrollers.onMouseOver = function(ID)
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.scrollers._scrollers.length; intCounter++)
        {
            if (ioncreative.scrollers._scrollers[intCounter].ID == ID)
            {
                ioncreative.scrollers._scrollers[intCounter].onMouseOver();
            }
        }
    }


    ioncreative.scrollers.onMouseOut = function(ID)
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.scrollers._scrollers.length; intCounter++)
        {
            if (ioncreative.scrollers._scrollers[intCounter].ID == ID)
            {
                ioncreative.scrollers._scrollers[intCounter].onMouseOut();
            }
        }
    }


    ioncreative.scrollers.create = function(strNewID, strScrollerContainerElementID, intPixels, intInterval, blnHorizontal, strCssClassName, strHTML)
    {
        return new ioncreative.scrollers._create(strNewID, strScrollerContainerElementID, intPixels, intInterval, blnHorizontal, strCssClassName, strHTML);
    }

    ioncreative.scrollers._create = function(strNewID, strScrollerContainerElementID, intPixels, intInterval, blnHorizontal, strCssClassName, strHTML)
    {
        if (typeof(strNewID) == 'undefined')
        {
            return null;
        }

        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.scrollers._scrollers.length; intCounter++)
        {
            if (ioncreative.scrollers._scrollers[intCounter].ID == strNewID)
            {
                return ioncreative.scrollers._scrollers[intCounter];
            }
        }


        var objMyRef = this;

        this.ID = strNewID;
        this.objScrollerContainer = document.getElementById(strScrollerContainerElementID);
        this.cssClassName = strCssClassName;
        this.innerHTML = strHTML;
        this.timerID = 0;

        this.slideA = null;
        this.slideB = null;
        this.shiftPixels = intPixels;
        this.interval = intInterval;
        if (blnHorizontal == true)
        {
            this.orientation = "horizontal";
        }
        else
        {
            this.orientation = "vertical";
        }
        this.actualWidth = 0;
        this.actualHeight = 0;


        switch (this.orientation)
        {
            case "horizontal":
                this.objScrollerContainer.innerHTML = 
                    '<div id="dvScroller' + this.ID + '" align="left" valign="top" class="' + this.cssClassName + '" style="overflow:hidden;position:relative;" onmouseover="ioncreative.scrollers.onMouseOver(\'' + this.ID + '\');" onmouseout="ioncreative.scrollers.onMouseOut(\'' + this.ID + '\');">' +
                        '<table border="0" cellspacing="0" cellpadding="0">' +
                            '<tr>' +
                                '<td id="div_a_' + this.ID + '">' + this.innerHTML + '</td>' +
                                '<td id="div_b_' + this.ID + '">' + this.innerHTML + '</td>' +
                            '</tr>' +
                        '</table>' +
                    '</div>';
                break;
            default: //vertical
                this.objScrollerContainer.innerHTML = 
                    '<div id="dvScroller' + this.ID + '" align="left" valign="top" class="' + this.cssClassName + '" style="overflow:hidden;position:relative;" onmouseover="ioncreative.scrollers.onMouseOver(\'' + this.ID + '\');" onmouseout="ioncreative.scrollers.onMouseOut(\'' + this.ID + '\');">' +
                        '<div id="div_a_' + this.ID + '">' + this.innerHTML + '</div>' +
                        '<div id="div_b_' + this.ID + '">' + this.innerHTML + '</div>' +
                    '</div>';
                break;
        }


        this.objScrollDiv = document.getElementById('dvScroller' + this.ID);
        this.slideA = document.getElementById('div_a_' + this.ID);
        this.slideB = document.getElementById('div_b_' + this.ID);
        this.slideA.style.top = '0px';
        this.slideA.style.left = '0px';
        this.actualWidth = this.slideA.offsetWidth;
        this.actualHeight = this.slideA.offsetHeight;


        this.onMouseOver = function()
        {
            this.stop();
        }
        

        this.onMouseOut = function()
        {
            this.start();
        }


        this.scrollVertical = function()
        {
            objMyRef.actualHeight = objMyRef.slideA.offsetHeight;
            var intNewShift = objMyRef.objScrollDiv.scrollTop + objMyRef.shiftPixels;
            objMyRef.objScrollDiv.scrollTop = intNewShift;
            if (objMyRef.objScrollDiv.scrollTop != intNewShift)
            {
                objMyRef.objScrollDiv.scrollTop = 0;
            }
            else if (objMyRef.objScrollDiv.scrollTop > objMyRef.actualHeight)
            {
                objMyRef.objScrollDiv.scrollTop = -objMyRef.actualHeight;
            }
        }


        this.scrollHorizontal = function()
        {
            objMyRef.actualWidth = objMyRef.slideA.offsetWidth;
            var intNewShift = objMyRef.objScrollDiv.scrollLeft + objMyRef.shiftPixels;
            objMyRef.objScrollDiv.scrollLeft = intNewShift;
            if (objMyRef.objScrollDiv.scrollLeft != intNewShift)
            {
                objMyRef.objScrollDiv.scrollLeft = 0;
            }
            else if (objMyRef.objScrollDiv.scrollLeft >= objMyRef.actualWidth)
            {
                objMyRef.objScrollDiv.scrollLeft = -objMyRef.actualWidth;
            }
        }


        this.stop = function()
        {
            this.timerID = clearInterval(this.timerID);
        }
        

        this.start = function()
        {
            this.timerID = setInterval(this.scrollEvent, this.interval);
        }


        switch (this.orientation)
        {
            case "horizontal":
                this.scrollEvent = this.scrollHorizontal;
                break;
            default: //vertical
                this.scrollEvent = this.scrollVertical;
                break;
        }


        this.start();

        var intIndex = ioncreative.scrollers._scrollers.length;
        ioncreative.scrollers._scrollers[intIndex] = this;
        return this;
    };


}
var ioncreative = ioncreative || {};


if (typeof ioncreative.slideShows == 'undefined')
{
    ioncreative.slideShows = {};
    ioncreative.slideShows._slideShows = [];


    ioncreative.slideShows.start = function()
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.slideShows._slideShows.length; intCounter++)
        {
            ioncreative.slideShows._slideShows[intCounter].start();
        }
    }


    ioncreative.slideShows.pause = function()
    {
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.slideShows._slideShows.length; intCounter++)
        {
            ioncreative.slideShows._slideShows[intCounter].pause();
        }
    }


    ioncreative.slideShows.create = function(strImageID, intSeconds, strTransition, btnStartID, btnStopID, btnPauseID)
    {
        return new ioncreative.slideShows._create(strImageID, intSeconds, strTransition, btnStartID, btnStopID, btnPauseID);
    }


    ioncreative.slideShows._create = function(strImageID, intSeconds, strTransition, btnStartID, btnStopID, btnPauseID)
    {
        var objMyRef = this;

        this.imageElementID = strImageID;
        this.slideInterval = (intSeconds * 1000);
        this.transition = strTransition;
        this.slides = [];
        this.slideIndex = 0;
        this.timerID = 0;
        this.startElementID = btnStartID;
        this.stopElementID = btnStopID;
        this.pauseElementID = btnPauseID;

        var objImage = document.getElementById(this.imageElementID);
        if (objImage)
        {
            objImage.style.display = '';
        }


        this.exists = function()
        {
            if (document.getElementById(this.imageElementID))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        this.addSlide = function(strURL, strText, strLink)
        {
            if (!strText)
            {
                strText = '';
            }
            if (!strLink)
            {
                strLink = '';
            }
            if (strURL)
            {
                var intIndex = this.slides.length;
                this.slides[intIndex] = {};
                this.slides[intIndex].image = new Image();
                this.slides[intIndex].image.src = strURL;
                this.slides[intIndex].text = strText;
                this.slides[intIndex].link = strLink;
            }
        }


        this.start = function()
        {
            var objButton;
            if (this.startElementID)
            {
                objButton = document.getElementById(this.startElementID)
                if (objButton)
                {
                    objButton.style.display = 'none';
                }
            }
            if (this.stopElementID)
            {
                objButton = document.getElementById(this.stopElementID)
                if (objButton)
                {
                    objButton.style.display = '';
                }
            }
            if (this.pauseElementID)
            {
                objButton = document.getElementById(this.pauseElementID)
                if (objButton)
                {
                    objButton.style.display = '';
                }
            }
            this.timerID = setInterval(this.advanceSlide, this.slideInterval);
            return false;
        }


        this.stop = function()
        {
            var objButton;
            if (this.startElementID)
            {
                objButton = document.getElementById(this.startElementID)
                if (objButton)
                {
                    objButton.style.display = '';
                }
            }
            if (this.stopElementID)
            {
                objButton = document.getElementById(this.stopElementID)
                if (objButton)
                {
                    objButton.style.display = 'none';
                }
            }
            if (this.pauseElementID)
            {
                objButton = document.getElementById(this.pauseElementID)
                if (objButton)
                {
                    objButton.style.display = 'none';
                }
            }
            this.timerID = clearInterval(this.timerID);
            this.slideIndex = 0;
            if (this.slides.length > 0)
            {
                if (document.getElementById(this.imageElementID))
                {
                    document.getElementById(this.imageElementID).src = this.slides[this.slideIndex].image.src;
                }
            }
            return false;
        }


        this.pause = function()
        {
            var objButton;
            if (this.startElementID)
            {
                objButton = document.getElementById(this.startElementID)
                if (objButton)
                {
                    objButton.style.display = '';
                }
            }
            if (this.stopElementID)
            {
                objButton = document.getElementById(this.stopElementID)
                if (objButton)
                {
                    objButton.style.display = '';
                }
            }
            if (this.pauseElementID)
            {
                objButton = document.getElementById(this.pauseElementID)
                if (objButton)
                {
                    objButton.style.display = 'none';
                }
            }
            this.timerID = clearInterval(this.timerID)
            return false;
        }


        this.onclick = function()
        {
            if (objMyRef.slides[objMyRef.slideIndex - 1].link.length > 0)
            {
                window.open(objMyRef.slides[objMyRef.slideIndex - 1].link, '_blank');
            }
        }


        this.advanceSlide = function()
        {
            if (!objMyRef.exists())
            {
                objMyRef.stop();
                return;
            }
            if (objMyRef.slideIndex.length == 0)
            {
                return;
            }
            if (objMyRef.slideIndex == objMyRef.slides.length)
            {
                objMyRef.slideIndex = 0;
            }
            var objImg = document.getElementById(objMyRef.imageElementID);
            if (document.all)
            {
                if (typeof(objImg.style.filter) != 'undefined')
                {
                    objImg.style.filter = '';
                    objImg.style.filter = objMyRef.transition;
                    if (typeof(objImg.filters) != 'undefined')
                    {
                        if (typeof(objImg.filters[0]) != 'undefined')
                        {
                            if (typeof(objImg.filters[0].Apply) != 'undefined')
                            {
                                objImg.filters[0].Apply();
                            }
			}
                    }
                }
            }
            if (typeof(objMyRef.slides[objMyRef.slideIndex]) != 'undefined')
            {
                if (typeof(objMyRef.slides[objMyRef.slideIndex].image.src) != 'undefined')
                {
                    objImg.src = objMyRef.slides[objMyRef.slideIndex].image.src;
                    objImg.alt = objMyRef.slides[objMyRef.slideIndex].text;
                    objImg.title = objMyRef.slides[objMyRef.slideIndex].text;
                    objImg.onclick = objMyRef.onclick;
                    if (objMyRef.slides[objMyRef.slideIndex].link.length > 0)
                    {
                        objImg.style.cursor = 'pointer';
                    }
                    else
                    {
                        objImg.style.cursor = 'default';
                    }
                }
            }
            if (typeof(objImg.filters) != 'undefined')
            {
                if (typeof(objImg.filters[0]) != 'undefined')
                {
                    if (typeof(objImg.filters[0].Play) != 'undefined')
                    {
                        objImg.filters[0].Play();
                    }
		}
            }
            objMyRef.slideIndex++;
        }
        var intIndex = ioncreative.slideShows._slideShows.length;
        ioncreative.slideShows._slideShows[intIndex] = this;
        return ioncreative.slideShows._slideShows[intIndex];
    };


}
var ioncreative = ioncreative || {};


if (typeof ioncreative.utility == 'undefined')
{
    ioncreative.utility = {};


    ioncreative.utility.disableAndSubmit = function(objButton)
    {
        objButton.disabled = true;
        var objHiddenField = document.createElement('input');
        objHiddenField.setAttribute('id', 'hidden_postback_' + objButton.id);
        objHiddenField.setAttribute('type', 'hidden');
        objHiddenField.setAttribute('name', objButton.name);
        objHiddenField.setAttribute('value', 'SELECTED');
        if (typeof(objButton.form) != 'undefined')
        {
            if (objButton.form != null)
            {
                objButton.form.appendChild(objHiddenField);
                objButton.form.submit();
                return;
            }
        }
        //window.status = 'No Form Found to Submit';
    }


    ioncreative.utility.disableAndSubmitImage = function(objButton)
    {
        objButton.src = strResellerImagesFolder + "/Working.gif";
        objButton.disabled = true;
        var objHiddenFieldX = document.createElement('input');
        objHiddenFieldX.setAttribute('id', 'hidden_postback_' + objButton.id);
        objHiddenFieldX.setAttribute('type', 'hidden');
        objHiddenFieldX.setAttribute('name', objButton.name + '.x');
        objHiddenFieldX.setAttribute('value', '1');
        var objHiddenFieldY = document.createElement('input');
        objHiddenFieldY.setAttribute('id', 'hidden_postback_' + objButton.id);
        objHiddenFieldY.setAttribute('type', 'hidden');
        objHiddenFieldY.setAttribute('name', objButton.name + '.y');
        objHiddenFieldY.setAttribute('value', '1');
        if (typeof(objButton.form) != 'undefined')
        {
            if (objButton.form != null)
            {
                objButton.form.appendChild(objHiddenFieldX);
                objButton.form.appendChild(objHiddenFieldY);
                objButton.form.submit();
                objButton.src = strResellerImagesFolder + "/Working.gif";
                return;
            }
        }
        //window.status = 'No Form Found to Submit';
    }


    ioncreative.utility.bookmark = function ()
    {
        var strURL = document.location.href;
	    var strTitle = document.title;
	    if (window.sidebar)
	    {   // FIREFOX
		    window.sidebar.addPanel(strTitle, strURL, "");
		    return false;
	    }
	    if (window.external)
	    {   // IE / CHROME
	        if (typeof window.external.AddFavorite != "undefined")
	        {   // IE
		        window.external.AddFavorite(strURL, strTitle);
		        return false;
		    }
	    }
	    if (window.opera)
	    {   // OPERA
            var objA = document.createElement("a");
            objA.setAttribute('rel', 'sidebar');
            objA.setAttribute('title', strTitle);
            objA.setAttribute('href', strURL);
            objA.setAttribute('onclick', 'return false;');
            objA.click();
		    return false;
	    }
	    alert(
	        'We are sorry, but this browser does not support adding bookmarks automatically.\r\n' +
	        'To bookmark this page try Ctrl-D, Ctrl-T, or bookmark manually.');
	    return false;
    }


    ioncreative.utility.executeJavascript = function(strJavascript)
    {
        if (strJavascript.length == 0)
        {
            return;
        }
        else if (typeof(execScript) != 'undefined')
        {   // IE'S METHOD
            execScript(strJavascript); 
        }
        else
        {   // NON-IE
            window.eval(strJavascript); 
        } 
    } 


    ioncreative.utility.seperateHTMLJavascript = function(strOriginalHTML)
    {
        var objOutput = {};
        var strUPPER = strOriginalHTML.toUpperCase();
        objOutput.HTML = '';
        objOutput.Javascript = '';
        var intLastIndex = 0;
        var intScriptStart = strUPPER.indexOf('<SCRIPT');
        var intScriptEnd = 0;
        while (intScriptStart > -1)
        {
            objOutput.HTML += strOriginalHTML.substring(intLastIndex, intScriptStart);
            intScriptStart = strUPPER.indexOf('>', intScriptStart) + 1;
            intScriptEnd = strUPPER.indexOf('</S' + 'CRIPT>', intScriptStart);
            objOutput.Javascript += strOriginalHTML.substring(intScriptStart, intScriptEnd).replace("<!--", "").replace("-->", "");
            intLastIndex = intScriptEnd + 9;
            intScriptStart = strUPPER.indexOf('<S' + 'CRIPT', intLastIndex);
        }
        objOutput.HTML += strOriginalHTML.substring(intLastIndex);
        return objOutput;
    }


    ioncreative.utility.unescapeHTML = function(strHTML)
    {
        var objDIV = document.createElement("div");
        objDIV.innerHTML = strHTML;
        if (objDIV.innerText)
        {   // IE
            return objDIV.innerText;
        }
        else
        {   // NON-IE
            return objDIV.textContent;
        }
    }


    ioncreative.utility.getFixedStyle = function()
    {
        if (ioncreative.visitor.info.browser.name == "Internet Explorer")
        {
            var blnNeedsAbs = false;
            blnNeedsAbs = (ioncreative.visitor.info.browser.version.major < 7)
            if (!blnNeedsAbs)
            {
                if (typeof(document.documentMode) != 'undefined')
                {
                    blnNeedsAbs = (document.documentMode != 8)
                }
            }
            if (blnNeedsAbs)
            {
                return 'absolute';
            }
        }
        return 'fixed';
    }


    ioncreative.utility.stringTrim = function(strIN, strChars)
    {
        var strOUT = backoffice.utility.stringRightTrim(strIN, strChars);
	    strOUT = backoffice.utility.stringLeftTrim(strOUT, strChars);
	    return strOUT;
    }


    ioncreative.utility.stringLeftTrim = function(strIN)
    {
	    return strIN.replace(new RegExp('^[\\s]+', 'g'), '');
    }


    ioncreative.utility.stringRightTrim = function(strIN)
    {
	    return strIN.replace(new RegExp('[\\s]+$', 'g'), '');
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.validator == 'undefined')
{
    ioncreative.validator = {};
    ioncreative.validator.form = {};


    ioncreative.validator.form.fields = function(arrValidate)
    {
        var intLength = arrValidate.length;
        var intCounter;
        for (intCounter = 0; intCounter < intLength; intCounter += 2)
        {
            var objElement = document.getElementById(arrValidate[intCounter + 1]);
            switch (arrValidate[intCounter])
            {
                case 'DROPDOWN':
                    if (!ioncreative.validator.form.dropDown(objElement))
                    {
                        return false;
                    }
                    break;
                case 'EMAIL':
                    if (!ioncreative.validator.form.email(objElement))
                    {
                        return false;
                    }
                    break;
                case 'NUMBER':
                    if (!ioncreative.validator.form.number(objElement))
                    {
                        return false;
                    }
                    break;
                case 'TEXT':
                    if (!ioncreative.validator.form.text(objElement))
                    {
                        return false;
                    }
                    break;
                default:
                    // SHOULD NOT HAPPEN, BUT FORWARD COMPATIBLE
            }
        }
        return true;
    }


    ioncreative.validator.form.dropDown = function(objInput)
    {
	    var strValue = objInput.value + '';
	    if (strValue == 'PLEASE_SELECT')
	    {
		    alert('Please Make Your Selection');
		    objInput.focus();
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }
    

    ioncreative.validator.form.email = function(objInput)
    {
	    if (!ioncreative.validator.email(objInput.value))
	    {
		    alert('Valid Email Address is Required');
		    objInput.focus();
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }


    ioncreative.validator.form.number = function(objInput)
    {
	    if (!ioncreative.validator.number(objInput.value))
	    {
		    alert('Number is Required');
		    objInput.focus();
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }


    ioncreative.validator.form.text = function(objInput)
    {
	    if (!ioncreative.validator.text(objInput.value))
	    {
		    alert('Text is Required');
		    objInput.focus();
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }
    

    ioncreative.validator.email = function(strEmail)
    {
	    strEmail += '';
	    var intAmp = strEmail.indexOf("@");
	    var intDot = strEmail.lastIndexOf(".");
	    if ((intAmp < 1) || ((intDot - intAmp) < 2) || (intDot == (strEmail.length - 1)))
	    {
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }


    ioncreative.validator.number = function(strNumber)
    {
	    strNumber += '';
	    if (isNaN(strNumber))
	    {
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }


    ioncreative.validator.text = function(strText)
    {
	    strText += '';
	    if (strText.length == 0)
	    {
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.visitor == 'undefined')
{
    ioncreative.visitor = {};
    ioncreative.visitor.tmrCheckIn = 0;
    ioncreative.visitor.checkIn_MILLISECONDS = 20 * 1000;    //20 SECONDS


    ioncreative.visitor.init = function()
    {
        ioncreative.visitor.preferences.init();
        ioncreative.visitor.checkInSchedule();
    }


    ioncreative.visitor.shutDown = function()
    {
	    ioncreative.visitor.tmrCheckIn = clearTimeout(ioncreative.visitor.tmrCheckIn);
    }


    ioncreative.visitor.checkInSchedule = function()
    {
	    ioncreative.visitor.tmrCheckIn = setTimeout('ioncreative.visitor.checkIn()', ioncreative.visitor.checkIn_MILLISECONDS);
    }


    ioncreative.visitor.checkIn = function()
    {
        var Now = new Date();   //SOME BROWSERS CACHE PAGES, FORCE A NEW DOWNLOAD
        var strUnique = '' + Now.getFullYear() + Now.getMonth() + Now.getDate() + Now.getHours() + Now.getMinutes() + Now.getSeconds();
        //alert('PAGE=CHECKIN&UNIQUE=' + strUnique);
        var strXMLRequest = '<?xml version="1.0" ?><System><Request type="CHECKIN" /></System>';
        ioncreative.xml.queueRequest('system/', 'UNIQUE=' + strUnique + '&VERSION=1&DATA=' + strXMLRequest, ioncreative.visitor.checkInComplete);
    }


    ioncreative.visitor.checkInComplete = function(objResponse, e)
    {
        if (e != null)
        {
            alert(e.description);
        }
        //alert(objResponse.responseText);
        ioncreative.visitor.checkInSchedule();
    }



}
var ioncreative = ioncreative || {};
ioncreative.visitor = ioncreative.visitor || {};


if (typeof ioncreative.visitor.info == 'undefined')
{
    ioncreative.visitor.info = {};
    ioncreative.visitor.info.userAgent = navigator.userAgent;
    ioncreative.visitor.info.browser = {};
    ioncreative.visitor.info.browser.name = 'Unknown';
    ioncreative.visitor.info.browser.version = {};
    ioncreative.visitor.info.browser.version.major = '0';
    ioncreative.visitor.info.browser.version.minor = '0';
    ioncreative.visitor.info.OS = {};
    ioncreative.visitor.info.OS.name = 'Unknown';
    ioncreative.visitor.info.OS.version = '0';


    ioncreative.visitor.info.parse = function()
    {
        var strUA = ioncreative.visitor.info.userAgent.toLowerCase();
        var intMajor = parseInt(navigator.appVersion);
        var intMinor = parseFloat(navigator.appVersion);
        var intIndex = 0;
        var intIndex2  = 0;
        var strVersion = new Array();
        if  (
                (strUA.indexOf('mozilla') == -1) && (strUA.indexOf('spoofer') != -1) &&
                (strUA.indexOf('compatible') != -1) && (strUA.indexOf('opera') != -1) &&
                (strUA.indexOf('webtv') != -1) && (strUA.indexOf('hotjava') != -1))
        {
            ioncreative.visitor.info.browser.name = 'Spoofed';
            ioncreative.visitor.info.browser.version.major = '0';
            ioncreative.visitor.info.browser.version.minor = '0';
        }
        else if (((strUA.indexOf('msie') != -1) && (strUA.indexOf('opera') == -1)))
        {
            ioncreative.visitor.info.browser.name = 'Internet Explorer';
            intIndex = strUA.indexOf('msie') + 5;
            intIndex2 = strUA.indexOf(';', intIndex);
            strVersion = strUA.substring(intIndex, intIndex2).split('.');
            ioncreative.visitor.info.browser.version.major = strVersion[0];
            ioncreative.visitor.info.browser.version.minor = strVersion[1];
        }
        else if (strUA.indexOf('safari') != -1)
        {
	        if (strUA.indexOf('chrome') != -1)
        	{
	            ioncreative.visitor.info.browser.name = 'Chrome';
        	    intIndex = strUA.indexOf('chrome') + 7;
	            intIndex2 = strUA.indexOf(' ', intIndex);
        	    strVersion = strUA.substring(intIndex, intIndex2).split('.');
	            ioncreative.visitor.info.browser.version.major = strVersion[0];
        	    ioncreative.visitor.info.browser.version.minor = strVersion[1];
	        }
		else
        	{
	            ioncreative.visitor.info.browser.name = 'Safari';
        	    intIndex = strUA.indexOf('safari') + 7;
	            intIndex2 = strUA.indexOf(' ', intIndex);
        	    strVersion = strUA.substring(intIndex, intIndex2).split('.');
	            ioncreative.visitor.info.browser.version.major = strVersion[0];
        	    ioncreative.visitor.info.browser.version.minor = strVersion[1];
	        }
        }
        else if (strUA.indexOf('opera') != -1)
        {
            ioncreative.visitor.info.browser.name = 'Opera';
            intIndex = strUA.indexOf('opera') + 6;
            intIndex2 = strUA.indexOf(' ', intIndex);
            strVersion = strUA.substring(intIndex, intIndex2).split('.');
            ioncreative.visitor.info.browser.version.major = strVersion[0];
            ioncreative.visitor.info.browser.version.minor = strVersion[1];
        }
        else if (strUA.indexOf('aol') != -1)
        {
            ioncreative.visitor.info.browser.name = 'AOL';
            ioncreative.visitor.info.browser.version.major = intMajor;
            ioncreative.visitor.info.browser.version.minor = intMinor;
        }
        else if (strUA.indexOf('webtv') != -1)
        {
            ioncreative.visitor.info.browser.name = 'WebTV';
            ioncreative.visitor.info.browser.version.major = intMajor;
            ioncreative.visitor.info.browser.version.minor = intMinor;
        }
        else if (strUA.indexOf('hotjava') != -1)
        {
            ioncreative.visitor.info.browser.name = 'HotJava';
            ioncreative.visitor.info.browser.version.major = intMajor;
            ioncreative.visitor.info.browser.version.minor = intMinor;
        }
        else if ((strUA.indexOf('navio') != -1) || (strUA.indexOf('navio_aoltv') != -1))
        {
            ioncreative.visitor.info.browser.name = 'TV Navigator';
            ioncreative.visitor.info.browser.version.major = intMajor;
            ioncreative.visitor.info.browser.version.minor = intMinor;
        }
        else if (strUA.indexOf('firefox') != -1)
        {
            ioncreative.visitor.info.browser.name = 'FireFox';
            intIndex = strUA.indexOf('firefox/') + 8;
            strVersion = strUA.substring(intIndex).split('.');
            ioncreative.visitor.info.browser.version.major = strVersion[0];
            ioncreative.visitor.info.browser.version.minor = strVersion[1] + '.' + strVersion[2] + '.' + strVersion[3];
        }
        /*  GET OS INFO */
        if ((strUA.indexOf('windows 3.1') != -1) || (strUA.indexOf('windows 16-bit') != -1))
        {
            if ((strUA.indexOf('win16') != -1) || (strUA.indexOf('16bit') != -1))
            {
                ioncreative.visitor.info.OS.name = 'Windows';
                ioncreative.visitor.info.OS.version = '16bit';
            }
            else
            {
                ioncreative.visitor.info.OS.name = 'Windows';
                ioncreative.visitor.info.OS.version = '32bit';
            }
        }
        else if ((strUA.indexOf('win95') != -1) || (strUA.indexOf('windows 95') != -1))
        {
            ioncreative.visitor.info.OS.name = 'Windows';
            ioncreative.visitor.info.OS.version = '95';
        }
        else if (strUA.indexOf('win 9x 4.90') != -1)
        {
            ioncreative.visitor.info.OS.name = 'Windows';
            ioncreative.visitor.info.OS.version = 'ME';
        }
        else if (strUA.indexOf('windows nt 5.0') != -1)
        {
            ioncreative.visitor.info.OS.name = 'Windows';
            ioncreative.visitor.info.OS.version = '2000';
        }
        else if ((strUA.indexOf('win98') != -1) || (strUA.indexOf('windows 98') != -1))
        {
            ioncreative.visitor.info.OS.name = 'Windows';
            ioncreative.visitor.info.OS.version = '98';
        }
        else if ((strUA.indexOf('winnt') != -1) || (strUA.indexOf('windows nt') != -1))
        {
            ioncreative.visitor.info.OS.name = 'Windows';
            intIndex = strUA.indexOf('winnt');
            if (intIndex == -1)
            {
                intIndex = strUA.indexOf('windows nt') + 11;
            }
            else
            {
                intIndex += 6;
            }
            intIndex2 = strUA.indexOf(';', intIndex);
            strVersion = strUA.substring(intIndex, intIndex2).split('.');
            if (parseInt(strVersion[0]) >= 6)
            {
                ioncreative.visitor.info.OS.version = 'Vista';
            }
            if (parseInt(strVersion[0]) == 5)
            {
                ioncreative.visitor.info.OS.version = 'XP';
            }
            else
            {
                ioncreative.visitor.info.OS.version = 'NT';
            }
        }
        else if ((strUA.indexOf('os/2') != -1) || (navigator.appVersion.indexOf('OS/2') != -1))
        {
            ioncreative.visitor.info.OS.name = 'OS/2';
            ioncreative.visitor.info.OS.version = '0';
        }
        else if ((strUA.indexOf('mac') != -1))
        {
            ioncreative.visitor.info.OS.name = 'MAC';
            if ((strUA.indexOf('68k') != -1) || (strUA.indexOf('68000') != -1))
            {
                ioncreative.visitor.info.OS.version = '68K';
            }
            else if ((strUA.indexOf('ppc') != -1) || (strUA.indexOf('powerpc') != -1))
            {
                ioncreative.visitor.info.OS.version = 'PowerPC';
            }
        }
        else if ((strUA.indexOf('sunos') != -1))
        {
            ioncreative.visitor.info.OS.name = 'SunOS';
            if (strUA.indexOf('sunos 4') != -1)
            {
                ioncreative.visitor.info.OS.version = '4';
            }
            else if (strUA.indexOf('sunos 5') != -1)
            {
                ioncreative.visitor.info.OS.version = '5';
            }
            else if (strUA.indexOf('i86') != -1)
            {
                ioncreative.visitor.info.OS.version = 'i86';
            }
        }
        else if ((strUA.indexOf('irix') != -1))
        {
            ioncreative.visitor.info.OS.name = 'IRIX';
            if (strUA.indexOf('irix 5') != -1)
            {
                ioncreative.visitor.info.OS.version = '5';
            }
            else if ((strUA.indexOf('irix 6') != -1) || (strUA.indexOf('irix6') != -1))
            {
                ioncreative.visitor.info.OS.version = '6';
            }
        }
        else if ((strUA.indexOf('hp-ux') != -1))
        {
            ioncreative.visitor.info.OS.name = 'HP Unix';
            if (strUA.indexOf('09.') != -1)
            {
                ioncreative.visitor.info.OS.version = '9';
            }
            else if (strUA.indexOf('10.') != -1)
            {
                ioncreative.visitor.info.OS.version = '10';
            }
        }
        else if ((strUA.indexOf('aix') != -1))
        {
            ioncreative.visitor.info.OS.name = 'AIX';
            if (strUA.indexOf('aix 1') != -1)
            {
                ioncreative.visitor.info.OS.version = '1';
            }
            else if (strUA.indexOf('aix 2') != -1)
            {
                ioncreative.visitor.info.OS.version = '2';
            }
            else if (strUA.indexOf('aix 3') != -1)
            {
                ioncreative.visitor.info.OS.version = '3';
            }
            else if (strUA.indexOf('aix 4') != -1)
            {
                ioncreative.visitor.info.OS.version = '4';
            }
        }
        else if ((strUA.indexOf('inux') != -1))
        {
            ioncreative.visitor.info.OS.name = 'Linux';
        }
        else if ((strUA.indexOf('sco') != -1) || (strUA.indexOf('unix_sv') != -1))
        {
            ioncreative.visitor.info.OS.name = 'SCO Unix';
        }
        else if (strUA.indexOf('unix_system_v') != -1)
        {
            ioncreative.visitor.info.OS.name = 'Unixware';
        }
        else if (strUA.indexOf('ncr') != -1)
        {
            ioncreative.visitor.info.OS.name = 'MPRAS Unix';
        }
        else if (strUA.indexOf('reliantunix') != -1)
        {
            ioncreative.visitor.info.OS.name = 'Reliant Unix';
        }
        else if (
                    (strUA.indexOf('dec') != -1) ||
                    (strUA.indexOf('osf1') != -1) || 
                    (strUA.indexOf('dec_alpha') != -1) ||
                    (strUA.indexOf('alphaserver') != -1) || 
                    (strUA.indexOf('ultrix') != -1) ||
                    (strUA.indexOf('alphastation') != -1)
                )
        {
            ioncreative.visitor.info.OS.name = 'DEC';
        }
        else if (strUA.indexOf('sinix') != -1)
        {
            ioncreative.visitor.info.OS.name = 'SINIX';
        }
        else if (strUA.indexOf('freebsd') != -1)
        {
            ioncreative.visitor.info.OS.name = 'FreeBSD';
        }
        else if (strUA.indexOf('bsd') != -1)
        {
            ioncreative.visitor.info.OS.name = 'BSD';
        }
        else if ((strUA.indexOf('vax') != -1) || (strUA.indexOf('openvms') != -1))
        {
            ioncreative.visitor.info.OS.name = 'VMS';
        }
    }

    ioncreative.visitor.info.parse();

}
var ioncreative = ioncreative || {};
ioncreative.visitor = ioncreative.visitor || {};


if (typeof ioncreative.visitor.preferences == 'undefined')
{

    ioncreative.visitor.preferences = {};


    ioncreative.visitor.preferences.init = function()
    {
	    ioncreative.visitor.preferences.leftBarVisible(ioncreative.cookies.getCookie("LEFT_BAR_STYLE") != "HIDE");
	    ioncreative.visitor.preferences.rightBarVisible(ioncreative.cookies.getCookie("RIGHT_BAR_STYLE") != "HIDE");
    }


    ioncreative.visitor.preferences.leftBarVisible = function(blnVisible)
    {
        var objLeftBar              = document.getElementById('ioncreative-Left-Bar');
        var objLeftBarHolder        = document.getElementById('ioncreative-Left-Bar-Holder');
        var objLeftBarCollapsible   = document.getElementById('ioncreative-Left-Bar-Collapsible');
        var objLeftBarExpandable    = document.getElementById('ioncreative-Left-Bar-Expandable');
        var strDisplay = '';
        var strExpandable = 'none';
        if (!blnVisible)
        {
            strDisplay = 'none';
            strExpandable = '';
        }
        if (objLeftBar)
        {
            objLeftBar.style.display = strDisplay;
        }
        if (objLeftBarHolder)
        {
            objLeftBarHolder.style.display = strDisplay;
        }
        if (objLeftBarCollapsible)
        {
            objLeftBarCollapsible.style.display = strDisplay;
        }
        if (objLeftBarExpandable)
        {
            objLeftBarExpandable.style.display = strExpandable;
        }
	if (blnVisible)
	{
	    ioncreative.cookies.setCookie("LEFT_BAR_STYLE", "VISIBLE", "1/26/2013 12:02:31 AM");
	}
	else
	{
	    ioncreative.cookies.setCookie("LEFT_BAR_STYLE", "HIDE", "1/26/2013 12:02:31 AM");
	}
    }


    ioncreative.visitor.preferences.toggleLeftBar = function()
    {
        var objLeftBar = document.getElementById('ioncreative-Left-Bar');
        if (objLeftBar)
        {
            var blnVisible = (objLeftBar.style.display == 'none');
            ioncreative.utility.leftBarVisible(blnVisible);
        }
    }


    ioncreative.visitor.preferences.rightBarVisible = function(blnVisible)
    {
        var objRightBar              = document.getElementById('ioncreative-Right-Bar');
        var objRightBarHolder        = document.getElementById('ioncreative-Right-Bar-Holder');
        var objRightBarCollapsible   = document.getElementById('ioncreative-Right-Bar-Collapsible');
        var objRightBarExpandable    = document.getElementById('ioncreative-Right-Bar-Expandable');
        var strDisplay = '';
        var strExpandable = 'none';
        if (!blnVisible)
        {
            strDisplay = 'none';
            strExpandable = '';
        }
        if (objRightBar)
        {
            objRightBar.style.display = strDisplay;
        }
        if (objRightBarHolder)
        {
            objRightBarHolder.style.display = strDisplay;
        }
        if (objRightBarCollapsible)
        {
            objRightBarCollapsible.style.display = strDisplay;
        }
        if (objRightBarExpandable)
        {
            objRightBarExpandable.style.display = strExpandable;
        }
	if (blnVisible)
	{
	    ioncreative.cookies.setCookie("RIGHT_BAR_STYLE", "VISIBLE", "1/26/2013 12:02:31 AM");
	}
	else
	{
	    ioncreative.cookies.setCookie("RIGHT_BAR_STYLE", "HIDE", "1/26/2013 12:02:31 AM");
	}
    }


    ioncreative.visitor.preferences.toggleRightBar = function()
    {
        var objRightBar = document.getElementById('ioncreative-Right-Bar');
        if (objRightBar)
        {
            var blnVisible = (objRightBar.style.display == 'none');
            ioncreative.utility.rightBarVisible(blnVisible);
        }
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.window == 'undefined')
{
    ioncreative.window = {};


    ioncreative.window.create = function(strNewID)
    {
        /*  INIT VARS    */
        var objMyRef = this;

        this.ID = strNewID;
        this.title = strNewID;
        this.cssTitle = 'background-color:#0000ff;color:#ffffff;';

        this.objDiv = null;
        this.objStyle = null;

	    this.blnVisible = false;
	    this.blnDock = false;
	    this.blnDockToMouse = false;
        this.blnMouseHooked = false;

	    this.draggable = false;
        this.blnMouseDown = false;
        this.mouseDownCoords = new Object;
        this.mouseDownCoords.x = 0;
        this.mouseDownCoords.y = 0;
        this.mouseUpCoords = new Object;
        this.mouseUpCoords.x = 0;
        this.mouseUpCoords.y = 0;


	    this.intDockX = 0;
	    this.intDockY = 0;
	    this.x = 0;
	    this.y = 0;
	    this.intWidth = 0;
	    this.intHeight = 0;


        this.windowType = 'Window';
        this.controlBox = true;
        this.innerHTML = '';
        this.outerHTML = '';


        /*  CREATE THE FLOATING DIV WINDOW */
        var objNewDiv = document.getElementById('win_' + strNewID);
        if ((typeof(objNewDiv) == 'undefined') || (objNewDiv == null))
        {
            objNewDiv = document.createElement('div');
            objNewDiv.setAttribute('id', 'win_' + strNewID);
            if (document.body)
            {
                document.body.appendChild(objNewDiv); 
            }
            else
            {
                document.documentElement.appendChild(objNewDiv); 
            }
        }
        /*  INIT SOME SETTINGS */
	    this.objDiv = document.getElementById('win_' + strNewID);
	    this.objDiv.style.visibility = 'hidden';
	    this.objDiv.style.position = 'absolute';


        this.setWindowType = function(NewType)
        {
            switch (NewType)
            {
                case 'Window':
                    this.windowType = NewType;
                    break;
                default:
                    this.windowType = 'HTML';
                    break;
            }
            this.render();
        }


        this.centerScreen = function()
        {
            this.dock
                (
                    ((ioncreative.document.viewPort.width / 2) - (this.objDiv.offsetWidth / 2)),
                    ((ioncreative.document.viewPort.height / 2) - (this.objDiv.offsetHeight / 2))
                );
        }


        this.setPosition = function(x, y)
        {
            this.objDiv.style.left = parseInt(x) + 'px';
            this.objDiv.style.top = parseInt(y) + 'px';
        }


        this.setTitle = function(NewTitle)
        {
            this.title = NewTitle;
            this.render();
        }

        this.setInnerHTML = function(NewHTML)
        {
            this.innerHTML = NewHTML;
            this.render();
        }


        this.setDockToMouse = function(blnDockToMouse, x, y)
        {
            this.blnDockToMouse = blnDockToMouse;
            this.intDockX = x;
            this.intDockY = y;
            this.blnDock = !this.blnDockToMouse;
            if (this.blnDockToMouse)
            {
                this.hookMouse();
            }
            if (!this.blnDockToMouse)
            {
                this.unHookMouse();
            }
            this.setWindowFixed();
        }


        this.render = function()
        {
	        this.outerHTML = '';
	        switch (this.windowType)
	        {
	            case 'Window':
	                this.outerHTML = 
	                    '<table cellspacing="1" cellpadding="0" style="background-color:#000000;color:#ffffff;">' +
	                        '<tr><td colspan="3" style="height:1px;"></td></tr>' +
	                        '<tr valign="top">' +
	                            '<td style="width:1px;"></td>' +
	                            '<td style="height:70%;">' +
	                                '<table border="0" cellspacing="0" cellpadding="0" width="100%" style="background-color:#ffffff;color:#000000;height:100%;">' +
	                                    '<tr id="tr_TitleBar_' + this.ID + '">' +
	                                        '<td>' +
	                                            '<table border="0" cellspacing="0" cellpadding="2" align="right" width="100%" style="' + this.cssTitle + '">';
	                if (this.draggable == true)
	                {
	                    this.outerHTML +=              '<tr style="cursor:pointer;">';
	                }
	                else
	                {
	                    this.outerHTML +=              '<tr>';
	                }
	                this.outerHTML +=
	                                                    '<td id="td_TitleBar_' + this.ID + '">' + this.title + '</td>';
	                                                    if (this.controlBox == true)
	                                                    {
	                                                        this.outerHTML += '<td align="right" style="cursor:pointer;" onclick="var obj = document.getElementById(\'win_' + this.ID + '\');obj.style.visibility = \'hidden\';">X</td>';
	                                                    }
	                this.outerHTML += 
	                                                '</tr>' +
	                                            '</table>' +
	                                        '</td>' +
	                                    '</tr>' +
	                                    '<tr style="height:80%;">' +
	                                        '<td style="height:100%;"><div id="render_' + this.ID + '">' + this.innerHTML + '</div></td>' +
	                                    '</tr>' +
	                                '</table>' +
	                            '</td>' +
	                            '<td style="width:1px;"></td>' +
	                        '</tr>' +
	                        '<tr><td colspan="3" style="height:1px;"></td></tr>' +
	                    '</table>';
	                break;
	            default:   //HTML ONLY
	                this.outerHTML = '<div id="render_' + this.ID + '">' + this.innerHTML + '</div>';
	                break;
	        }
	        this.objDiv.innerHTML = this.outerHTML;
	        var objTmp = document.getElementById('td_TitleBar_' + this.ID);
	        if (objTmp)
	        {
		        if (typeof(objTmp) != 'undefined')
		        {
		    	        if (typeof(objTmp.onmousedown) != 'undefined')
	        		    {
			                objTmp.onmousedown = this.onMouseDown;
				    }
		    	        if (typeof(objTmp.onmouseup) != 'undefined')
	        		    {
			                objTmp.onmouseup = this.onMouseUp;
	        		    }
		        }
		    }
        }
     

        /*  CREATE FUNCTIONS    */
	    this.show = function()
	    {
	        this.blnVisible = true;
	        this.objDiv.style.visibility = 'visible';
	        this.render();
            if ((this.blnDock) || (this.blnDockToMouse))
            {
                this.hookMouse();
            }
	    }


	    this.hide = function()
	    {
	        this.blnVisible  = false;
	        this.objDiv.style.visibility = 'hidden';
            if (this.blnDock)
            {
                this.unHookMouse();
            }
	    }


        this.dock = function(x, y)
        {
            this.blnDock = true;
            this.blnDockToMouse = false;
            this.intDockX = x;
            this.intDockY = y;
            this.objDiv.style.left = x + 'px';
            this.objDiv.style.top = y + 'px';
            this.setWindowFixed();
        }


        this.unDock = function()
        {
            this.blnDock = false;
            this.blnDockToMouse = false;
            if ((ioncreative.visitor.info.browser.name == "Internet Explorer") && (ioncreative.visitor.info.browser.version.major < 7))
            {
                if (this.blnVisible)
                {
                    this.unHookMouse();
                }
            }
            else
            {
    	        this.objDiv.style.position = 'absolute';
            }
        }


        this.setWindowFixed = function()
        {
            var strFixed = ioncreative.utility.getFixedStyle();
            this.objDiv.style.position = strFixed;
            if (strFixed == 'absolute')
            {
                if (this.blnVisible)
                {
                    this.hookMouse();
                }
            }
        }
        

        this.hookMouse = function()
        {
            if (!this.blnMouseHooked)
            {
                ioncreative.document.addMouseListener(this.mouseCoordsChanged, this.onMouseMove, this.onMouseDown, this.onMouseUp);
            }
            this.blnMouseHooked = true;
        }
        

        this.unHookMouse = function()
        {
            if (this.blnMouseHooked)
            {
                ioncreative.document.removeMouseListener(objMyRef.mouseCoordsChanged);
            }
            this.blnMouseHooked = false;
        }


        this.onMouseUp = function(intButton)
        {
            var BUTTON_NONE = 0;
            var BUTTON_LEFT = 1;
            var BUTTON_RIGHT = 2;
            var BUTTON_MIDDLE = 4;
            if (typeof(intButton) != 'number')
            {
                intButton = BUTTON_LEFT;
            }
            if (intButton == BUTTON_LEFT)
            {
                objMyRef.blnMouseDown = false;
            }
        }


        this.onMouseDown = function(intButton)
        {
            var BUTTON_NONE = 0;
            var BUTTON_LEFT = 1;
            var BUTTON_RIGHT = 2;
            var BUTTON_MIDDLE = 4;
            if (objMyRef.draggable == true)
            {
                if (typeof(intButton) != 'number')
                {
                    intButton = BUTTON_LEFT;
                }
                if (intButton == BUTTON_LEFT)
                {
                    var intWidth, intHeight;
                    var objTitleBar = document.getElementById('tr_TitleBar_' + objMyRef.ID);
                    if (objTitleBar)
                    {
                        objMyRef.x = parseInt(objMyRef.objDiv.style.left) + parseInt(objTitleBar.offsetLeft);
                        objMyRef.y = parseInt(objMyRef.objDiv.style.top) + parseInt(objTitleBar.offsetTop);
                        intWidth = objTitleBar.offsetWidth;
                        intHeight = objTitleBar.offsetHeight;
                        objMyRef.mouseDownCoords.x = objBrowser.MouseCoords.x;
                        objMyRef.mouseDownCoords.y = objBrowser.MouseCoords.y;
                        if 
                            (
                                (objMyRef.mouseDownCoords.x >= objMyRef.x) && (objMyRef.mouseDownCoords.x <= (objMyRef.x + intWidth)) &&
                                (objMyRef.mouseDownCoords.y >= objMyRef.y) && (objMyRef.mouseDownCoords.y <= (objMyRef.y + intHeight))
                            )
                        {
                            objMyRef.blnMouseDown = true;
                        }
                    }
                }
            }
        }


        this.onMouseMove = function(e, X, Y)
        {
            if (objMyRef.blnMouseDown)
            {
                objMyRef.mouseUpCoords.x = X;
                objMyRef.mouseUpCoords.y = Y;
                objMyRef.objDiv.style.left = (objMyRef.x + (objMyRef.mouseUpCoords.x - objMyRef.mouseDownCoords.x)) + 'px';
                objMyRef.objDiv.style.top = (objMyRef.y + (objMyRef.mouseUpCoords.y - objMyRef.mouseDownCoords.y)) + 'px';
            }
        }
        

        this.mouseCoordsChanged = function(MouseCoords, ScrollCoords, PageCoords, ViewPort)
        {
            if ((objMyRef.objDiv.style.position == 'absolute') || (objMyRef.objDiv.style.position == 'fixed'))
            {
                if (objMyRef.blnDock == true)
                {
                    objMyRef.objDiv.style.left = (ScrollCoords.x + objMyRef.intDockX) + 'px';
                    objMyRef.objDiv.style.top = (ScrollCoords.y + objMyRef.intDockY) + 'px';
                }
                else if (objMyRef.blnDockToMouse == true)
                {
                    if ((PageCoords.x + objMyRef.intDockX + objMyRef.objDiv.offsetWidth) <= (ScrollCoords.x + ViewPort.width))
                    {
                        objMyRef.objDiv.style.left = (PageCoords.x + objMyRef.intDockX) + 'px';
                    }
                    else
                    {
                        objMyRef.objDiv.style.left = ((ScrollCoords.x + ViewPort.width) - objMyRef.objDiv.offsetWidth) + 'px';
                    }
                    if ((PageCoords.y + objMyRef.intDockY + objMyRef.objDiv.offsetHeight) <= (ScrollCoords.y + ViewPort.height))
                    {
                        objMyRef.objDiv.style.top = (PageCoords.y + objMyRef.intDockY) + 'px';
                    }
                    else
                    {
                        objMyRef.objDiv.style.top = ((ScrollCoords.y + ViewPort.height) - objMyRef.objDiv.offsetHeight) + 'px';
                    }
                }
            }
            else if (objMyRef.blnDockToMouse == true)
            {
                if ((MouseCoords.x + objMyRef.intDockX + objMyRef.objDiv.offsetWidth) <= ViewPort.width)
                {
                    objMyRef.objDiv.style.left = (MouseCoords.x + objMyRef.intDockX) + 'px';
                }
                else
                {
                    objMyRef.objDiv.style.left = (ViewPort.width - objMyRef.objDiv.offsetWidth) + 'px';
                }
                if ((MouseCoords.y + objMyRef.intDockY + objMyRef.objDiv.offsetHeight) <= ViewPort.height)
                {
                    objMyRef.objDiv.style.top = (MouseCoords.y + objMyRef.intDockY) + 'px';
                }
                else
                {
                    objMyRef.objDiv.style.top = (ViewPort.height - objMyRef.objDiv.offsetHeight) + 'px';
                }
            }
        }
        return this;
    }

}
var ioncreative = ioncreative || {};


if (typeof ioncreative.xml == 'undefined')
{
    ioncreative.xml = {};
    ioncreative.xml.BASE_URL = '';
    ioncreative.xml.queue = [];
    ioncreative.xml.queueWorker = null;


    ioncreative.xml.init = function(strBaseURL)
    {
        ioncreative.xml.BASE_URL = strBaseURL;
        ioncreative.xml.checkQueue();
    }

    ioncreative.xml.queueRequest = function(strURL, strPost, fnCallBack)
    {
        var intIndex = ioncreative.xml.queue.length;
        ioncreative.xml.queue[intIndex] = {};
        ioncreative.xml.queue[intIndex].url = strURL;
        ioncreative.xml.queue[intIndex].post = strPost;
        ioncreative.xml.queue[intIndex].callBackFunction = fnCallBack;
        if (ioncreative.isReady == true)
        {
            ioncreative.xml.checkQueue();
        }
    }


    ioncreative.xml.checkQueue = function()
    {
        if ((ioncreative.xml.queueWorker == null) && (ioncreative.xml.queue.length > 0))
        {
            var strURL = ioncreative.xml.BASE_URL + ioncreative.xml.queue[0].url;
            var strPost = ioncreative.xml.queue[0].post;
            if (window.XMLHttpRequest)
            {
                ioncreative.xml.queueWorker = new XMLHttpRequest();
            }
            else if (window.ActiveXObject)
            {
                ioncreative.xml.queueWorker = new ActiveXObject("Microsoft.XMLHTTP");
            }
            if (ioncreative.xml.queueWorker)
            {
                try
                {
                    ioncreative.xml.queueWorker.onreadystatechange = ioncreative.xml.processReqChange;
                    ioncreative.xml.queueWorker.open("POST", strURL, true);
                    ioncreative.xml.queueWorker.setRequestHeader("Cache-Control", "no-cache");
                    ioncreative.xml.queueWorker.setRequestHeader("Pragma", "no-cache");
                    ioncreative.xml.queueWorker.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    ioncreative.xml.queueWorker.send(strPost);
                }
                catch (e)
                {
                    if (typeof(ioncreative.xml.queue[0].callBackFunction) != 'undefined')
                    {
                        if (ioncreative.xml.queue[0].callBackFunction != null)
                        {
                            ioncreative.xml.queue[0].callBackFunction(null, e);
                        }
                    }
                    ioncreative.xml.queue.splice(0, 1);
                    ioncreative.xml.queueWorker = null;
                    ioncreative.xml.checkQueue();
                }
            }
        }
    }


    ioncreative.xml.processReqChange = function()
    {
        var intReadyState = 0;
        if (typeof(ioncreative.xml.queueWorker) == 'undefined')
        {
            intReadyState = 4;
        }
        else if (ioncreative.xml.queueWorker == null)
        {
            intReadyState = 4;
        }
        else if (typeof(ioncreative.xml.queueWorker.readyState) == 'undefined')
        {
            intReadyState = 4;
        }
        else if (ioncreative.xml.queueWorker.readyState)
        {
            intReadyState = ioncreative.xml.queueWorker.readyState;
        }
        else
        {
            intReadyState = 4;
        }
        if (intReadyState == 4)
        {
            if (ioncreative.xml.queue.length > 0)
            {
                if (typeof(ioncreative.xml.queue[0].callBackFunction) != 'undefined')
                {
                    if (ioncreative.xml.queue[0].callBackFunction != null)
                    {
                        ioncreative.xml.queue[0].callBackFunction(ioncreative.xml.queueWorker, null);
                        //ioncreative.xml.queueWorker.responseXML
                        //ioncreative.xml.queueWorker.responseText
                        //ioncreative.xml.queueWorker.status
                        //ioncreative.xml.queueWorker.statusText);
                    }
                }
                ioncreative.xml.queue.splice(0, 1);
                ioncreative.xml.queueWorker = null;
            }
        }
        ioncreative.xml.checkQueue();
    }


}

/******************************************************

  FIX XML PARSERS WITHOUT selectNodes and selectSingleNode

******************************************************/
if (document.implementation.hasFeature("XPath", "3.0"))
{

    if (typeof(XMLDocument) == 'undefined')
    {   //OPERA FIX
        XMLDocument = Document;
    }



    XMLDocument.prototype.selectNodes = function(strXPath, objParent)
    {
        if (!objParent)
        {
            objParent = this;
        }
        var objEval = this;
        if (typeof(XPathEvaluator) == 'function')
        {
            objEval = new XPathEvaluator();
        }
        var objNameSpace = objEval.createNSResolver(this.documentElement);
        var arrItems = objEval.evaluate(strXPath, objParent, objNameSpace, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
        var arrReturn = new Array();
        var intCounter;
        for (intCounter = 0; intCounter < arrItems.snapshotLength; intCounter++)
        {
            arrReturn[intCounter] =  arrItems.snapshotItem(intCounter);
        }
        return arrReturn;
    }

    Element.prototype.selectNodes = function(strXPath)
    {
        if (this.ownerDocument.selectNodes)
        {
            return this.ownerDocument.selectNodes(strXPath, this);
        }
        return null;
    }


    XMLDocument.prototype.selectSingleNode = function(strXPath, objParent)
    {
        if (!objParent)
        {
            objParent = this;
        } 
        var arrItems = this.selectNodes(strXPath, objParent);
        if( arrItems.length > 0 )
        {
            return arrItems[0];
        }
        return null;
    }

    Element.prototype.selectSingleNode = function(strXPath)
    {	
        if(this.ownerDocument.selectSingleNode)
        {
            return this.ownerDocument.selectSingleNode(strXPath, this);
        }
        return null;
    }
  
}
var ioncreative = ioncreative || {};


if (typeof ioncreative.document == 'undefined')
{
    ioncreative.document = {};
    ioncreative.document.MouseListeners = [];
    ioncreative.document.OnLoad = [];
    ioncreative.document.BeforeUnload = [];
    ioncreative.document.IsUnloading = false;

    ioncreative.document.rightClickImageEnabled = true;
    ioncreative.document.rightClickEnabled = true;
    ioncreative.document.leftClickEnabled = true;

    ioncreative.document.mouseCoords = {};
    ioncreative.document.mouseCoords.x = 0;
    ioncreative.document.mouseCoords.y = 0;
    ioncreative.document.pageCoords = {};
    ioncreative.document.pageCoords.x = 0;
    ioncreative.document.pageCoords.y = 0;
    ioncreative.document.scrollCoords = {};
    ioncreative.document.scrollCoords.x = 0;
    ioncreative.document.scrollCoords.y = 0;
    ioncreative.document.viewPort = {};
    ioncreative.document.viewPort.width = 0;
    ioncreative.document.viewPort.height = 0;


	ioncreative.document.bubbleOnMouseMove = document.onmousemove;
	ioncreative.document.bubbleOnScroll = window.onscroll;
	ioncreative.document.bubbleOnResize = window.onresize;
	ioncreative.document.bubbleOnMouseDown = window.onmousedown;
	ioncreative.document.bubbleOnMouseUp = window.onmouseup;
	ioncreative.document.bubbleOnBeforeUnload = window.onbeforeunload;



    ioncreative.document.addMouseListener = function(onCoordsChange, onMouseMove, onMouseDown, onMouseUp)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        var intIndex = ioncreative.document.MouseListeners.length;
        ioncreative.document.MouseListeners[intIndex] = {};
        ioncreative.document.MouseListeners[intIndex].onCoordsChange = onCoordsChange;
        ioncreative.document.MouseListeners[intIndex].onMouseMove = onMouseMove;
        ioncreative.document.MouseListeners[intIndex].onMouseDown = onMouseDown;
        ioncreative.document.MouseListeners[intIndex].onMouseUp = onMouseUp;
        ioncreative.document.MouseListeners[intIndex].onCoordsChange(
                ioncreative.document.mouseCoords, 
                ioncreative.document.scrollCoords, 
                ioncreative.document.pageCoords, 
                ioncreative.document.viewPort);
    }


    ioncreative.document.removeMouseListener = function(onCoordsChange)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.MouseListeners.length; intCounter++)
        {
            if (ioncreative.document.MouseListeners[intCounter].onCoordsChange == onCoordsChange)
            {
                ioncreative.document.MouseListeners.splice(intCounter);
                return;
            }
        }
    }


    ioncreative.document.addOnLoad = function(onLoad)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        if (typeof(onLoad) == 'function')
        {
            var intIndex = ioncreative.document.OnLoad.length;
            ioncreative.document.OnLoad[intIndex] = onLoad;
        }
    }


    ioncreative.document.removeOnLoad = function(onLoad)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.OnLoad.length; intCounter++)
        {
            if (ioncreative.document.OnLoad[intCounter] == onLoad)
            {
                ioncreative.document.OnLoad.splice(intCounter);
                return;
            }
        }
    }


    ioncreative.document.addBeforeUnload = function(beforeUnload)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        if (typeof(beforeUnload) == 'function')
        {
            var intIndex = ioncreative.document.BeforeUnload.length;
            ioncreative.document.BeforeUnload[intIndex] = beforeUnload;
        }
    }


    ioncreative.document.removeBeforeUnload = function(beforeUnload)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.BeforeUnload.length; intCounter++)
        {
            if (ioncreative.document.BeforeUnload[intCounter] == beforeUnload)
            {
                ioncreative.document.BeforeUnload.splice(intCounter);
                return;
            }
        }
    }


    ioncreative.document.recalculateViewPort = function()
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        ioncreative.document.viewPort.width = ioncreative.document.offsetWidth();
        ioncreative.document.viewPort.height = ioncreative.document.offsetHeight();
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.MouseListeners.length; intCounter++)
        {
            if (ioncreative.document.MouseListeners[intCounter].onCoordsChange)
            {
                ioncreative.document.MouseListeners[intCounter].onCoordsChange(
                    ioncreative.document.mouseCoords, 
                    ioncreative.document.scrollCoords, 
                    ioncreative.document.pageCoords, 
                    ioncreative.document.viewPort);
            }
        }
//        window.status =
//            'Coords: ' + ioncreative.document.mouseCoords.x + ' x ' + ioncreative.document.mouseCoords.y + ' | ' +
//            'Scroll: ' + ioncreative.document.scrollCoords.x + ' x ' + ioncreative.document.scrollCoords.y + ' | ' +
//            'Page: ' + ioncreative.document.pageCoords.x + ' x ' + ioncreative.document.pageCoords.y + ' | ' +
//            'View: ' + ioncreative.document.viewPort.width + ' x ' + ioncreative.document.viewPort.height;
    }


    ioncreative.document.offsetWidth = function()
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return 0;
        }
        var SCROLLER_WIDTH = 20;
        if (ioncreative.visitor.info.browser.name == 'Internet Explorer')
        {
            SCROLLER_WIDTH = 0;
        }
        if (typeof(window.innerWidth) != 'undefined')
        {
            return (window.innerWidth - SCROLLER_WIDTH);
        }
        else if (typeof(document.documentElement.offsetWidth) != 'undefined')
        {
            return (document.documentElement.offsetWidth - SCROLLER_WIDTH);
        }
        else if (typeof(document.body.offsetWidth) != 'undefined')
        {
            return (document.body.offsetWidth - SCROLLER_WIDTH);
        }
	    else
	    {
	        return 0;
	    }
    }


    ioncreative.document.offsetHeight = function()
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return 0;
        }
        var SCROLLER_HEIGHT = 20;
        if (ioncreative.visitor.info.browser.name == 'Internet Explorer')
        {
            SCROLLER_HEIGHT = 0;
        }
        if (typeof(window.innerHeight) != 'undefined')
        {
            return (window.innerHeight - SCROLLER_HEIGHT);
        }
        else if (typeof(document.documentElement.offsetHeight) != 'undefined')
        {
            return (document.documentElement.offsetHeight - SCROLLER_HEIGHT);
        }
        else if (typeof(document.body.offsetHeight) != 'undefined')
        {
            return (document.body.offsetHeight - SCROLLER_HEIGHT);
        }
        else
        {
            return 0;
        }
    }


    ioncreative.document.scrollLeft = function()
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return 0;
        }
        if (typeof(window.pageXOffset) != 'undefined')
        {
            return window.pageXOffset;
        }
        if (typeof(document.body) != 'undefined')
        {
            if (document.body != null)
            {
                if (typeof(document.body.scrollLeft) != 'undefined')
                {
                    if (parseInt(document.body.scrollLeft) != 0)
                    {
                        return document.body.scrollLeft;
                    }
                }
            }
        }
        if (typeof(document.documentElement) != 'undefined')
        {
            if (typeof(document.documentElement.scrollLeft) != 'undefined')
            {
                return document.documentElement.scrollLeft;
            }
        }
        return 0;
    }



    ioncreative.document.scrollTop = function()
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return 0;
        }
        if (typeof(window.pageYOffset) != 'undefined')
        {
            return window.pageYOffset;
        }
        if (typeof(document.body) != 'undefined')
        {
            if (document.body != null)
            {
                if (typeof(document.body.scrollTop) != 'undefined')
                {
                    if (parseInt(document.body.scrollTop) != 0)
                    {
                        return document.body.scrollTop;
                    }
                }
            }
        }
        if (typeof(document.documentElement) != 'undefined')
        {
            if (typeof(document.documentElement.scrollTop) != 'undefined')
            {
                return document.documentElement.scrollTop;
            }
        }
        return 0;
    }


    ioncreative.document.onMouseMove = function(e)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        var objEvent = e;
	    if (!objEvent)
	    {
	        var objEvent = window.event;
	    }
        ioncreative.document.mouseCoords.x = 0;
        ioncreative.document.mouseCoords.y = 0;
	    if (objEvent)
	    {
	        if (typeof(objEvent.clientX) != 'undefined')
	        {
		        ioncreative.document.mouseCoords.x = objEvent.clientX;
		        ioncreative.document.mouseCoords.y = objEvent.clientY;
	        }
	        else if (typeof(objEvent.pageX) != 'undefined')
	        {
		        ioncreative.document.mouseCoords.x = objEvent.pageX;
		        ioncreative.document.mouseCoords.y = objEvent.pageY;
	        }
            ioncreative.document.pageCoords.x = (ioncreative.document.mouseCoords.x + ioncreative.document.scrollLeft());
            ioncreative.document.pageCoords.y = (ioncreative.document.mouseCoords.y + ioncreative.document.scrollTop());
	    }
        ioncreative.document.recalculateViewPort();
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.MouseListeners.length; intCounter++)
        {
            if (ioncreative.document.MouseListeners[intCounter].onMouseMove)
            {
	            if (typeof(objEvent.clientX) != 'undefined')
	            {
                    ioncreative.document.MouseListeners[intCounter].onMouseMove(objEvent, objEvent.clientX, objEvent.clientY);
	            }
	            else if (typeof(objEvent.pageX) != 'undefined')
	            {
                    ioncreative.document.MouseListeners[intCounter].onMouseMove(objEvent, objEvent.pageX, objEvent.pageY);
	            }
            }
        }
        if (ioncreative.document.bubbleOnMouseMove)
        {
            ioncreative.document.bubbleOnMouseMove();
        }
    }


    ioncreative.document.onScroll = function()
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        ioncreative.document.scrollCoords.x = ioncreative.document.scrollLeft();
        ioncreative.document.scrollCoords.y = ioncreative.document.scrollTop();
        ioncreative.document.pageCoords.x = (ioncreative.document.mouseCoords.x + ioncreative.document.scrollCoords.x);
        ioncreative.document.pageCoords.y = (ioncreative.document.mouseCoords.y + ioncreative.document.scrollCoords.y);
        ioncreative.document.recalculateViewPort();
        if (ioncreative.document.bubbleOnScroll)
        {
            ioncreative.document.bubbleOnScroll();
        }
    }


    ioncreative.document.onResize = function()
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        ioncreative.document.scrollCoords.x = ioncreative.document.scrollLeft();
        ioncreative.document.scrollCoords.y = ioncreative.document.scrollTop();
        ioncreative.document.pageCoords.x = (ioncreative.document.mouseCoords.x + ioncreative.document.scrollCoords.x);
        ioncreative.document.pageCoords.y = (ioncreative.document.mouseCoords.y + ioncreative.document.scrollCoords.y);
        ioncreative.document.recalculateViewPort();
        if (ioncreative.document.bubbleOnResize)
        {
            ioncreative.document.bubbleOnResize();
        }
    }


    ioncreative.document.onMouseUp = function(e)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        var BUTTON_NONE = 0;
        var BUTTON_LEFT = 1;
        var BUTTON_RIGHT = 2;
        var BUTTON_MIDDLE = 4;
        var intButton = 0;
        var objEvent;
        if (e)
        {
	        switch (e.which)
	        {
	            case 1:
	                intButton = BUTTON_LEFT;
	                break;
	            case 2:
	                intButton = BUTTON_MIDDLE
	                break;
	            case 3:
	                intButton = BUTTON_RIGHT;
	                break;
	            default: //0
	                intButton = BUTTON_NONE;
	                break;
	        }
            objEvent = e;
        }
        else
        {
            objEvent = window.event;
	        intButton = objEvent.button;
	        if (intButton == 0)
	        {
	            intButton = BUTTON_RIGHT;
	        }
        }
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.MouseListeners.length; intCounter++)
        {
            if (ioncreative.document.MouseListeners[intCounter].onMouseUp)
            {
                ioncreative.document.MouseListeners[intCounter].onMouseUp(intButton);
            }
        }
        if (ioncreative.document.bubbleOnMouseUp)
        {
            ioncreative.document.bubbleOnMouseUp(objEvent);
        }
    }


    ioncreative.document.onMouseDown = function(e)
    {
        if (ioncreative.document.IsUnloading == true)
        {
            return false;
        }
        var BUTTON_NONE = 0;
        var BUTTON_LEFT = 1;
        var BUTTON_RIGHT = 2;
        var BUTTON_MIDDLE = 4;
        var intButton = 0;
        var blnSuppress = false;
	    if (e)
	    {
	        switch (e.which)
	        {
	            case 1:
	                intButton = BUTTON_LEFT;
	                break;
	            case 2:
	                intButton = BUTTON_MIDDLE
	                break;
	            case 3:
	                intButton = BUTTON_RIGHT;
	                break;
	            default: //0
	                intButton = BUTTON_NONE;
	                break;
	        }
	    }
	    else
	    {
	        intButton = event.button;
	        if (intButton == 0)
	        {
	            intButton = BUTTON_RIGHT;
	        }
	    }
        if (intButton == BUTTON_RIGHT)
        {
            if (ioncreative.document.rightClickEnabled != true) 
            {
                blnSuppress = true;
            }
            if (ioncreative.document.rightClickImageEnabled != true) 
            {
                var objEvent, objElement;
                if (e)
                {
                    objEvent = e;
                }
                else
                {
                    objEvent = window.event;
                }
                if (objEvent.target)
                {
                    objElement = objEvent.target;
                }
                else if (objEvent.srcElement)
                {
                    objElement = objEvent.srcElement;
                }
                if (objElement)
                {
                    if (objElement.nodeType == 3)
                    {
                        objElement = objElement.parentNode;
                    }
                    if (objElement.tagName == 'IMG')
                    {
                        blnSuppress = true;
                    }
                }
                else
                {
                    blnSuppress = true;
                }
            }
        }
        else if (intButton == BUTTON_LEFT)
        {
            if (ioncreative.document.leftClickEnabled != true)
            {
                blnSuppress = true;
            }
        }
        if (ioncreative.document.bubbleOnMouseDown)
        {
            ioncreative.document.bubbleOnMouseDown();
        }
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.MouseListeners.length; intCounter++)
        {
            if (ioncreative.document.MouseListeners[intCounter].onMouseDown)
            {
                ioncreative.document.MouseListeners[intCounter].onMouseDown(intButton);
            }
        }
        if (blnSuppress == true)
        {
            if (typeof(event) != 'undefined')
            {
                event.returnValue = false;
            }
            return false;
        }
        else
        {
            return true;
        }
    }


    ioncreative.document.onLoad = function(e)
    {
        /*  ELIMINATE PERMISSION DENIED EXCEPTION  */
        var objEvent;
        if (e)
        {
            objEvent = e;
        }
        else
        {
            objEvent = window.event;
        }
        ioncreative.document.IsUnloading = false;
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.OnLoad.length; intCounter++)
        {
            ioncreative.document.OnLoad[intCounter]();
        }
    }


    ioncreative.document.onBeforeUnload = function(e)
    {
        /*  ELIMINATE PERMISSION DENIED EXCEPTION  */
        var objEvent;
        if (e)
        {
            objEvent = e;
        }
        else
        {
            objEvent = window.event;
        }
        ioncreative.document.IsUnloading = true;
        var intCounter;
        for (intCounter = 0; intCounter < ioncreative.document.BeforeUnload.length; intCounter++)
        {
            ioncreative.document.BeforeUnload[intCounter]();
        }
        if (ioncreative.document.bubbleOnBeforeUnload)
        {
            ioncreative.document.bubbleOnBeforeUnload(objEvent);
        }
    }


    ioncreative.document.searchParameters = function()
    {
        var arrParameters = new Array;
        var strQueryString = window.location.search;
        if (!strQueryString)
        {
            return { toString: function() { return ""; } };
        }
        strQueryString = decodeURI(strQueryString.substring(1));
        var pairs = strQueryString.split("&");
        for (var intCounter = 0; intCounter < pairs.length; intCounter++)
        {
            if (!pairs[intCounter])
            {
                continue;
            }
            var intIndex = pairs[intCounter].indexOf("=");
            if (intIndex == -1)
            {
                arrParameters[pairs[intCounter]] = "";
            }
            else
            {
                arrParameters[pairs[intCounter].substring(0, intIndex)] = pairs[intCounter].substr(intIndex + 1);
            }
        }
        arrParameters.toString = function()
        {
            return "?" + strQueryString;
        };
        return arrParameters;
    }



    ioncreative.document.recalculateViewPort();
    ioncreative.document.addOnLoad(window.onload);


    window.onload = ioncreative.document.onLoad;
    document.onmousemove = ioncreative.document.onMouseMove;
    window.onscroll = ioncreative.document.onScroll;
    window.onresize = ioncreative.document.onResize;
    if (document.layers)
    {
        document.captureEvents(Event.MOUSEDOWN);
    }
    document.onmousedown = ioncreative.document.onMouseDown;
	document.onmouseup = ioncreative.document.onMouseUp;
	document.oncontextmenu = ioncreative.document.onMouseDown;
	window.onbeforeunload = ioncreative.document.onBeforeUnload;
	
	
}
ioncreative.init();
/*
Author:		Peakey Enterprise LLC
Designer:		Randall Hankins
Copyright:		Peakey Enterprise LLC 2010	All Rights Reserved
Created:		2004-10-23
Last Modified:	2010-02-26

Copyright 2010 Peakey Enterprise LLC
All Rights Reserved
*//*   JAVASCRIPT GENERATED [1/26/2012 12:02:31 AM]   */
