// set this global var if on a secure page for ajax calls
var PG_use_https;
/**
 *  Add user favorite
 *   ajax call to add a user favorite (merchant or brand)
 */ 
function addUserFavorite(user_id, preference_id_type, preference_id, element_id, element_class, element_content, callback)
{

	// if no user id is given, then load the login overlay bubble
	if (!user_id) {
		user_id = util.readCookie('bake_userid');

		// this hack is for IE6 only.... we saved the userid in document.login cuz it cant read cookies well
		if (!user_id && document.login && document.login.loginSuccessUserid) {
			user_id = document.login.loginSuccessUserid;
		}
		// end IE6 hack
		
		if (!user_id) {
			if (document.login) {
				// set login success callback
				// (try adding to favorites again, once login is successful)
				document.login.loginSuccessCallback = function () { addUserFavorite('', preference_id_type, preference_id, element_id, element_class, element_content, callback); };
			}

                        callbackfuncafterlogin = "addUserFavorite('"+(user_id?user_id:"")+"','"+preference_id_type+"','"+preference_id+"','"+element_id+"','"+element_class+"','"+(element_content?element_content:"")+"','"+(callback?callback:"")+"');";
                        //Tracking from where we require user login/registration
                        if (preference_id_type == 'vendor') refer_page = 'Add Brand to Favs';
                        if (preference_id_type == 'merchant') refer_page = 'Add Merchant to Favs';
                        
                        iframe_login('login_registration', callbackfuncafterlogin, refer_page);
			return;
		}
	}

	if (!user_id) {
		return false;
	}
	
//	console.log('addUserFavorite ' + user_id + ' - ' + preference_id_type + ' - ' + preference_id);
	var ajax = new AjaxRequest('GET', '/ajax.php', true, 3000);
	ajax.setParameter('action', 'addUserFavorite');
	ajax.setParameter('user_id', user_id);
	ajax.setParameter('preference_id_type', preference_id_type);
	ajax.setParameter('preference_id', preference_id);
	ajax.setParameter('element_id', element_id);
	ajax.setParameter('element_class', element_class);
	if (element_content) {
		ajax.setParameter('element_content', element_content);
	}
	
	// lame secure hack
	if (PG_use_https) {
		ajax.setParameter('secure', 1);
	}

	if (callback) {
		ajax.setCallback(callback);
	}
	else {
	    ajax.setCallback(addUserFavoriteResponse);
	}
	ajax.send();
}

/**
 * default ajax response after adding user favorite
 */ 
function addUserFavoriteResponse(xml)
{
	// get json
    var data = eval('(' + xml.getElementsByTagName('json')[0].firstChild.nodeValue + ')');

	if (!data['success']) {
		return false;
	}    
	
    if (data['element_id']) {
	    em = document.getElementById(data['element_id']);
	    if (data['element_class']) {
		    em.className = data['element_class'];
		}
	    em.innerHTML = data['message'];
	}

	// update browse favorite stores/brands link if its on the page
	// todo: this should be moved elsewhere
	var store_link = document.getElementById('browse_favorite_stores_link');
	if (store_link && data['preference_id_type'] == "merchant") {
		// update count
		stores_link_count_em = document.getElementById('favorite_stores_count');
		var count = parseInt(stores_link_count_em.innerHTML);
		count++;
		stores_link_count_em.innerHTML = count;
		// update href link
		store_link.href += '/retid[]=' + data['preference_id'];
	}
	var brands_link = document.getElementById('browse_favorite_brands_link');
	if (brands_link && data['preference_id_type'] == "vendor") {
		// update count
		brands_link_count_em = document.getElementById('favorite_brands_count');
		var count = parseInt(brands_link_count_em.innerHTML);
		count++;
		brands_link_count_em.innerHTML = count;
		// update href link
		brands_link.href += '/vendorIds[]=' + data['preference_id'];
	}
        
}

/**
 *	delete a user preference/favorite
 */ 
function deleteUserPreference(user_preference_id, preference_id_type, element_id, callback)
{
	user_id = util.readCookie('bake_userid');

	if (!user_id) {
		LoginOverlay_login();
		return;
	}

	var ajax = new AjaxRequest('GET', '/ajax.php', true, 3000);
	ajax.setParameter('action', 'deleteUserFavorite');
	ajax.setParameter('user_id', user_id);
	ajax.setParameter('secure', 1);
	ajax.setParameter('user_preference_id', user_preference_id);
	ajax.setParameter('preference_id_type', preference_id_type);
	ajax.setParameter('element_id', element_id);
    ajax.setCallback(callback);
	ajax.send();
}

// functions related to login popup to load the external JS files required to handle it
function LoginOverlay_login() {
        if(!loginLoaded) {
                var s2 = document.createElement('script'); s2.src = login_pop_script;
                document.body.appendChild(s2);
        }
        if(!ajaxLoaded) {
                var s1 = document.createElement('script'); s1.src = login_pop_ajax;
                document.body.appendChild(s1);
        }
        LoginOverlay_waitForLoad();
}
function LoginOverlay_waitForLoad() {
        if(!loginLoaded) {
                if (window.login_js) {
                        loginLoaded = 1;
                        ShowLoginMessage('<img src="'+login_pop_wait+'" width=16 height=16>',login_pop_msg,'#666666');}
                else {
                        setTimeout('LoginOverlay_waitForLoad("");',200);
                        return 0;
                }
        }
        if(!ajaxLoaded) {
                if(window.ajax) {
                        ajaxLoaded = 1;
                }
                else {
                        setTimeout('LoginOverlay_waitForLoad("");',200);
                        return 0;
                }
        }
        if (ajaxLoaded && loginLoaded) {
                showLoginBubble();
        }
}
function newsletterSend(email,referral, margin){
    ajax = new AjaxRequest('GET', '/newsletter_landing.php', true, 3000);
    ajax.setCallback( newsletterCallback );
    ajax.setParameter('temp_newsletter_req', 'yes');
    ajax.setParameter('email', email);
    ajax.setParameter('referral', referral);
    if (margin != '') {
        ajax.setParameter('margin', margin);
    }
    ajax.send();

}

function newsletterCallback(XmlResp){
	if(!XmlResp) {
		return false;
	}
	else {
        var result = XmlResp.getElementsByTagName("result")[0].firstChild.nodeValue;
		var message = XmlResp.getElementsByTagName("message")[0].firstChild.nodeValue;
        try {
            var margin = XmlResp.getElementsByTagName("margin")[0].firstChild.nodeValue;
        } catch(err) {}
       // alert('callback'+result)
        newsletter_overlay(message,result,margin);
        
    }
}


function isValidEmail(emailStr) {
    emailStr = emailStr.replace(/^\s*|\s*$/g,'');
    var emailPat=/^(.+)@(.+)$/;
    var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
    var validChars="\[^\\s" + specialChars + "\]";
    var quotedUser="(\"[^\"]*\")";
    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
    var atom=validChars + '+';
    var word="(" + atom + "|" + quotedUser + ")";
    var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
    var matchArray=emailStr.match(emailPat);
    if (matchArray==null) {
        return false;
    }
    var user=matchArray[1];
    var domain=matchArray[2];
    if (user.match(userPat)==null) {
        return false;
    }
    var IPArray=domain.match(ipDomainPat);
    if (IPArray!=null) {
        for (var i=1;i<=4;i++) {
            if (IPArray[i]>255) {
                return false;
            }
        }
        return true;
    }
    var domainArray=domain.match(domainPat);
    if (domainArray==null) {
        return false;
    }
    var atomPat=new RegExp(atom,"g");
    var domArr=domain.match(atomPat);
    var len=domArr.length;
    if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>4) {
        return false;
    }
    if (len<2) {
        return false;
    }
    return true;
}

function newsletter_overlay(show,result,margin){
    var browser=navigator.appName;
    switch (browser) {
        case 'Microsoft Internet Explorer':
          var IE = 1;
        break;
        
        default:
           var IE = 0;
        break;   
    }
    
    var nws = document.getElementById('getProd_newsletter');
    if (document.getElementById('newsletter_overlay')==null) {
        var news = document.createElement('div');
        news.setAttribute('id', 'newsletter_overlay'); 
        if (margin != null) news.style.margin = margin;
        nws.appendChild(news);
    }  
   
    var news_over = document.getElementById('newsletter_overlay');
    
        switch(result){
                case 'ok':
                    if (document.getElementById('news_div')!=null) news_over.removeChild(news_over.childNodes[0]);
                   
                    var over = document.createElement('div');
                    if (IE) over.setAttribute('className','vcenter');
                    else over.setAttribute('class','vcenter'); 
                    
                    over.setAttribute('id', 'news_div');
                    news_over.appendChild(over);
                    
                    var p_append_1 = document.createElement('p');
                    var p_append_2 = document.createElement('p');
                    if (IE) p_append_1.setAttribute('className', 'valid');
                    else p_append_1.setAttribute('class', 'valid');
                    p_append_1.innerHTML = 'Thanks for signing up!';
                    p_append_2.innerHTML = 'We\'ve sent you a confirmation email<br>Just click the link inside, and you\'re all set.';
                    over.appendChild(p_append_1);
                    over.appendChild(p_append_2);
                    
                break;
                
                case 'fail':
                    if (document.getElementById('news_div')!=null) news_over.removeChild(news_over.childNodes[0]);
                    
                        var over = document.createElement('div');
                        if (IE) over.setAttribute('className','vcenter');
                        else over.setAttribute('class','vcenter');
                        over.setAttribute('id', 'news_div');
                        news_over.appendChild(over);
                        
                        
                        var p_append_1 = document.createElement('p');
                        var p_append_2 = document.createElement('p');
                        if (IE) p_append_1.setAttribute('className', 'error');
                        else p_append_1.setAttribute('class', 'error');
                        p_append_1.innerHTML = show;
                        over.appendChild(p_append_1);
                        over.appendChild(p_append_2);
                        
                        var p_append_2_a = document.createElement('a');
                        if (IE) p_append_2_a.setAttribute('className', 'greenemailBtn');
                        else p_append_2_a.setAttribute('class', 'greenemailBtn');
                        p_append_2_a.setAttribute('href', 'javascript:void(0)');
                        p_append_2_a.onclick = new Function( "return hide_overlay_focus();" );
                        p_append_2.appendChild(p_append_2_a);
                        
                        var p_append_2_a_span = document.createElement('span');
                        p_append_2_a_span.innerHTML = 'Try Again';
                        p_append_2_a.appendChild(p_append_2_a_span);
                    
                    break;
                    
                    case 'signed':
                        if (document.getElementById('news_div')!=null) news_over.removeChild(news_over.childNodes[0]);
                    
                        var over = document.createElement('div');
                        if (IE) over.setAttribute('className','vcenter_subscribed');
                        else over.setAttribute('class','vcenter_subscribed');
                        over.setAttribute('id', 'news_div');
                        news_over.appendChild(over);
                        
                        
                        var p_append_1 = document.createElement('p');
                        var p_append_2 = document.createElement('p');
                        var p_append_3 = document.createElement('p');
                        var p_append_4 = document.createElement('p');
                        if (IE) p_append_1.setAttribute('className', 'error');
                        else p_append_1.setAttribute('class', 'error');
                        if (IE) p_append_4.setAttribute('className', 'small');
                        else p_append_4.setAttribute('class', 'small');
                        if (IE) p_append_3.setAttribute('className', 'signed');
                        else p_append_3.setAttribute('class', 'signed');
                        if (IE) p_append_2.setAttribute('className', 'signed');
                        else p_append_2.setAttribute('class', 'signed');
                        p_append_1.innerHTML = 'Whoops! You\'re already subscribed!';
                        p_append_2.innerHTML = 'Please check your spam folder, and add <b>email-alerts@pricegrabber.com</b> to your address book.';
                        p_append_4.innerHTML = '<b>Still having problems?</b> ';
                        
                        
                        
                        var p_append_3_a = document.createElement('a');
                        
                        if (IE) p_append_3_a.setAttribute('className', 'greenemailBtn');
                        else p_append_3_a.setAttribute('class', 'greenemailBtn');
                        p_append_3_a.setAttribute('href', '');
                        p_append_3_a.onclick = new Function( "return hide_overlay_focus();" );
                        p_append_3.appendChild(p_append_3_a);
                        
                        var p_append_3_a_span = document.createElement('span');
                        p_append_3_a_span.innerHTML = 'Try Again';
                        p_append_3_a.appendChild(p_append_3_a_span);
                    
                        var p_append_4_a = document.createElement('a');
                        p_append_4_a.setAttribute('href', 'mailto:email-alerts@pricegrabber.com');
                        p_append_4_a.innerHTML = 'Send us an email';
                        
                        p_append_4.appendChild(p_append_4_a);
                        
                        over.appendChild(p_append_1);
                        over.appendChild(p_append_2);
                        over.appendChild(p_append_3);
                        over.appendChild(p_append_4);
                    break;
                
        }
        news_over.style.zIndex = 6;
        news_over.style.display = 'block';
        setTimeout('hide_overlay()', 4000);
    }
    
function hide_overlay_focus(){
    var shim = document.getElementById('newsletter_overlay');
    if (shim.style.display!='none') {
        shim.style.zIndex = 0;
        shim.style.display='none';
        var email = document.getElementById('email');
        email.focus();
        return false;
    }
}

function hide_overlay(){
    var shim = document.getElementById('newsletter_overlay');
    if (shim.style.display!='none') {
        shim.style.zIndex = 0;
        shim.style.display='none';
        return false;
    }
}


function newsletter() {
    var email = document.getElementById('email');
    if (email.value == 'your email address') email.value='';
    email.style.color = '#444';
}

function newsletter_submit(referral, margin) {
    var email = document.getElementById('email');
    if (!isValidEmail(email.value)) {
        var message = "<b>Whoops!</b> Please type a valid email address.";
        newsletter_overlay(message,'fail',margin);
    } else {
        newsletterSend(email.value, referral, margin);
    }
}

/**
 *
 * $Id: util.js 63843 2009-02-09 23:15:05Z kchiu $
 * $Author: kchiu $
 * $Revision: 63843 $
 * $Name$
 * $Date: 2009-02-09 15:15:05 -0800 (Mon, 09 Feb 2009) $
 *
 * @package     PriceGrabber
 * @category    JavaScript
 *
 * @author      Philip Snyder <philip@pricegrabber.com>
 * @copyright   Copyright &copy; 2006 2007, Philip Snyder, PriceGrabber.com
 * @version     $Revision: 63843 $
 *
 * @todo        Finish documentation.
 */

/**
 * Checks the object to see if it implements a certain function.
 *
 * @access public
 * @since  v1.1
 * @param  string   funcName   Name of function to check for
 * @return boolean
 */



/**
 * Generates an xml string representation of the object.
 *
 * @access public
 * @since  v1.1
 * @param  string   tagname   Tag name to use for the object
 * @return string
 */
/*
Object.prototype.simpleXmlify = function(tagname) {
    var xml = "<"+tagname;
    for (var prop in this) {
        if (!(this[prop] instanceof Function)) {
            xml += " "+prop+"=\""+this[prop]+"\"";
        }
    }
    xml += "/>";
    return xml;
}
*/


/**
 * Finds the index of a value in the array or returns false if not found.
 *
 * @acccess public
 * @since   v1.1
 * @param   mixed val     Value to search array for
 * @return  int | false
 */
Array.prototype.inArray = function(val) {
    for (var i=0; i<this.length; i++) {
        if (this[i] == val) return i;
    }
    return false;
}
// Remove object helper methods from array
Array.prototype.simpleXmlify   = null;
// Remove object helper methods from Error
Error.prototype.simpleXmlify   = null;






/**
 * Generalize namespace for utility functions
 *
 * @access public
 * @since  v1.1
 */
var util = new Object;






/**
 * Manages image cacheing
 *
 * @todo   Confirm this image cacheing scheme works in IE & FF via fiddler
 *
 * @access public
 * @since  v1.1
 */
util.resourceManager = {

    cache: new Array,

    index: new Array,

    /**
     * Handles cacheing and returns the image src of a url.
     * 
     * @access public
     * @since  v1.1
     * @param  string   url
     * @return Image.src
     */ 
    get: function(url) {
        var ptr = util.resourceManager.index.inArray(url);
        if (ptr === false) {
            ptr                                 = util.resourceManager.index.length;
            util.resourceManager.index[ptr]     = url;
            util.resourceManager.cache[ptr]     = new Image;
            util.resourceManager.cache[ptr].src = url;
        }
        return util.resourceManager.cache[ptr].src;
    }
    
};



/**
 * This function returns the name of a given function.
 *
 * It does this by converting the function to a string,
 * then using a regular expression to extract the
 * function name from the resulting code.
 *
 * @access public
 * @since  v1.1
 * @param  Function  f
 * @return string
 */
function funcname(f) {
    var matches = f.toString().match(/function (\w*)/);
    if ((matches == null) || (matches.length == 0)) return "anonymous";
    if (matches.length == 2) return matches[1];
    else return matches.join(',');
}

/**
 * This function returns a string that contains a "stack trace".
 *
 * @access public
 * @since  v1.1
 * @return string
 */
function stacktrace() {
    var s = "";  // This is the string we'll return.
    // Loop through the stack of functions, using the caller property of
    // one arguments object to refer to the next arguments object on the
    // stack.
    for (var a=arguments.caller; a!=null; a=a.caller) {
        // Add the name of the current function to the return value.
        s += funcname(a.callee) + "\n";
        // Because of a bug in Navigator 4.0, we need this line to break.
        // a.caller will equal a rather than null when we reach the end 
        // of the stack. The following line works around this.
        if (a.caller == a) break;
    }
    return s;
}















/***** BEGIN MESSAGE QUEUE *******/




util.MessageQueue = function(type) {
    this.queued = new Array;
    this.containerId = 'message';
    this.type = type || util.MessageQueue.types.ALL;
    this.queueId = util.MessageQueue.queues.length;
    this.waitingForResponse = false;
    util.MessageQueue.queues[this.queueId] = this;
    return this;
};

util.MessageQueue.settings = {
    timer:     null,
    interval:  5, // in seconds
    immediate: true
};

util.MessageQueue.types  = { NONE:0, ERROR:1, DEBUG:2, USER:4, ALL:7 };
util.MessageQueue.queues = [];


util.MessageQueue.attach = function(queue) {
    if (!util.MessageQueue.queues.inArray(queue)) {
        util.MessageQueue.queues.push(queue);
    }
    return true;
}

util.MessageQueue.detach = function(queue) {
    var retain = [];
    var found  = false;
    while (util.MessageQueue.queues.length) {
        var queuePop = util.MessageQueue.queues.pop();
        if (queue !== queuePop) retain.push(queuePop);
        else                    found = queuePop;
    }
    util.MessageQueue.queues = retain;
    return found;
}


util.MessageQueue.prototype.add = function(obj, test) {
    //alert('util.MessageQueue.add called: '+obj.title+' -> '+obj.content);
    test = test === false ? false : true;
    test = true;
    if ((test && this.isMessage(obj)) || !test) {
        //alert(obj);
        this.queued.push(obj);
        //alert(this.queued.toString());
    }
    if (util.MessageQueue.settings.immediate) this.renderNext();
}

util.MessageQueue.prototype.isMessage = function(obj) {
    return obj.implementsProp('title') && obj.implementsProp('content') && obj.implementsProp('type');
} 

util.MessageQueue.prototype.render = function(type) {
    if (this.queued.length > 0) {
        var body = document.getElementsByTagName('body')[0];
        if (body) {
            var types = util.MessageQueue.types;
            type = type <= types.ALL ? type : types.ALL;
            var messages = new Array;
            if (type == types.ALL) {
                messages = this.queued;
                this.queued = new Array;
            } else {
                var retain = new Array;
                for (var i=0; i<this.queued.length; i++) {
                    var msg = this.queued[i];
                    if (msg.type == type) {
                        messages.push(msg);
                    } else {
                        retain.push(msg);
                    }
                }
                this.queued = retain;
            }
            if (!this.container) {
                this.container = document.createElement('div');
                this.container.className = 'messageContainer';
                body.appendChild(this.container);
            }
            for (var i=0; i<messages.length; i++) {
                var mesg = messages[i];
                mesg.displayHandler();
            }
        }
    }
}









util.MessageQueue.prototype.renderNext = function(force) {
    force = force || false;
    if (force) {
        this.waitingForResponse = false;
        clearInterval(this.renderNextTimeout);
        this.renderNextTimeout = null;
    }
    if (this.queued.length > 0) {
        if (!this.waitingForResponse) {
            //Assert.warn('util.MessageQueue.renderNext:displaying from queue '+this.queueId+', queue length = '+this.queued.length);
            var body = document.getElementsByTagName('body')[0];
            if (!body) throw new Error('Unable to find body element');
            var message = null;
            var queueHead = new Array;
            do {
                message = this.queued.shift();
                //Assert.warn('util.MessageQueue.renderNext:shift message type = '+message.type);
                if (message.type != this.type && this.type != util.MessageQueue.types.ALL) {
                    //Assert.warn('util.MessageQueue.renderNext:not all queue, not our message type');
                    queueHead.push(message);
                    message = null;
                }
            } while (!message && this.queued.length > 0);
            while (queueHead.length > 0) {
                this.queued.unshift(queueHead.shift());
            }
            if (message) {
                this.waitingForResponse = true;
                message.displayHandler();
            }
        } else if (!this.renderNextTimer) {
            //Assert.warn('util.MessageQueue.renderNext:setting renderNext timer -- '+this.queued.length+' messages remain');
            this.renderNextTimer = setInterval('util.MessageQueue.queues['+this.queueId+'].renderNext()', 1000);
        }
    }
}




window.messageQueue = new util.MessageQueue(util.MessageQueue.types.ALL);


/***** END MESSAGE QUEUE *******/

















/***** COOKIE MANAGEMENT *****/

/**
 * Creates a cookie via javascript
 *
 * @since  1.1.2.8
 * @access public
 * @param  string    name
 * @param  string    value
 * @param  int       ttl      Time to live, in seconds - defaults to session [optional]
 * @param  string    path     [optional]
 * @param  string    domain   [optional]
 * @param  boolean   secure   [optional]
 * @return void
 */
util.createCookie = function createCookie(name,value) {
    // Support optional arguments
    var argv    = arguments;
    var argc    = arguments.length;
    var ttl     = (argc > 2) ? argv[2]*1000 : null;
    var path    = (argc > 3) ? argv[3]      : null;
    var domain  = (argc > 4) ? argv[4]      : null;
    var secure  = (argc > 5) ? argv[5]      : false;
    // If we have a ttl to work with, calculate the expires
    if (ttl) {
        var expires = new Date();
        expires.setTime(expires.getTime()+ttl);
    }
    // Create the actual cookie
    document.cookie = name + "=" + escape (value) + 
                      ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
                      ((path    == null) ? "" : ("; path=" + path)) + 
                      ((domain  == null) ? "" : ("; domain=" + domain)) + 
                      ((secure  == true) ? "; secure" : "");
}

/**
 * Returns the value of a cookie
 * 
 * @since  1.1.2.8
 * @access public
 * @param  string    name
 * @return string
 */
util.readCookie = function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length,c.length));
    }
    return null;
}

/**
 * Removes a cookie
 *
 * @since  1.1.2.8
 * @access public
 * @param  string    name
 * @return void
 */
util.eraseCookie = function eraseCookie(name) {
    util.createCookie(name,"",-1);
}





var RecentComparisonHistory = new Object;
RecentComparisonHistory.data = new Array;


RecentComparisonHistory.settings = {
    cookieName: 'RecentComparisonHistory',
    cookieHost: '.pricegrabber.com',
    pageTitle: null,
    langId: null,
    tokens: {
        pages:     ',',
        attrs:     ':',
        masterIds: {
            pre:   'all{',
            split: ';',
            post:  '}'
        }
    }
};


RecentComparisonHistory.createCookie = function() {
    var pages = new Array();
    for (var i=0; i<RecentComparisonHistory.data.length; i++) {
        var attrs = new Array();
        var page  = RecentComparisonHistory.data[i];
        attrs[0] = page.pageId;
        attrs[1] = page.title;
        attrs[2] = page.langId;
        attrs[3] = page.lastModified;
        var pre  = RecentComparisonHistory.settings.tokens.masterIds.pre;
        var post = RecentComparisonHistory.settings.tokens.masterIds.post;
        attrs[4] = pre+page.masterIds.join(RecentComparisonHistory.settings.tokens.masterIds.split)+post;
        pages[i] = attrs.join(RecentComparisonHistory.settings.tokens.attrs);
    }
    var cookieVal = pages.join(RecentComparisonHistory.settings.tokens.pages);
    util.createCookie(RecentComparisonHistory.settings.cookieName, cookieVal, null, '/', RecentComparisonHistory.settings.cookieHost);

}

RecentComparisonHistory.parseCookie = function() {
    var cookieVal = util.readCookie(RecentComparisonHistory.settings.cookieName);
    if (cookieVal) {
        //alert(cookieVal);
        var pages = cookieVal.split(RecentComparisonHistory.settings.tokens.pages);
        for (var i=0; i<pages.length; i++) {
            var pageStr = pages[i];
            var attrs = pageStr.split(RecentComparisonHistory.settings.tokens.attrs);
            var pageIds = attrs[4].substring(RecentComparisonHistory.settings.tokens.masterIds.pre.length,
                                             attrs[4].length - RecentComparisonHistory.settings.tokens.masterIds.post.length);
            var page = {
                pageId:       attrs[0],
                title:        attrs[1],
                langId:       attrs[2],
                lastModified: attrs[3],
                masterIds:    pageIds.split(RecentComparisonHistory.settings.tokens.masterIds.split)
            };
            RecentComparisonHistory.data.push(page);
        }
    }
}

RecentComparisonHistory.toggleMasterId = function(pageId, masterId, catName, langId) {
    var pageIds = new Array();
    for (var i=0; i<RecentComparisonHistory.data.length; i++) {
        pageIds.push(RecentComparisonHistory.data[i].pageId);
    }
    var idx = pageIds.inArray(pageId);
    if (idx === false) {
        idx = RecentComparisonHistory.data.length;
        pageIds[idx] = pageId;
        page = {
            pageId:    pageId,
            title:     catName,
            langId:    langId,
            masterIds: new Array(masterId),
            timestamp: null
        };
    } else {
        page = RecentComparisonHistory.data[idx];
        if (page.masterIds.inArray(masterId) !== false) {
            // Remove the master id from the list
            var tmpMasterIds = new Array();
            for (i=0; i<page.masterIds.length; i++) {
                 if (page.masterIds[i] != masterId) {
                     tmpMasterIds.push(page.masterIds[i]);
                 }
            }
        } else {
            // Add the master id to the list
            page.masterIds.push(masterId);
        }
    }
    page.lastModified = (new Date()).valueOf();
    RecentComparisonHistory.data[idx] = page;
}


RecentComparisonHistory.newToggleMasterId = function(pageId, masterId, catName, langId, comparText0, comparText1, comparText2) {
    
	var pageIds = new Array();

    for (var i=0; i<RecentComparisonHistory.data.length; i++) {
        pageIds.push(RecentComparisonHistory.data[i].pageId);
    }
    var idx = pageIds.inArray(pageId);

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


    if (idx === false) {
        idx = RecentComparisonHistory.data.length;
        pageIds[idx] = pageId;
        page = {
            pageId:    pageId,
            title:     catName,
            langId:    langId,
            masterIds: new Array(masterId),
            timestamp: null
        };
    } else {
       page = RecentComparisonHistory.data[idx];
	   if( page.masterIds.length == 1 && page.masterIds == ''){
		   page.masterIds = new Array(); 
	   }
       if( document.getElementById('productCompareCheckbox'+ masterId).checked == false){
            // Remove the master id from the list 			
			page.masterIds.splice(page.masterIds.indexOf(masterId), 1);

        } else if(page.masterIds.inArray(masterId) == false) {
            // Add the master id to the list
            page.masterIds.push(masterId);
        }
    }

    page.lastModified = (new Date()).valueOf();
    RecentComparisonHistory.data[idx] = page;
	if (page.masterIds.length == 0 || document.getElementById('productCompareCheckbox'+ masterId).checked == false) {
		document.getElementById('productCompareLink'+masterId).innerHTML = unescape(comparText2);
		document.getElementById('productCompareLink'+masterId).className = "";
		document.getElementById('productCompareDiv'+ masterId).className = "compareDiv";
		document.getElementById('productCompareLink'+masterId).onclick  = function() {
			compare_toggle_check(document.getElementById('productCompareLink'+masterId));
			return newToggleCompareCbx(document.getElementById('productCompareCheckbox' + masterId)) ;
		};
		if (page.masterIds.length == 1 && document.getElementById('productCompareLink'+ page.masterIds[0]) ){
			document.getElementById('productCompareLink'+ page.masterIds[0]).innerHTML = unescape(comparText1);
			document.getElementById('productCompareLink'+ page.masterIds[0]).className = "compareAnother";
			document.getElementById('productCompareDiv'+ page.masterIds[0]).className = "compareDiv selectAnother";
			
		}
	} else if (page.masterIds.length == 1) {
		document.getElementById('productCompareLink'+masterId).innerHTML = unescape(comparText1);
		document.getElementById('productCompareLink'+masterId).className = "compareAnother";
		document.getElementById('productCompareDiv'+ masterId).className = "compareDiv selectAnother";
	} else {
		document.getElementById('productCompareLink'+masterId).onclick  = function() {};
		//document.getElementById('productCompare'+masterId).onclick  = function() {};
		document.getElementById('productCompareLink'+masterId).innerHTML = '<span onClick="setSubmitTimeout()", 50);">'+unescape(comparText0)+'</span>';
		document.getElementById('productCompareLink'+masterId).className = "compareNow";
		//IE6 hack. Form won't submit unless you submit call this function through a timeout...
		

		document.getElementById('productCompareDiv'+ masterId).className = "compareDiv selectCompareNow";
		for (var i=0; i<page.masterIds.length; i++) {
			if(document.getElementById('productCompareLink'+page.masterIds[i]) && document.getElementById('productCompareDiv'+ page.masterIds[i])){
				document.getElementById('productCompareLink'+page.masterIds[i]).onclick  = function() {};
				//document.getElementById('productCompare'+page.masterIds[i]).onclick  = function() {};
				document.getElementById('productCompareLink'+page.masterIds[i]).innerHTML = '<span onClick="setSubmitTimeout();", 50);">'+ unescape(comparText0)+'</span>';
				document.getElementById('productCompareLink'+page.masterIds[i]).className = "compareNow";
				document.getElementById('productCompareDiv'+ page.masterIds[i]).className = "compareDiv selectCompareNow";
			}
		}
	}

}


function setSubmitTimeout(){
	setTimeout("submitFormFunction();", 50);
}

//IE6 hack function
submitFormFunction = function() {
	document.getElementById("productCompareForm").submit();	
}




RecentComparisonHistory.parseCookie();

/**
 * js/classes/browser.js
 *
 *
 *
 * @package     PriceGrabber
 * @subpackage  Utils
 * @category    JavaScript
 *
 * @author      Philip Snyder <philip@pricegrabber.com>
 * @copyright   Copyright &copy; 2005, Philip Snyder, PriceGrabber.com
 * @version     v0.0.1a
 *
 */







function Browser() { }

Browser.prototype             = Object;
Browser.prototype.constructor = Browser;
Browser.superclass            = Object.constructor;


Browser.regexes = {
    overflowX: new Array(/Firefox\/1\.0/),
    overflowY: new Array(/Firefox\/1\.0/)
};

Browser.supportsOverflowX = function() {
    for (var i=0; i<Browser.regexes.overflowX.length; i++) {
        var regex = Browser.regexes.overflowX[i];
        if (navigator.userAgent.match(regex)) {
            return false;
        }
    }
    return true;
}

Browser.supportsOverflowY = function() {
    for (var i=0; i<Browser.regexes.overflowY.length; i++) {
        var regex = Browser.regexes.overflowY[i];
        if (navigator.userAgent.match(regex)) {
            return false;
        }
    }
    return true;
}

Browser.supportsDom = function() {
    return (document.getElementById) ? true : false;
}

Browser.isIE = function() {
    return (document.all && navigator.appName.indexOf('Microsoft Internet Explorer') > -1) ? true : false;
}

Browser.isSafari = function() {
    return (navigator.userAgent.toLowerCase().indexOf('safari') > -1) ? true : false;
}
/**
 * $Id: baseobject.js 64367 2009-02-20 01:56:36Z kchiu $
 * $Author: kchiu $
 * $Revision: 64367 $
 * $Name$
 * $Date: 2009-02-19 17:56:36 -0800 (Thu, 19 Feb 2009) $
 *
 * @jsRequire interfaces.Interface
 *
 * BaseObject is a starter object for any JavaScript object
 * created. Once an object adds the BaseObject to its prototype
 * chain, it gains the functionality of all methods and variables
 * defined in this object, making BaseObject the perfect place
 * to incorporate other JavaScript libraries such as the Interface
 * library.
 *
 * @version    $Revision: 64367 $
 * @author     Philip Snyder <philip@pricegrabber.com>
 * @copyright  Copyright &copy; 2006, Philip Snyder, PriceGrabber.com
 * @see        interfaces.Interface
 */



/**
 * BaseObject Constructor / Definition
 *
 * @access public
 * @since  v1.1
 * @param  string      id
 * @return BaseObject
 */
function BaseObject(id) {
    // Method definitions
    this.getProperty = BaseObject_GetProperty;
    this.setProperty = BaseObject_SetProperty;
    this.getId       = BaseObject_GetId;
    this.setId       = BaseObject_SetId;
    // Member definitions
    this.properties = [];
    // Initialization
    this.setId(id);
    return this;
}

// Setup BaseObject prototype chain
BaseObject.prototype             = new Object;
BaseObject.prototype.constructor = BaseObject;
BaseObject.superclass            = Object.prototype;



/**
 * Returns the value of a property.
 *
 * @access public
 * @since  v1.1
 * @return mixed
 */
function BaseObject_GetProperty(name) {
    if (this.properties[name]) return this.properties[name];
    else                       return null;
}

/**
 * Sets the value of a property.
 *
 * @access public
 * @since  v1.1
 * @param  string  name
 * @param  mixed   value
 * return  boolean
 */
function BaseObject_SetProperty(name, value) {
    this.properties[name] = value;
    return true;
}

/**
 * Returns the id of the object.
 *
 * @access public
 * @since  v1.1
 * @return string
 */
function BaseObject_GetId() {
    return this.getProperty('id');
}

/**
 * Sets the id of the object.
 *
 * @access public
 * @since  v1.1
 * @param  string   id
 * @return boolean
 */
function BaseObject_SetId(id) {
    return this.setProperty('id', id);
}


/**
 * Extend the BaseObject class with any known included
 * functionality (for example Interface.implement)
 *
 * The reverse of this test can be found in interfaces.Interface
 * so that either file can be included first and the
 * functionality is still in place.
 */
if (typeof(Interface_Implement) == 'function') BaseObject.prototype.implement = Interface_Implement;
/**
 * $Id: interface.js 64367 2009-02-20 01:56:36Z kchiu $
 * $Author: kchiu $
 * $Revision: 64367 $
 * $Name$
 * $Date: 2009-02-19 17:56:36 -0800 (Thu, 19 Feb 2009) $
 *
 *
 *
 * This Interface JavaScript library serves to implement
 * a sort-of hacked interface extension to the standard
 * JavaScript language.
 *
 * The Interface function is never intended to be
 * invoked directly but rather in a prototype chain.
 *
 * Documentation will be available at:
 *
 * http://wiki.pricegrabber.com/moin.cgi/PhilipSnyder
 *
 *
 *
 * @version    $Revision: 64367 $
 * @author     Philip Snyder <philip@pricegrabber.com>
 * @copyright  Copyright &copy; 2006, Philip Snyder, PriceGrabber.com
 */

/**
 * Interface Constructor / Definition
 *
 * This is NOT intended to be instantiated directly. See
 * documentation for a complete explanation.
 *
 * @access public
 * @since  v1.1
 * @return Interface
 */
function Interface() {
    this.implement = Interface_Implement;
    return this;
}

/**
 * Confirms complete implementation of passed in Interface function reference.
 *
 * This method checks the object in question and validates that it has
 * either implemented or borrowed every method & variable defined in
 * the interfaces it claims to implement.
 *
 * @access public
 * @since  v1.1
 * @return void
 */
function Interface_Implement(ifaceRef) {
    var tmpObj  = new ifaceRef();
    var objName = (this.constructor+'').substr(('function ').length, (this.constructor+'').indexOf('(') - 'function '.length);
    for (var prop in tmpObj) {
        var typeCheck = false;
        var isFunc    = false;
        eval('isFunc    = (typeof(tmpObj.'+prop+') == "function");');
        eval('typeCheck = (typeof(this.'+prop+')   == typeof(tmpObj.'+prop+'));');
        if (prop != 'implement' && !typeCheck) {
            if (isFunc) throw new Error(objName+'.'+prop+"() not implemented!");
            else        throw new Error(objName+'.'+prop+" is either a wrong type or missing.");
        }
    }
}

/**
 * Attach the implement() method to our BaseObject as
 * well, and all classes extending BaseObjects will have
 * it available to them (and all at the cost of 1
 * function loaded into memory).
 */
if (typeof(BaseObject) == 'function') BaseObject.prototype.implement = Interface_Implement;
/**
 * $Id: anchoredinterface.js 64367 2009-02-20 01:56:36Z kchiu $
 * $Author: kchiu $
 * $Revision: 64367 $
 * $Name$
 * $Date: 2009-02-19 17:56:36 -0800 (Thu, 19 Feb 2009) $
 *
 * @jsRequire DomUtils
 * @jsRequire interfaces.Interface
 *
 *
 * @version    $Revision: 64367 $
 * @author     Philip Snyder <philip@pricegrabber.com>
 * @copyright  Copyright &copy; 2006, Philip Snyder, PriceGrabber.com
 * @see        interfaces.Interface
 */

/**
 * AnchoredInterface Constructor / Definition
 *
 * This interface is built on top of the Interface object
 * and is NOT intended to be instantiated directly. See
 * documentation on interfaces.Interface for a complete
 * explanation.
 *
 * @access public
 * @since  v1.1
 * @return AnchoredInterface
 */
function AnchoredInterface() {
    this.elemId            = null;
    this.anchorId          = null;
    this.disableScroll     = false;
    this.getAnchorX        = AnchoredInterface_GetAnchorX;
    this.getAnchorY        = AnchoredInterface_GetAnchorY;
    this.getAnchorZ        = AnchoredInterface_GetAnchorZ;
    this.getAnchorWidth    = AnchoredInterface_GetAnchorWidth;
    this.getAnchorHeight   = AnchoredInterface_GetAnchorHeight;
    this.getElemWidth      = AnchoredInterface_GetElemWidth;
    this.getElemHeight     = AnchoredInterface_GetElemHeight;
    this.getAnchorPosition = AnchoredInterface_GetAnchorPosition;
    this.setAnchor         = AnchoredInterface_SetAnchor;
    this.alignElement      = AnchoredInterface_AlignElement;
}

// Setup AnchoredInterface prototype chain
AnchoredInterface.prototype             = new Interface;
AnchoredInterface.prototype.constructor = AnchoredInterface;
AnchoredInterface.superclass            = Interface.prototype;

/**
 * Constants defining anchor points around the element.
 *
 * !DO NOT MODIFY THIS!
 *
 * @access public
 * @since  v1.1
 * @var    AnchoredInterface.ALIGN   struct
 */
AnchoredInterface.ALIGN = { RIGHT_TOP: 1, RIGHT_BOTTOM: 2, LEFT_BOTTOM: 3, LEFT_TOP: 4 };

/**
 * Returns the anchor element's X coordinate.
 *
 * @access public
 * @since  v1.1
 * @return integer
 */
function AnchoredInterface_GetAnchorX() {
    return DomUtils.getElementLeft(document.getElementById(this.anchorId));
}

/**
 * Returns the anchor element's Y coordinate.
 *
 * @access public
 * @since  v1.1
 * @return integer
 */
function AnchoredInterface_GetAnchorY() {
    return DomUtils.getElementTop(document.getElementById(this.anchorId));
}

/**
 * Returns the anchor element's Z index.
 *
 * @access public
 * @since  v1.1
 * @return integer
 */
function AnchoredInterface_GetAnchorZ() {
    return DomUtils.getZIndex(document.getElementById(this.anchorId));
}

/**
 * Returns the anchor element's width.
 *
 * @access public
 * @since  v1.1
 * @return integer
 */
function AnchoredInterface_GetAnchorWidth() {
    //window.messageQueue.add( new Message(funcname(this), 'getting anchor width') );
    return DomUtils.getElementWidth(document.getElementById(this.anchorId));
}

/**
 * Returns the anchor element's height.
 *
 * @access public
 * @since  v1.1
 * @return integer
 */
function AnchoredInterface_GetAnchorHeight() {
    return DomUtils.getElementHeight(document.getElementById(this.anchorId));
}

/**
 * Returns the element's width.
 *
 * @access public
 * @since  v1.1
 * @return integer
 */
function AnchoredInterface_GetElemWidth() {
    //window.messageQueue.add( new Message(funcname(this), 'getting element width') );
    return DomUtils.getElementWidth(document.getElementById(this.elemId));
}

/**
 * Returns the element's height.
 *
 * @access public
 * @since  v1.1
 * @return integer
 */
function AnchoredInterface_GetElemHeight() {
    return DomUtils.getElementHeight(document.getElementById(this.elemId));
}

/**
 * Calculates the best alignment position for the element based on window size and position of the anchor element.
 *
 * Returns a value from the AnchoredInterface.ALIGN struct.
 *
 * @access public
 * @since  v1.1
 * @return integer
 */
function AnchoredInterface_GetAnchorPosition() {
    //window.messageQueue.add( new Message('AnchoredInterface_GetAnchorPosition', 'called') );
    var pos    = false;
    var elem   = document.getElementById(this.elemId);
    if (!elem)   throw new Error('Unable to find element: '+this.elemId);
    var anchor = document.getElementById(this.anchorId);
    if (!anchor) throw new Error('Unable to find anchor element: '+this.anchorId);

    //window.messageQueue.add( new Message(funcname(this), 'starting getElementWidth') );
    var wWidth  = parseInt(DomUtils.getWindowWidth(window));
    var wHeight = parseInt(DomUtils.getWindowHeight(window));
    var scrollX = parseInt(DomUtils.getWindowScrollX(window));
    var scrollY = parseInt(DomUtils.getWindowScrollY(window));
    var aWidth  = parseInt(DomUtils.getElementWidth(anchor));
    var aHeight = parseInt(DomUtils.getElementHeight(anchor));
    var aX      = parseInt(DomUtils.getElementLeft(anchor));
    var aY      = parseInt(DomUtils.getElementTop(anchor));
    var aWidth  = parseInt(DomUtils.getElementWidth(anchor));
    var aHeight = parseInt(DomUtils.getElementHeight(anchor));
    var eWidth  = parseInt(DomUtils.getElementWidth(elem));
    var eHeight = parseInt(DomUtils.getElementHeight(elem));
    //window.messageQueue.add( new Message(funcname(this), 'passed getElementWidth') );


    if (this.disableScroll) {
    
        /**
         * DO NOT TOUCH. I'M SERIOUS. This is difficult enough to figure out the first time. ;)
         */
        var enoughRoomOnTop    = (aY - scrollY > eHeight ? true : false);
        var enoughRoomOnBottom = (wHeight + scrollY - aHeight - aY > eHeight ? true : false);
        var enoughRoomOnLeft   = (aX - scrollX + aWidth > eWidth ? true : false);
        var enoughRoomOnRight  = (wWidth - aX + scrollX > eWidth ? true : false);
    
        /**
         * Preferred position order:
         *
         *   left top
         *   left bottom
         *   right bottom
         *   right top
         *
         * Please note that this is the position of the anchor in
         * relation to the main element, NOT the other way around
         */
//alert('enoughRoomOnTop= '+enoughRoomOnTop+'\nenoughRoomOnBottom= '+enoughRoomOnBottom+'\nenoughRoomOnLeft= '+enoughRoomOnLeft+'\nenoughRoomOnRight= '+enoughRoomOnRight);
        // Left Top
        if (enoughRoomOnBottom && enoughRoomOnRight) {
            pos = AnchoredInterface.ALIGN.LEFT_TOP;
        // Left Bottom
        } else if (enoughRoomOnTop && enoughRoomOnRight) {
            pos = AnchoredInterface.ALIGN.LEFT_BOTTOM;
        // Right Bottom
        } else if (enoughRoomOnTop && enoughRoomOnLeft) {
            pos = AnchoredInterface.ALIGN.RIGHT_BOTTOM;
        // Right Top
        } else if (enoughRoomOnBottom && enoughRoomOnLeft) {
            pos = AnchoredInterface.ALIGN.RIGHT_TOP;
        } else if (!enoughRoomOnRight) {
            pos = AnchoredInterface.ALIGN.LEFT_TOP;
        } else {
            pos = AnchoredInterface.ALIGN.LEFT_TOP;
        }
        return pos;
    
    } else {
    
        //how much is missing to display on the right (<=0 means enough to display)
        var not_enough_right = ((aX-scrollX) +  eWidth) - wWidth;
        //how much is missing to display on the left (<=0 means enough to display)
        var not_enough_left =  eWidth - (aX-scrollX);
        //how much is missing to display on the left if not scrolled (<=0 means enough to display)
        var not_enough_absolute_left = eWidth - aX;
    
        //how much is missing to display on the bottom (<=0 means enough to display)
        var not_enough_bottom = ((aY-scrollY) +  eHeight) - wHeight;
        //how much is missing to display on the top (<=0 means enough to display)
        var not_enough_top =  eHeight - (aY-scrollY);
        //how much is missing to display on the top if not scrolled (<=0 means enough to display)
        var not_enough_absolute_top = eHeight - aY;
    
        //alert("window is "+wWidth+" by "+wHeight+" and scrolled to "+scrollX+" by "+scrollY+"\nthumb is "+aWidth+" by "+aHeight+" and at "+aX+" by "+aY+"\npop is "+eWidth+" by "+eHeight+"\n\nif there is enough room, value <=0:\n\nright: "+not_enough_right+"\nleft: "+not_enough_left+"\nabsleft: "+not_enough_absolute_left+"\nbottom: "+not_enough_bottom+"\ntop: "+not_enough_top+"\nabstop: "+not_enough_absolute_top);
    
        var horiz = '';
        var vertic = '';
        var ss = 10;
    
        // #1 pref position: top right
        // #2 pref position: bottom right
        // #3 pref position: top left
        // #4 pref position: bottom left
        // if we fit or are closer from fitting to the right than to the left or there is not enough room on the left
        if (not_enough_right <= 0 || not_enough_right < not_enough_left || not_enough_absolute_left > 0) {
            horiz = 'right';
            // scroll if necessary
            if (not_enough_right > 0) {
                for (var i=0; i<=(not_enough_right/(ss*2))+1; i++) {
                    setTimeout('window.scroll(parseInt(DomUtils.getWindowScrollX(window))+'+ss+',parseInt(DomUtils.getWindowScrollY(window)))',100);
                }
            }
        // else if we are closer from the left and there is room if we scroll
        } else {
            horiz = 'left';
            // scroll if necessary
            if (not_enough_left > 0 && !this.disableScroll) {
                for (var i=0; i<=(not_enough_left/(ss*2))+1; i++) {
                    setTimeout('window.scroll(parseInt(DomUtils.getWindowScrollX(window))-'+ss+',parseInt(DomUtils.getWindowScrollY(window)))',100);
                }
            }
        }
    
        // if we are closer from fitting to the top than to the bottom and there is enough room at the top
        if (not_enough_top <= 0 || (not_enough_top < not_enough_bottom && not_enough_absolute_top <= 0)) {
            vertic = 'top';
            // scroll if necessary
            if (not_enough_top > 0 && !this.disableScroll) {
                for (var i=0;i<=(not_enough_top/(ss*2))+1;i++) {
                    setTimeout('window.scroll(parseInt(DomUtils.getWindowScrollX(window)),parseInt(DomUtils.getWindowScrollY(window))-'+ss+')',100);
                }
            }
        // else if we are closer from the top and there is room if we scroll
        } else {
            vertic = 'bottom';
            // scroll if necessary
            if (not_enough_bottom > 0 && !this.disableScroll) {
                for (var i=0; i<=(not_enough_bottom/(ss*2))+1; i++) {
                    setTimeout('window.scroll(parseInt(DomUtils.getWindowScrollX(window)),parseInt(DomUtils.getWindowScrollY(window))+'+ss+')',100);
                }
            }
        }
    
        if      (horiz == 'right' && vertic == 'top'   ) pos = AnchoredInterface.ALIGN.RIGHT_TOP;
        else if (horiz == 'right' && vertic == 'bottom') pos = AnchoredInterface.ALIGN.RIGHT_BOTTOM;
        else if (horiz == 'left'  && vertic == 'top'   ) pos = AnchoredInterface.ALIGN.LEFT_TOP;
        else if (horiz == 'left'  && vertic == 'bottom') pos = AnchoredInterface.ALIGN.LEFT_BOTTOM;
    
        return pos;
    }
}

/**
 * Sets the anchor element.
 *
 * @access public
 * @since  v1.1
 * @param  DOMElement  anchor
 * @return void
 */
function AnchoredInterface_SetAnchor(anchor) {
    //alert('anchor id: '+anchor.id);
    this.anchorId = anchor.id;
}

/**
 * Aligns the element based on the best placement determined by AnchoredInterface_GetAnchorPosition.
 *
 * @access public
 * @since  v1.1
 * @param  integer   pos   A value from the AnchoredInterface.ALIGN struct
 * @return void
 */
function AnchoredInterface_AlignElement(pos) {
    //window.messageQueue.add( new Message('AnchoredInterface_AlignElement', 'called') );
    var elem   = document.getElementById(this.elemId);
    if (!elem)   throw new Error('Unable to find element: '+this.elemId);

    var anchor = document.getElementById(this.anchorId);
    if (!anchor) throw new Error('Unable to find anchor element: '+this.anchorId);

    pos = pos || this.getAnchorPosition();

    //window.messageQueue.add( new Message('AnchoredInterface_AlignElement', 'starting getElementWidth') );
    var aLeft   = DomUtils.getElementLeft(anchor);
    var aTop    = DomUtils.getElementTop(anchor);
    var aHeight = DomUtils.getElementHeight(anchor);
    var aWidth  = DomUtils.getElementWidth(anchor);
    var eHeight = DomUtils.getElementHeight(elem);
    var eWidth  = DomUtils.getElementWidth(elem);
    /*alert('aLeft: '+aLeft+"\n"+
          'aTop: '+aTop+"\n"+
          'aHeight: '+aHeight+"\n"+
          'aWidth: '+aWidth+"\n"+
          'eHeight: '+eHeight+"\n"+
          'eWidth: '+eWidth+"\n");*/
    //window.messageQueue.add( new Message('AnchoredInterface_AlignElement', 'passed getElementWidth') );
    switch (pos) {
        /**
         * Right Top alignment means:
         *
         *             +--------+
         *             | anchor |
         *             +--------+
         *    +-----------------+
         *    | elem            |
         *    +-----------------+
         */
        case AnchoredInterface.ALIGN.RIGHT_TOP:
            elem.style.left = parseInt( aLeft - eWidth  + aWidth  )+'px';
            elem.style.top  = parseInt( aTop  + aHeight )+'px';
            break;
        /**
         * Right Bottom alignment means:
         *
         *    +-----------------+
         *    | elem            |
         *    +-----------------+
         *             +--------+
         *             | anchor |
         *             +--------+
         */
         case AnchoredInterface.ALIGN.RIGHT_BOTTOM:
            elem.style.left = parseInt( aLeft - eWidth + aWidth )+'px';
            elem.style.top  = parseInt( aTop  + aHeight )+'px';
            break;
        /**
         * Left Top alignment means:
         *
         *    +--------+
         *    | anchor |
         *    +--------+
         *    +-----------------+
         *    | elem            |
         *    +-----------------+
         */
         case AnchoredInterface.ALIGN.LEFT_TOP:
            elem.style.left = parseInt( aLeft )+'px';
            elem.style.top  = parseInt( aTop + aHeight)+'px';
            break;
        /**
         * Left Bottom alignment means:
         *
         *    +-----------------+
         *    | elem            |
         *    +-----------------+
         *    +--------+
         *    | anchor |
         *    +--------+
         */
         case AnchoredInterface.ALIGN.LEFT_BOTTOM:
        default:
            elem.style.left = parseInt( aLeft )+'px';
            elem.style.top  = parseInt( aTop - eHeight )+'px';
            break;
    }
    // fanatic memory cleanup
    elem   = null;
    anchor = null;
    //window.messageQueue.add( new Message('AnchoredInterface_AlignElement', 'finished') );
}

/* Omniture H.20.3 code */

var om_track = "prop1,prop3,prop7,prop5,prop6,prop9,prop10,prop11,prop13,prop16,prop20,prop32,prop34,prop41,prop42,prop43,prop46,eVar5,eVar6,eVar12,eVar13,eVar14,eVar16,eVar17,eVar18,eVar20,eVar25,eVar26,eVar38,eVar44,eVar46,eVar47,eVar48,s_products,s_purchaseID,events";
var om_events="purchase,event2,event11";

function om_clear_s_history(){
        if(typeof(s) == 'object'){
           // dumped_text = '';
           for(var item in s) {
              var value = s[item];
              if(typeof(value) == 'string' && ( /^(prop|eVar)[0-9]{1,2}$/i.test(item) || item=='pageName' || item=='pageType') ){
                 // dumped_text += "'" + item + "' => \"" + value + "\"\n";
                 delete s[item];
              }
           }
           // alert(dumped_text);
        }
}

function om_H_link_p(reportsuite_ids, propname, propval, linkName, VisitorID) {
        om_clear_s_history();
	s = s_gi(reportsuite_ids); 
	s[propname] = propval;
	s.linkTrackVars=om_track+","+propname;
	s.linkTrackEvents=om_events;
	if (VisitorID) {
		s.visitorID = VisitorID;
	}
	s.tl(true, 'o', linkName);
}

function om_G_link_p(reportsuite_ids, propname, propval, linkName) {
	eval("s_"+propname+"='"+propval+"';");
	s_linkTrackVars=om_track;
	s_linkType = 'o';
	s_linkName = linkName;
	// s_link = s_co(this);
	s_lnk = s_co(this);
	s_gs(reportsuite_ids); 
}

function om_H_link_multi_p(reportsuite_ids, props, linkName, visitorId) {
        om_clear_s_history();
	s = s_gi(reportsuite_ids);
	s.linkTrackVars=om_track;
	s.linkTrackEvents=om_events;
	for (key in props) {
		s[key] = props[key];
		s.linkTrackVars=s.linkTrackVars+","+key;
	}
	if (visitorId) {
		s.visitorID = visitorId;
	}
	s.tl(true, 'o', linkName);
}
 	
function goToLink(loc) {
	//setTimeout("goToLink('"+ href +"')", 500);
	//alert('GO TO LINK: '+ loc);
	window.location = loc;
}

function om_dual_link(reporting_suite, override_suite, propname, propval, linkName, VisitorID) {
	om_G_link_p(reporting_suite, propname, propval, linkName);
	om_H_link_p(override_suite, propname, propval, linkName, VisitorID);
}

// Both H - neither UT
function om_doubleH_link(reporting_suite, override_suite, propname, propval, linkName, VisitorID) {
	om_H_link_p(reporting_suite, propname, propval, linkName);
	om_H_link_p(override_suite, propname, propval, linkName);
}

// Both H - both UT
function om_doubleHut_link(reporting_suite, override_suite, propname, propval, linkName, VisitorID) {
	om_H_link_p(reporting_suite, propname, propval, linkName, VisitorID);
	om_H_link_p(override_suite, propname, propval, linkName, VisitorID);
}

// Both H - primary UT
function om_doublePut_link(reporting_suite, override_suite, propname, propval, linkName, VisitorID) {
	om_H_link_p(reporting_suite, propname, propval, linkName, VisitorID);
	om_H_link_p(override_suite, propname, propval, linkName);
}

//Both H - override UT
function om_doubleOut_link(reporting_suite, override_suite, propname, propval, linkName, VisitorID) {
	om_H_link_p(reporting_suite, propname, propval, linkName);
	om_H_link_p(override_suite, propname, propval, linkName, VisitorID);
}

function om_single_link(reporting_suite, override_suite, propname, propval, linkName, VisitorID) {
	om_G_link_p(reporting_suite, propname, propval, linkName);
}

function om_singleH_link(reporting_suite, override_suite, propname, propval, linkName, VisitorID) {
	om_H_link_p(reporting_suite, propname, propval, linkName, VisitorID);
}

// Multiple params
function om_singleH_mlink(reporting_suite, override_suite, VisitorID, props, linkName, linkto) {
	om_H_link_multi_p(reporting_suite, props, linkName, VisitorID);
	if (linkto) {
		goToLink(linkto); }
}

// Multiple Params - Both H - neither UT
function om_doubleH_mlink(reporting_suite, override_suite, VisitorID, props, linkName, linkto) {
	om_H_link_multi_p(reporting_suite, props, linkName);
	om_H_link_multi_p(override_suite, props, linkName);
	if (linkto) {
		goToLink(linkto); }
}

// Multiple Params - Both H - both UT
function om_doubleHut_mlink(reporting_suite, override_suite, VisitorID, props, linkName, linkto) {
	om_H_link_multi_p(reporting_suite, props, linkName, VisitorID);
	om_H_link_multi_p(override_suite, props, linkName, VisitorID);
	if (linkto) {
		goToLink(linkto); }
}

// Multiple Params - Both H - primary UT
function om_doublePut_mlink(reporting_suite, override_suite, VisitorID, props, linkName, linkto) {
	om_H_link_multi_p(reporting_suite, props, linkName, VisitorID);
	om_H_link_multi_p(override_suite, props, linkName);
	if (linkto) {
		goToLink(linkto); }
}

// Multiple Params - Both H - override UT
function om_doubleOut_mlink(reporting_suite, override_suite, VisitorID, props, linkName, linkto) {
	om_H_link_multi_p(reporting_suite, props, linkName);
	om_H_link_multi_p(override_suite, props, linkName, VisitorID);
	if (linkto) {
		goToLink(linkto); }
}


function om_setup(s, charSet, currencyCode) {
s.charSet=charSet;
s.currencyCode=currencyCode;
/* Link Tracking Config */
s.trackDownloadLinks=true
s.trackExternalLinks=true
s.trackInlineStats=true
s.linkDownloadFileTypes="exe,zip,wav,mp3,mov,mpg,avi,wmv,doc,pdf,xls"
s.linkInternalFilters="javascript:,bottomdollar,pricegrabber"
s.linkLeaveQueryString=false;
s.linkTrackVars=om_track;
s.linkTrackEvents=om_events;

/* WARNING: Changing any of the below variables will cause drastic
changes to how your visitor data is collected.  Changes should only be
made when instructed to do so by your account manager.*/
s.dc=112;

/* Plugins Section */

s.usePlugins=true;
s.doPlugins=s_do_H_Plugins;

/************************** PLUGINS SECTION *************************/
/* You may insert any plugins you wish to use here.                 */

/*
* TNT Integration Pluginv1.0
* v -Name of the javascriptvariable that is used. Defaults to s_tnt(optional)
* p -Name of the urlparameter. Defaults to s_tnt(optional)
* b -Blank Global variable after pluginruns. Defaults to true (Optional)
*/
s.trackTNT= function(v, p, b)
{
vars=this, n="s_tnt", p=(p)?p:n, v=(v)?v:n, r="",pm=false, b=(b)?b:true;
if(s.getQueryParam)
pm = s.getQueryParam(p); //grab the parameter
if(pm)
r += (pm + ","); // append the parameter
if(s.wd[v] != undefined)
r += s.wd[v]; // get the global variable
if(b)
s.wd[v] = ""; // Blank out the global variable for ajaxrequests
return r;
}

/*
 * Plugin: getQueryParam 2.3
 */
s.getQueryParam=new Function("p","d","u",""
+"var s=this,v='',i,t;d=d?d:'';u=u?u:(s.pageURL?s.pageURL:s.wd.locati"
+"on);if(u=='f')u=s.gtfs().location;while(p){i=p.indexOf(',');i=i<0?p"
+".length:i;t=s.p_gpv(p.substring(0,i),u+'');if(t){t=t.indexOf('#')>-"
+"1?t.substring(0,t.indexOf('#')):t;}if(t)v+=v?d+t:t;p=p.substring(i="
+"=p.length?i:i+1)}return v");
s.p_gpv=new Function("k","u",""
+"var s=this,v='',i=u.indexOf('?'),q;if(k&&i>-1){q=u.substring(i+1);v"
+"=s.pt(q,'&','p_gvf',k)}return v");
s.p_gvf=new Function("t","k",""
+"if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'T"
+"rue':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return s."
+"epa(v)}return ''");

/*
 * Plugin: getNewRepeat
 */
s.getNewRepeat=new Function(""
+"var s=this,e=new Date(),cval,ct=e.getTime(),y=e.getYear();e.setTime"
+"(ct+30*24*60*60*1000);cval=s.c_r('s_nr');if(cval.length==0){s.c_w("
+"'s_nr',ct,e);return 'New';}if(cval.length!=0&&ct-cval<30*60*1000){s"
+".c_w('s_nr',ct,e);return 'New';}if(cval<1123916400001){e.setTime(cv"
+"al+30*24*60*60*1000);s.c_w('s_nr',ct,e);return 'Repeat';}else retur"
+"n 'Repeat';");

}

function s_do_H_Plugins(s) {
	/* Add calls to plugins here */
	/* s.campaign=s.getQueryParam('source');*/
	s.eVar28=s.getNewRepeat();
	s.prop27=s.eVar28;
	/* Omniture Test&Target */
	s.tnt=s.trackTNT();
}

function om_cookie(s, cookie_host) {
if (navigator.cookieEnabled) {
	var theCookie = "event1H=";
	var allcookies = document.cookie;
	var pos = allcookies.indexOf(theCookie);
	if (pos != -1)
	{
    	var start = pos + theCookie.length;
		var end = allcookies.indexOf(";", start);
		if (end == -1) end = allcookies.length;
		var value = allcookies.substring(start, end);
		value = unescape(value);
	}
	if (value=="1")
	{
		document.cookie = "event1H=2;path=/;domain="+cookie_host+";";
	}
	else
	{
		if (s.events) {
			var myArray = s.events.split(",");
			var new_s_events = new Array();
			for (var i= 0; i<myArray.length; i++)
			{
				if (myArray[i]!="event1") new_s_events[new_s_events.length] = myArray[i];
			}
			s.events = new_s_events.join(",");
		}
	}
}
}

/* SiteCatalyst code version: H.20.3.
Copyright 1997-2009 Omniture, Inc. More info available at
http://www.omniture.com */

/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code='',s_objectID;function s_gi(un,pg,ss){var c="s._c='s_c';s.wd=window;if(!s.wd.s_c_in){s.wd.s_c_il=new Array;s.wd.s_c_in=0;}s._il=s.wd.s_c_il;s._in=s.wd.s_c_in;s._il[s._in]=s;s.wd.s_c_in++;s"
+".an=s_an;s.cls=function(x,c){var i,y='';if(!c)c=this.an;for(i=0;i<x.length;i++){n=x.substring(i,i+1);if(c.indexOf(n)>=0)y+=n}return y};s.fl=function(x,l){return x?(''+x).substring(0,l):x};s.co=func"
+"tion(o){if(!o)return o;var n=new Object,x;for(x in o)if(x.indexOf('select')<0&&x.indexOf('filter')<0)n[x]=o[x];return n};s.num=function(x){x=''+x;for(var p=0;p<x.length;p++)if(('0123456789').indexO"
+"f(x.substring(p,p+1))<0)return 0;return 1};s.rep=s_rep;s.sp=s_sp;s.jn=s_jn;s.ape=function(x){var s=this,h='0123456789ABCDEF',i,c=s.charSet,n,l,e,y='';c=c?c.toUpperCase():'';if(x){x=''+x;if(c=='AUTO"
+"'&&('').charCodeAt){for(i=0;i<x.length;i++){c=x.substring(i,i+1);n=x.charCodeAt(i);if(n>127){l=0;e='';while(n||l<4){e=h.substring(n%16,n%16+1)+e;n=(n-n%16)/16;l++}y+='%u'+e}else if(c=='+')y+='%2B';"
+"else y+=escape(c)}x=y}else{x=x?s.rep(escape(''+x),'+','%2B'):x;if(x&&c&&s.em==1&&x.indexOf('%u')<0&&x.indexOf('%U')<0){i=x.indexOf('%');while(i>=0){i++;if(h.substring(8).indexOf(x.substring(i,i+1)."
+"toUpperCase())>=0)return x.substring(0,i)+'u00'+x.substring(i);i=x.indexOf('%',i)}}}}return x};s.epa=function(x){var s=this;return x?unescape(s.rep(''+x,'+',' ')):x};s.pt=function(x,d,f,a){var s=th"
+"is,t=x,z=0,y,r;while(t){y=t.indexOf(d);y=y<0?t.length:y;t=t.substring(0,y);r=s[f](t,a);if(r)return r;z+=y+d.length;t=x.substring(z,x.length);t=z<x.length?t:''}return ''};s.isf=function(t,a){var c=a"
+".indexOf(':');if(c>=0)a=a.substring(0,c);if(t.substring(0,2)=='s_')t=t.substring(2);return (t!=''&&t==a)};s.fsf=function(t,a){var s=this;if(s.pt(a,',','isf',t))s.fsg+=(s.fsg!=''?',':'')+t;return 0}"
+";s.fs=function(x,f){var s=this;s.fsg='';s.pt(x,',','fsf',f);return s.fsg};s.si=function(wd){var s=this,c=''+s_gi,a=c.indexOf(\"{\"),b=c.lastIndexOf(\"}\"),m;c=s_fe(a>0&&b>0?c.substring(a+1,b):0);if"
+"(wd&&wd.document&&c){wd.setTimeout('function s_sv(o,n,k){var v=o[k],i;if(v){if(typeof(v)==\"string\"||typeof(v)==\"number\")n[k]=v;else if (typeof(v)==\"array\"){n[k]=new Array;for(i=0;i<v.length;i"
+"++)s_sv(v,n[k],i)}else if (typeof(v)==\"object\"){n[k]=new Object;for(i in v)s_sv(v,n[k],i)}}}function s_si(t){var wd=window,s,i,j,c,a,b;wd.s_gi=new Function(\"un\",\"pg\",\"ss\",\"'+c+'\");wd.s=s_"
+"gi(\"'+s.oun+'\");s=wd.s;s.sa(\"'+s.un+'\");s.tfs=wd;s.pt(s.vl_g,\",\",\"vo1\",t);s.lnk=s.eo=s.linkName=s.linkType=s.wd.s_objectID=s.ppu=s.pe=s.pev1=s.pev2=s.pev3=\\'\\';if(t.m_l&&t.m_nl)for(i=0;i<"
+"t.m_nl.length;i++){n=t.m_nl[i];if(n){m=t[n];c=t[\"m_\"+n];if(m&&c){c=\"\"+c;if(c.indexOf(\"function\")>=0){a=c.indexOf(\"{\");b=c.lastIndexOf(\"}\");c=a>0&&b>0?c.substring(a+1,b):0;s[\"m_\"+n+\"_c"
+"\"]=c;if(m._e)s.loadModule(n);if(s[n])for(j=0;j<m._l.length;j++)s_sv(m,s[n],m._l[j])}}}}}var e,o,t;try{o=window.opener;if(o&&o.s_gi){t=o.s_gi(\"'+s.un+'\");if(t)s_si(t)}}catch(e){}',1)}};s.c_d='';s"
+".c_gdf=function(t,a){var s=this;if(!s.num(t))return 1;return 0};s.c_gd=function(){var s=this,d=s.wd.location.hostname,n=s.fpCookieDomainPeriods,p;if(!n)n=s.cookieDomainPeriods;if(d&&!s.c_d){n=n?par"
+"seInt(n):2;n=n>2?n:2;p=d.lastIndexOf('.');if(p>=0){while(p>=0&&n>1){p=d.lastIndexOf('.',p-1);n--}s.c_d=p>0&&s.pt(d,'.','c_gdf',0)?d.substring(p):d}}return s.c_d};s.c_r=function(k){var s=this;k=s.ap"
+"e(k);var c=' '+s.d.cookie,i=c.indexOf(' '+k+'='),e=i<0?i:c.indexOf(';',i),v=i<0?'':s.epa(c.substring(i+2+k.length,e<0?c.length:e));return v!='[[B]]'?v:''};s.c_w=function(k,v,e){var s=this,d=s.c_gd("
+"),l=s.cookieLifetime,t;v=''+v;l=l?(''+l).toUpperCase():'';if(e&&l!='SESSION'&&l!='NONE'){t=(v!=''?parseInt(l?l:0):-60);if(t){e=new Date;e.setTime(e.getTime()+(t*1000))}}if(k&&l!='NONE'){s.d.cookie="
+"k+'='+s.ape(v!=''?v:'[[B]]')+'; path=/;'+(e&&l!='SESSION'?' expires='+e.toGMTString()+';':'')+(d?' domain='+d+';':'');return s.c_r(k)==v}return 0};s.eh=function(o,e,r,f){var s=this,b='s_'+e+'_'+s._"
+"in,n=-1,l,i,x;if(!s.ehl)s.ehl=new Array;l=s.ehl;for(i=0;i<l.length&&n<0;i++){if(l[i].o==o&&l[i].e==e)n=i}if(n<0){n=i;l[n]=new Object}x=l[n];x.o=o;x.e=e;f=r?x.b:f;if(r||f){x.b=r?0:o[e];x.o[e]=f}if(x"
+".b){x.o[b]=x.b;return b}return 0};s.cet=function(f,a,t,o,b){var s=this,r,tcf;if(s.apv>=5&&(!s.isopera||s.apv>=7)){tcf=new Function('s','f','a','t','var e,r;try{r=s[f](a)}catch(e){r=s[t](e)}return r"
+"');r=tcf(s,f,a,t)}else{if(s.ismac&&s.u.indexOf('MSIE 4')>=0)r=s[b](a);else{s.eh(s.wd,'onerror',0,o);r=s[f](a);s.eh(s.wd,'onerror',1)}}return r};s.gtfset=function(e){var s=this;return s.tfs};s.gtfso"
+"e=new Function('e','var s=s_c_il['+s._in+'],c;s.eh(window,\"onerror\",1);s.etfs=1;c=s.t();if(c)s.d.write(c);s.etfs=0;return true');s.gtfsfb=function(a){return window};s.gtfsf=function(w){var s=this"
+",p=w.parent,l=w.location;s.tfs=w;if(p&&p.location!=l&&p.location.host==l.host){s.tfs=p;return s.gtfsf(s.tfs)}return s.tfs};s.gtfs=function(){var s=this;if(!s.tfs){s.tfs=s.wd;if(!s.etfs)s.tfs=s.cet("
+"'gtfsf',s.tfs,'gtfset',s.gtfsoe,'gtfsfb')}return s.tfs};s.mrq=function(u){var s=this,l=s.rl[u],n,r;s.rl[u]=0;if(l)for(n=0;n<l.length;n++){r=l[n];s.mr(0,0,r.r,0,r.t,r.u)}};s.br=function(id,rs){var s"
+"=this;if(s.disableBufferedRequests||!s.c_w('s_br',rs))s.brl=rs};s.flushBufferedRequests=function(){this.fbr(0)};s.fbr=function(id){var s=this,br=s.c_r('s_br');if(!br)br=s.brl;if(br){if(!s.disableBu"
+"fferedRequests)s.c_w('s_br','');s.mr(0,0,br)}s.brl=0};s.mr=function(sess,q,rs,id,ta,u){var s=this,dc=s.dc,t1=s.trackingServer,t2=s.trackingServerSecure,tb=s.trackingServerBase,p='.sc',ns=s.visitorN"
+"amespace,un=s.cls(u?u:(ns?ns:s.fun)),r=new Object,l,imn='s_i_'+(un),im,b,e;if(!rs){if(t1){if(t2&&s.ssl)t1=t2}else{if(!tb)tb='2o7.net';if(dc)dc=(''+dc).toLowerCase();else dc='d1';if(tb=='2o7.net'){i"
+"f(dc=='d1')dc='112';else if(dc=='d2')dc='122';p=''}t1=un+'.'+dc+'.'+p+tb}rs='http'+(s.ssl?'s':'')+'://'+t1+'/b/ss/'+s.un+'/'+(s.mobile?'5.1':'1')+'/H.20.3/'+sess+'?AQB=1&ndh=1'+(q?q:'')+'&AQE=1';if"
+"(s.isie&&!s.ismac){if(s.apv>5.5)rs=s.fl(rs,4095);else rs=s.fl(rs,2047)}if(id){s.br(id,rs);return}}if(s.d.images&&s.apv>=3&&(!s.isopera||s.apv>=7)&&(s.ns6<0||s.apv>=6.1)){if(!s.rc)s.rc=new Object;if"
+"(!s.rc[un]){s.rc[un]=1;if(!s.rl)s.rl=new Object;s.rl[un]=new Array;setTimeout('if(window.s_c_il)window.s_c_il['+s._in+'].mrq(\"'+un+'\")',750)}else{l=s.rl[un];if(l){r.t=ta;r.u=un;r.r=rs;l[l.length]"
+"=r;return ''}imn+='_'+s.rc[un];s.rc[un]++}im=s.wd[imn];if(!im)im=s.wd[imn]=new Image;im.s_l=0;im.onload=new Function('e','this.s_l=1;var wd=window,s;if(wd.s_c_il){s=wd.s_c_il['+s._in+'];s.mrq(\"'+u"
+"n+'\");s.nrs--;if(!s.nrs)s.m_m(\"rr\")}');if(!s.nrs){s.nrs=1;s.m_m('rs')}else s.nrs++;im.src=rs;if(rs.indexOf('&pe=')>=0&&(!ta||ta=='_self'||ta=='_top'||(s.wd.name&&ta==s.wd.name))){b=e=new Date;wh"
+"ile(!im.s_l&&e.getTime()-b.getTime()<500)e=new Date}return ''}return '<im'+'g sr'+'c=\"'+rs+'\" width=1 height=1 border=0 alt=\"\">'};s.gg=function(v){var s=this;if(!s.wd['s_'+v])s.wd['s_'+v]='';re"
+"turn s.wd['s_'+v]};s.glf=function(t,a){if(t.substring(0,2)=='s_')t=t.substring(2);var s=this,v=s.gg(t);if(v)s[t]=v};s.gl=function(v){var s=this;if(s.pg)s.pt(v,',','glf',0)};s.rf=function(x){var s=t"
+"his,y,i,j,h,l,a,b='',c='',t;if(x){y=''+x;i=y.indexOf('?');if(i>0){a=y.substring(i+1);y=y.substring(0,i);h=y.toLowerCase();i=0;if(h.substring(0,7)=='http://')i+=7;else if(h.substring(0,8)=='https://"
+"')i+=8;h=h.substring(i);i=h.indexOf(\"/\");if(i>0){h=h.substring(0,i);if(h.indexOf('google')>=0){a=s.sp(a,'&');if(a.length>1){l=',q,ie,start,search_key,word,kw,cd,';for(j=0;j<a.length;j++){t=a[j];i"
+"=t.indexOf('=');if(i>0&&l.indexOf(','+t.substring(0,i)+',')>=0)b+=(b?'&':'')+t;else c+=(c?'&':'')+t}if(b&&c){y+='?'+b+'&'+c;if(''+x!=y)x=y}}}}}}return x};s.hav=function(){var s=this,qs='',fv=s.link"
+"TrackVars,fe=s.linkTrackEvents,mn,i;if(s.pe){mn=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1);if(s[mn]){fv=s[mn].trackVars;fe=s[mn].trackEvents}}fv=fv?fv+','+s.vl_l+','+s.vl_l2:'';for(i=0;i<s"
+".va_t.length;i++){var k=s.va_t[i],v=s[k],b=k.substring(0,4),x=k.substring(4),n=parseInt(x),q=k;if(v&&k!='linkName'&&k!='linkType'){if(s.pe||s.lnk||s.eo){if(fv&&(','+fv+',').indexOf(','+k+',')<0)v='"
+"';if(k=='events'&&fe)v=s.fs(v,fe)}if(v){if(k=='dynamicVariablePrefix')q='D';else if(k=='visitorID')q='vid';else if(k=='pageURL'){q='g';v=s.fl(v,255)}else if(k=='referrer'){q='r';v=s.fl(s.rf(v),255)"
+"}else if(k=='vmk'||k=='visitorMigrationKey')q='vmt';else if(k=='visitorMigrationServer'){q='vmf';if(s.ssl&&s.visitorMigrationServerSecure)v=''}else if(k=='visitorMigrationServerSecure'){q='vmf';if("
+"!s.ssl&&s.visitorMigrationServer)v=''}else if(k=='charSet'){q='ce';if(v.toUpperCase()=='AUTO')v='ISO8859-1';else if(s.em==2)v='UTF-8'}else if(k=='visitorNamespace')q='ns';else if(k=='cookieDomainPe"
+"riods')q='cdp';else if(k=='cookieLifetime')q='cl';else if(k=='variableProvider')q='vvp';else if(k=='currencyCode')q='cc';else if(k=='channel')q='ch';else if(k=='transactionID')q='xact';else if(k=='"
+"campaign')q='v0';else if(k=='resolution')q='s';else if(k=='colorDepth')q='c';else if(k=='javascriptVersion')q='j';else if(k=='javaEnabled')q='v';else if(k=='cookiesEnabled')q='k';else if(k=='browse"
+"rWidth')q='bw';else if(k=='browserHeight')q='bh';else if(k=='connectionType')q='ct';else if(k=='homepage')q='hp';else if(k=='plugins')q='p';else if(s.num(x)){if(b=='prop')q='c'+n;else if(b=='eVar')"
+"q='v'+n;else if(b=='list')q='l'+n;else if(b=='hier'){q='h'+n;v=s.fl(v,255)}}if(v)qs+='&'+q+'='+(k.substring(0,3)!='pev'?s.ape(v):v)}}}return qs};s.ltdf=function(t,h){t=t?t.toLowerCase():'';h=h?h.to"
+"LowerCase():'';var qi=h.indexOf('?');h=qi>=0?h.substring(0,qi):h;if(t&&h.substring(h.length-(t.length+1))=='.'+t)return 1;return 0};s.ltef=function(t,h){t=t?t.toLowerCase():'';h=h?h.toLowerCase():'"
+"';if(t&&h.indexOf(t)>=0)return 1;return 0};s.lt=function(h){var s=this,lft=s.linkDownloadFileTypes,lef=s.linkExternalFilters,lif=s.linkInternalFilters;lif=lif?lif:s.wd.location.hostname;h=h.toLower"
+"Case();if(s.trackDownloadLinks&&lft&&s.pt(lft,',','ltdf',h))return 'd';if(s.trackExternalLinks&&h.substring(0,1)!='#'&&(lef||lif)&&(!lef||s.pt(lef,',','ltef',h))&&(!lif||!s.pt(lif,',','ltef',h)))re"
+"turn 'e';return ''};s.lc=new Function('e','var s=s_c_il['+s._in+'],b=s.eh(this,\"onclick\");s.lnk=s.co(this);s.t();s.lnk=0;if(b)return this[b](e);return true');s.bc=new Function('e','var s=s_c_il['"
+"+s._in+'],f,tcf;if(s.d&&s.d.all&&s.d.all.cppXYctnr)return;s.eo=e.srcElement?e.srcElement:e.target;tcf=new Function(\"s\",\"var e;try{if(s.eo&&(s.eo.tagName||s.eo.parentElement||s.eo.parentNode))s.t"
+"()}catch(e){}\");tcf(s);s.eo=0');s.oh=function(o){var s=this,l=s.wd.location,h=o.href?o.href:'',i,j,k,p;i=h.indexOf(':');j=h.indexOf('?');k=h.indexOf('/');if(h&&(i<0||(j>=0&&i>j)||(k>=0&&i>k))){p=o"
+".protocol&&o.protocol.length>1?o.protocol:(l.protocol?l.protocol:'');i=l.pathname.lastIndexOf('/');h=(p?p+'//':'')+(o.host?o.host:(l.host?l.host:''))+(h.substring(0,1)!='/'?l.pathname.substring(0,i"
+"<0?0:i)+'/':'')+h}return h};s.ot=function(o){var t=o.tagName;t=t&&t.toUpperCase?t.toUpperCase():'';if(t=='SHAPE')t='';if(t){if(t=='INPUT'&&o.type&&o.type.toUpperCase)t=o.type.toUpperCase();else if("
+"!t&&o.href)t='A';}return t};s.oid=function(o){var s=this,t=s.ot(o),p,c,n='',x=0;if(t&&!o.s_oid){p=o.protocol;c=o.onclick;if(o.href&&(t=='A'||t=='AREA')&&(!c||!p||p.toLowerCase().indexOf('javascript"
+"')<0))n=s.oh(o);else if(c){n=s.rep(s.rep(s.rep(s.rep(''+c,\"\\r\",''),\"\\n\",''),\"\\t\",''),' ','');x=2}else if(o.value&&(t=='INPUT'||t=='SUBMIT')){n=o.value;x=3}else if(o.src&&t=='IMAGE')n=o.src"
+";if(n){o.s_oid=s.fl(n,100);o.s_oidt=x}}return o.s_oid};s.rqf=function(t,un){var s=this,e=t.indexOf('='),u=e>=0?','+t.substring(0,e)+',':'';return u&&u.indexOf(','+un+',')>=0?s.epa(t.substring(e+1))"
+":''};s.rq=function(un){var s=this,c=un.indexOf(','),v=s.c_r('s_sq'),q='';if(c<0)return s.pt(v,'&','rqf',un);return s.pt(un,',','rq',0)};s.sqp=function(t,a){var s=this,e=t.indexOf('='),q=e<0?'':s.ep"
+"a(t.substring(e+1));s.sqq[q]='';if(e>=0)s.pt(t.substring(0,e),',','sqs',q);return 0};s.sqs=function(un,q){var s=this;s.squ[un]=q;return 0};s.sq=function(q){var s=this,k='s_sq',v=s.c_r(k),x,c=0;s.sq"
+"q=new Object;s.squ=new Object;s.sqq[q]='';s.pt(v,'&','sqp',0);s.pt(s.un,',','sqs',q);v='';for(x in s.squ)if(x&&(!Object||!Object.prototype||!Object.prototype[x]))s.sqq[s.squ[x]]+=(s.sqq[s.squ[x]]?'"
+",':'')+x;for(x in s.sqq)if(x&&(!Object||!Object.prototype||!Object.prototype[x])&&s.sqq[x]&&(x==q||c<2)){v+=(v?'&':'')+s.sqq[x]+'='+s.ape(x);c++}return s.c_w(k,v,0)};s.wdl=new Function('e','var s=s"
+"_c_il['+s._in+'],r=true,b=s.eh(s.wd,\"onload\"),i,o,oc;if(b)r=this[b](e);for(i=0;i<s.d.links.length;i++){o=s.d.links[i];oc=o.onclick?\"\"+o.onclick:\"\";if((oc.indexOf(\"s_gs(\")<0||oc.indexOf(\".s"
+"_oc(\")>=0)&&oc.indexOf(\".tl(\")<0)s.eh(o,\"onclick\",0,s.lc);}return r');s.wds=function(){var s=this;if(s.apv>3&&(!s.isie||!s.ismac||s.apv>=5)){if(s.b&&s.b.attachEvent)s.b.attachEvent('onclick',s"
+".bc);else if(s.b&&s.b.addEventListener)s.b.addEventListener('click',s.bc,false);else s.eh(s.wd,'onload',0,s.wdl)}};s.vs=function(x){var s=this,v=s.visitorSampling,g=s.visitorSamplingGroup,k='s_vsn_"
+"'+s.un+(g?'_'+g:''),n=s.c_r(k),e=new Date,y=e.getYear();e.setYear(y+10+(y<1900?1900:0));if(v){v*=100;if(!n){if(!s.c_w(k,x,e))return 0;n=x}if(n%10000>v)return 0}return 1};s.dyasmf=function(t,m){if(t"
+"&&m&&m.indexOf(t)>=0)return 1;return 0};s.dyasf=function(t,m){var s=this,i=t?t.indexOf('='):-1,n,x;if(i>=0&&m){var n=t.substring(0,i),x=t.substring(i+1);if(s.pt(x,',','dyasmf',m))return n}return 0}"
+";s.uns=function(){var s=this,x=s.dynamicAccountSelection,l=s.dynamicAccountList,m=s.dynamicAccountMatch,n,i;s.un=s.un.toLowerCase();if(x&&l){if(!m)m=s.wd.location.host;if(!m.toLowerCase)m=''+m;l=l."
+"toLowerCase();m=m.toLowerCase();n=s.pt(l,';','dyasf',m);if(n)s.un=n}i=s.un.indexOf(',');s.fun=i<0?s.un:s.un.substring(0,i)};s.sa=function(un){var s=this;s.un=un;if(!s.oun)s.oun=un;else if((','+s.ou"
+"n+',').indexOf(','+un+',')<0)s.oun+=','+un;s.uns()};s.m_i=function(n,a){var s=this,m,f=n.substring(0,1),r,l,i;if(!s.m_l)s.m_l=new Object;if(!s.m_nl)s.m_nl=new Array;m=s.m_l[n];if(!a&&m&&m._e&&!m._i"
+")s.m_a(n);if(!m){m=new Object,m._c='s_m';m._in=s.wd.s_c_in;m._il=s._il;m._il[m._in]=m;s.wd.s_c_in++;m.s=s;m._n=n;m._l=new Array('_c','_in','_il','_i','_e','_d','_dl','s','n','_r','_g','_g1','_t','_"
+"t1','_x','_x1','_rs','_rr','_l');s.m_l[n]=m;s.m_nl[s.m_nl.length]=n}else if(m._r&&!m._m){r=m._r;r._m=m;l=m._l;for(i=0;i<l.length;i++)if(m[l[i]])r[l[i]]=m[l[i]];r._il[r._in]=r;m=s.m_l[n]=r}if(f==f.t"
+"oUpperCase())s[n]=m;return m};s.m_a=new Function('n','g','e','if(!g)g=\"m_\"+n;var s=s_c_il['+s._in+'],c=s[g+\"_c\"],m,x,f=0;if(!c)c=s.wd[\"s_\"+g+\"_c\"];if(c&&s_d)s[g]=new Function(\"s\",s_ft(s_d"
+"(c)));x=s[g];if(!x)x=s.wd[\\'s_\\'+g];if(!x)x=s.wd[g];m=s.m_i(n,1);if(x&&(!m._i||g!=\"m_\"+n)){m._i=f=1;if((\"\"+x).indexOf(\"function\")>=0)x(s);else s.m_m(\"x\",n,x,e)}m=s.m_i(n,1);if(m._dl)m._dl"
+"=m._d=0;s.dlt();return f');s.m_m=function(t,n,d,e){t='_'+t;var s=this,i,x,m,f='_'+t,r=0,u;if(s.m_l&&s.m_nl)for(i=0;i<s.m_nl.length;i++){x=s.m_nl[i];if(!n||x==n){m=s.m_i(x);u=m[t];if(u){if((''+u).in"
+"dexOf('function')>=0){if(d&&e)u=m[t](d,e);else if(d)u=m[t](d);else u=m[t]()}}if(u)r=1;u=m[t+1];if(u&&!m[f]){if((''+u).indexOf('function')>=0){if(d&&e)u=m[t+1](d,e);else if(d)u=m[t+1](d);else u=m[t+"
+"1]()}}m[f]=1;if(u)r=1}}return r};s.m_ll=function(){var s=this,g=s.m_dl,i,o;if(g)for(i=0;i<g.length;i++){o=g[i];if(o)s.loadModule(o.n,o.u,o.d,o.l,o.e,1);g[i]=0}};s.loadModule=function(n,u,d,l,e,ln){"
+"var s=this,m=0,i,g,o=0,f1,f2,c=s.h?s.h:s.b,b,tcf;if(n){i=n.indexOf(':');if(i>=0){g=n.substring(i+1);n=n.substring(0,i)}else g=\"m_\"+n;m=s.m_i(n)}if((l||(n&&!s.m_a(n,g)))&&u&&s.d&&c&&s.d.createElem"
+"ent){if(d){m._d=1;m._dl=1}if(ln){if(s.ssl)u=s.rep(u,'http:','https:');i='s_s:'+s._in+':'+n+':'+g;b='var s=s_c_il['+s._in+'],o=s.d.getElementById(\"'+i+'\");if(s&&o){if(!o.l&&s.wd.'+g+'){o.l=1;if(o."
+"i)clearTimeout(o.i);o.i=0;s.m_a(\"'+n+'\",\"'+g+'\"'+(e?',\"'+e+'\"':'')+')}';f2=b+'o.c++;if(!s.maxDelay)s.maxDelay=250;if(!o.l&&o.c<(s.maxDelay*2)/100)o.i=setTimeout(o.f2,100)}';f1=new Function('e"
+"',b+'}');tcf=new Function('s','c','i','u','f1','f2','var e,o=0;try{o=s.d.createElement(\"script\");if(o){o.type=\"text/javascript\";'+(n?'o.id=i;o.defer=true;o.onload=o.onreadystatechange=f1;o.f2=f"
+"2;o.l=0;':'')+'o.src=u;c.appendChild(o);'+(n?'o.c=0;o.i=setTimeout(f2,100)':'')+'}}catch(e){o=0}return o');o=tcf(s,c,i,u,f1,f2)}else{o=new Object;o.n=n+':'+g;o.u=u;o.d=d;o.l=l;o.e=e;g=s.m_dl;if(!g)"
+"g=s.m_dl=new Array;i=0;while(i<g.length&&g[i])i++;g[i]=o}}else if(n){m=s.m_i(n);m._e=1}return m};s.vo1=function(t,a){if(a[t]||a['!'+t])this[t]=a[t]};s.vo2=function(t,a){if(!a[t]){a[t]=this[t];if(!a"
+"[t])a['!'+t]=1}};s.dlt=new Function('var s=s_c_il['+s._in+'],d=new Date,i,vo,f=0;if(s.dll)for(i=0;i<s.dll.length;i++){vo=s.dll[i];if(vo){if(!s.m_m(\"d\")||d.getTime()-vo._t>=s.maxDelay){s.dll[i]=0;"
+"s.t(vo)}else f=1}}if(s.dli)clearTimeout(s.dli);s.dli=0;if(f){if(!s.dli)s.dli=setTimeout(s.dlt,s.maxDelay)}else s.dll=0');s.dl=function(vo){var s=this,d=new Date;if(!vo)vo=new Object;s.pt(s.vl_g,','"
+",'vo2',vo);vo._t=d.getTime();if(!s.dll)s.dll=new Array;s.dll[s.dll.length]=vo;if(!s.maxDelay)s.maxDelay=250;s.dlt()};s.t=function(vo,id){var s=this,trk=1,tm=new Date,sed=Math&&Math.random?Math.floo"
+"r(Math.random()*10000000000000):tm.getTime(),sess='s'+Math.floor(tm.getTime()/10800000)%10+sed,y=tm.getYear(),vt=tm.getDate()+'/'+tm.getMonth()+'/'+(y<1900?y+1900:y)+' '+tm.getHours()+':'+tm.getMin"
+"utes()+':'+tm.getSeconds()+' '+tm.getDay()+' '+tm.getTimezoneOffset(),tcf,tfs=s.gtfs(),ta='',q='',qs='',code='',vb=new Object;s.gl(s.vl_g);s.uns();s.m_ll();if(!s.td){var tl=tfs.location,a,o,i,x='',"
+"c='',v='',p='',bw='',bh='',j='1.0',k=s.c_w('s_cc','true',0)?'Y':'N',hp='',ct='',pn=0,ps;if(String&&String.prototype){j='1.1';if(j.match){j='1.2';if(tm.setUTCDate){j='1.3';if(s.isie&&s.ismac&&s.apv>"
+"=5)j='1.4';if(pn.toPrecision){j='1.5';a=new Array;if(a.forEach){j='1.6';i=0;o=new Object;tcf=new Function('o','var e,i=0;try{i=new Iterator(o)}catch(e){}return i');i=tcf(o);if(i&&i.next)j='1.7'}}}}"
+"}if(s.apv>=4)x=screen.width+'x'+screen.height;if(s.isns||s.isopera){if(s.apv>=3){v=s.n.javaEnabled()?'Y':'N';if(s.apv>=4){c=screen.pixelDepth;bw=s.wd.innerWidth;bh=s.wd.innerHeight}}s.pl=s.n.plugin"
+"s}else if(s.isie){if(s.apv>=4){v=s.n.javaEnabled()?'Y':'N';c=screen.colorDepth;if(s.apv>=5){bw=s.d.documentElement.offsetWidth;bh=s.d.documentElement.offsetHeight;if(!s.ismac&&s.b){tcf=new Function"
+"('s','tl','var e,hp=0;try{s.b.addBehavior(\"#default#homePage\");hp=s.b.isHomePage(tl)?\"Y\":\"N\"}catch(e){}return hp');hp=tcf(s,tl);tcf=new Function('s','var e,ct=0;try{s.b.addBehavior(\"#default"
+"#clientCaps\");ct=s.b.connectionType}catch(e){}return ct');ct=tcf(s)}}}else r=''}if(s.pl)while(pn<s.pl.length&&pn<30){ps=s.fl(s.pl[pn].name,100)+';';if(p.indexOf(ps)<0)p+=ps;pn++}s.resolution=x;s.c"
+"olorDepth=c;s.javascriptVersion=j;s.javaEnabled=v;s.cookiesEnabled=k;s.browserWidth=bw;s.browserHeight=bh;s.connectionType=ct;s.homepage=hp;s.plugins=p;s.td=1}if(vo){s.pt(s.vl_g,',','vo2',vb);s.pt("
+"s.vl_g,',','vo1',vo)}if(s.usePlugins)s.doPlugins(s);var l=s.wd.location,r=tfs.document.referrer;if(!s.pageURL)s.pageURL=l.href?l.href:l;if(!s.referrer&&!s._1_referrer){s.referrer=r;s._1_referrer=1}"
+"if((vo&&vo._t)||!s.m_m('d')){s.m_m('g');if(s.lnk||s.eo){var o=s.eo?s.eo:s.lnk;if(!o)return '';var p=s.pageName,w=1,t=s.ot(o),n=s.oid(o),x=o.s_oidt,h,l,i,oc;if(s.eo&&o==s.eo){while(o&&!n&&t!='BODY')"
+"{o=o.parentElement?o.parentElement:o.parentNode;if(!o)return '';t=s.ot(o);n=s.oid(o);x=o.s_oidt}oc=o.onclick?''+o.onclick:'';if((oc.indexOf(\"s_gs(\")>=0&&oc.indexOf(\".s_oc(\")<0)||oc.indexOf(\".t"
+"l(\")>=0)return ''}ta=n?o.target:1;h=s.oh(o);i=h.indexOf('?');h=s.linkLeaveQueryString||i<0?h:h.substring(0,i);l=s.linkName;t=s.linkType?s.linkType.toLowerCase():s.lt(h);if(t&&(h||l))q+='&pe=lnk_'+"
+"(t=='d'||t=='e'?s.ape(t):'o')+(h?'&pev1='+s.ape(h):'')+(l?'&pev2='+s.ape(l):'');else trk=0;if(s.trackInlineStats){if(!p){p=s.pageURL;w=0}t=s.ot(o);i=o.sourceIndex;if(s.gg('objectID')){n=s.gg('objec"
+"tID');x=1;i=1}if(p&&n&&t)qs='&pid='+s.ape(s.fl(p,255))+(w?'&pidt='+w:'')+'&oid='+s.ape(s.fl(n,100))+(x?'&oidt='+x:'')+'&ot='+s.ape(t)+(i?'&oi='+i:'')}}if(!trk&&!qs)return '';s.sampled=s.vs(sed);if("
+"trk){if(s.sampled)code=s.mr(sess,(vt?'&t='+s.ape(vt):'')+s.hav()+q+(qs?qs:s.rq(s.un)),0,id,ta);qs='';s.m_m('t');if(s.p_r)s.p_r();s.referrer=''}s.sq(qs);}else{s.dl(vo);}if(vo)s.pt(s.vl_g,',','vo1',v"
+"b);s.lnk=s.eo=s.linkName=s.linkType=s.wd.s_objectID=s.ppu=s.pe=s.pev1=s.pev2=s.pev3='';if(s.pg)s.wd.s_lnk=s.wd.s_eo=s.wd.s_linkName=s.wd.s_linkType='';if(!id&&!s.tc){s.tc=1;s.flushBufferedRequests("
+")}return code};s.tl=function(o,t,n,vo){var s=this;s.lnk=s.co(o);s.linkType=t;s.linkName=n;s.t(vo)};if(pg){s.wd.s_co=function(o){var s=s_gi(\"_\",1,1);return s.co(o)};s.wd.s_gs=function(un){var s=s_"
+"gi(un,1,1);return s.t()};s.wd.s_dc=function(un){var s=s_gi(un,1);return s.t()}}s.ssl=(s.wd.location.protocol.toLowerCase().indexOf('https')>=0);s.d=document;s.b=s.d.body;if(s.d.getElementsByTagName"
+"){s.h=s.d.getElementsByTagName('HEAD');if(s.h)s.h=s.h[0]}s.n=navigator;s.u=s.n.userAgent;s.ns6=s.u.indexOf('Netscape6/');var apn=s.n.appName,v=s.n.appVersion,ie=v.indexOf('MSIE '),o=s.u.indexOf('Op"
+"era '),i;if(v.indexOf('Opera')>=0||o>0)apn='Opera';s.isie=(apn=='Microsoft Internet Explorer');s.isns=(apn=='Netscape');s.isopera=(apn=='Opera');s.ismac=(s.u.indexOf('Mac')>=0);if(o>0)s.apv=parseFl"
+"oat(s.u.substring(o+6));else if(ie>0){s.apv=parseInt(i=v.substring(ie+5));if(s.apv>3)s.apv=parseFloat(i)}else if(s.ns6>0)s.apv=parseFloat(s.u.substring(s.ns6+10));else s.apv=parseFloat(v);s.em=0;if"
+"(String.fromCharCode){i=escape(String.fromCharCode(256)).toUpperCase();s.em=(i=='%C4%80'?2:(i=='%U0100'?1:0))}s.sa(un);s.vl_l='dynamicVariablePrefix,visitorID,vmk,visitorMigrationKey,visitorMigrati"
+"onServer,visitorMigrationServerSecure,ppu,charSet,visitorNamespace,cookieDomainPeriods,cookieLifetime,pageName,pageURL,referrer,currencyCode';s.va_l=s.sp(s.vl_l,',');s.vl_t=s.vl_l+',variableProvide"
+"r,channel,server,pageType,transactionID,purchaseID,campaign,state,zip,events,products,linkName,linkType';for(var n=1;n<51;n++)s.vl_t+=',prop'+n+',eVar'+n+',hier'+n+',list'+n;s.vl_l2=',tnt,pe,pev1,p"
+"ev2,pev3,resolution,colorDepth,javascriptVersion,javaEnabled,cookiesEnabled,browserWidth,browserHeight,connectionType,homepage,plugins';s.vl_t+=s.vl_l2;s.va_t=s.sp(s.vl_t,',');s.vl_g=s.vl_t+',track"
+"ingServer,trackingServerSecure,trackingServerBase,fpCookieDomainPeriods,disableBufferedRequests,mobile,visitorSampling,visitorSamplingGroup,dynamicAccountSelection,dynamicAccountList,dynamicAccount"
+"Match,trackDownloadLinks,trackExternalLinks,trackInlineStats,linkLeaveQueryString,linkDownloadFileTypes,linkExternalFilters,linkInternalFilters,linkTrackVars,linkTrackEvents,linkNames,lnk,eo,_1_ref"
+"errer';s.va_g=s.sp(s.vl_g,',');s.pg=pg;s.gl(s.vl_g);if(!ss)s.wds()",
w=window,l=w.s_c_il,n=navigator,u=n.userAgent,v=n.appVersion,e=v.indexOf('MSIE '),m=u.indexOf('Netscape6/'),a,i,s;if(un){un=un.toLowerCase();if(l)for(i=0;i<l.length;i++){s=l[i];if(!s._c||s._c=='s_c'){if(s.oun==un)return s;else if(s.fs&&s.sa&&s.fs(s.oun,un)){s.sa(un);return s}}}}w.s_an='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
w.s_sp=new Function("x","d","var a=new Array,i=0,j;if(x){if(x.split)a=x.split(d);else if(!d)for(i=0;i<x.length;i++)a[a.length]=x.substring(i,i+1);else while(i>=0){j=x.indexOf(d,i);a[a.length]=x.subst"
+"ring(i,j<0?x.length:j);i=j;if(i>=0)i+=d.length}}return a");
w.s_jn=new Function("a","d","var x='',i,j=a.length;if(a&&j>0){x=a[0];if(j>1){if(a.join)x=a.join(d);else for(i=1;i<j;i++)x+=d+a[i]}}return x");
w.s_rep=new Function("x","o","n","return s_jn(s_sp(x,o),n)");
w.s_d=new Function("x","var t='`^@$#',l=s_an,l2=new Object,x2,d,b=0,k,i=x.lastIndexOf('~~'),j,v,w;if(i>0){d=x.substring(0,i);x=x.substring(i+2);l=s_sp(l,'');for(i=0;i<62;i++)l2[l[i]]=i;t=s_sp(t,'');d"
+"=s_sp(d,'~');i=0;while(i<5){v=0;if(x.indexOf(t[i])>=0) {x2=s_sp(x,t[i]);for(j=1;j<x2.length;j++){k=x2[j].substring(0,1);w=t[i]+k;if(k!=' '){v=1;w=d[b+l2[k]]}x2[j]=w+x2[j].substring(1)}}if(v)x=s_jn("
+"x2,'');else{w=t[i]+' ';if(x.indexOf(w)>=0)x=s_rep(x,w,t[i]);i++;b+=62}}}return x");
w.s_fe=new Function("c","return s_rep(s_rep(s_rep(c,'\\\\','\\\\\\\\'),'\"','\\\\\"'),\"\\n\",\"\\\\n\")");
w.s_fa=new Function("f","var s=f.indexOf('(')+1,e=f.indexOf(')'),a='',c;while(s>=0&&s<e){c=f.substring(s,s+1);if(c==',')a+='\",\"';else if((\"\\n\\r\\t \").indexOf(c)<0)a+=c;s++}return a?'\"'+a+'\"':"
+"a");
w.s_ft=new Function("c","c+='';var s,e,o,a,d,q,f,h,x;s=c.indexOf('=function(');while(s>=0){s++;d=1;q='';x=0;f=c.substring(s);a=s_fa(f);e=o=c.indexOf('{',s);e++;while(d>0){h=c.substring(e,e+1);if(q){i"
+"f(h==q&&!x)q='';if(h=='\\\\')x=x?0:1;else x=0}else{if(h=='\"'||h==\"'\")q=h;if(h=='{')d++;if(h=='}')d--}if(d>0)e++}c=c.substring(0,s)+'new Function('+(a?a+',':'')+'\"'+s_fe(c.substring(o+1,e))+'\")"
+"'+c.substring(e+1);s=c.indexOf('=function(')}return c;");
c=s_d(c);if(e>0){a=parseInt(i=v.substring(e+5));if(a>3)a=parseFloat(i)}else if(m>0)a=parseFloat(u.substring(m+10));else a=parseFloat(v);if(a>=5&&v.indexOf('Opera')<0&&u.indexOf('Opera')<0){w.s_c=new Function("un","pg","ss","var s=this;"+c);return new s_c(un,pg,ss)}else s=new Function("un","pg","ss","var s=new Object;"+s_ft(c)+";return s");return s(un,pg,ss)}
/**
 * $Id: calloutinterface.js 76074 2009-11-19 20:53:10Z kchiu $
 * $Author: kchiu $
 * $Revision: 76074 $
 * $Name$
 * $Date: 2009-11-19 12:53:10 -0800 (Thu, 19 Nov 2009) $
 *
 * @jsRequire DomUtils
 * @jsRequire interfaces.Interface
 * @jsRequire interfaces.AnchoredInterface
 *
 *
 * @version    $Revision: 76074 $
 * @author     Philip Snyder <philip@pricegrabber.com>
 * @copyright  Copyright &copy; 2006, Philip Snyder, PriceGrabber.com
 * @see        interfaces.Interface
 * @see        interfaces.AnchoredInterface
 */

/**
 * CalloutInterface Constructor / Definition
 *
 * This interface is built on top of the Interface object
 * and is NOT intended to be instantiated directly. See
 * documentation on interfaces.Interface for a complete
 * explanation.
 *
 * @access public
 * @since  v1.1
 * @return CalloutInterface
 */
function CalloutInterface() {
    this.calloutId      = null;
    this.elemId         = null;
    this.anchorId       = null;
    this.calloutPadding = 0;
    // Callout interface implementation
    this.erase             = CalloutInterface_Erase;
    this.draw              = CalloutInterface_Draw;
    this.alignElement      = CalloutInterface_AlignElement;
    // Anchored interface implementation
    this.disableScroll     = false;
    this.getAnchorX        = AnchoredInterface_GetAnchorX;
    this.getAnchorY        = AnchoredInterface_GetAnchorY;
    this.getAnchorZ        = AnchoredInterface_GetAnchorZ;
    this.getAnchorWidth    = AnchoredInterface_GetAnchorWidth;
    this.getAnchorHeight   = AnchoredInterface_GetAnchorHeight;
    this.getElemWidth      = AnchoredInterface_GetElemWidth;
    this.getElemHeight     = AnchoredInterface_GetElemHeight;
    this.getAnchorPosition = AnchoredInterface_GetAnchorPosition;
    this.setAnchor         = AnchoredInterface_SetAnchor;
    this.implement(AnchoredInterface);
    return this;
} // End CalloutInterface

// Setup CalloutInterface prototype chain
CalloutInterface.prototype             = new Interface;
CalloutInterface.prototype.constructor = CalloutInterface;
CalloutInterface.superclass            = Interface.prototype;






/****** BEGIN EDIT SECTION ******/

/**
 * General Settings
 *
 * Defines general settings for the callout interface. These can
 * be overridden by any script after inclusion of this file. 
 *
 * Example:
 *
 *    <script language="JavaScript">
 *    CalloutInterface.settings.images.left.src = 'http://i.pgcdn.com/images/callout/left_arrow.gif';
 *    // Or even...
 *    CalloutInterface.settings.images.left = { src: 'http://i.pgcdn.com/images/callout/left_arrow.gif', height: 20, width: 10 };
 *    </script>
 *
 * Note that 'http://i.pgcdn.com' is included... if you
 * don't include the full path, the url will be relative to your
 * web server -- which in general is wrong except for during
 * development.
 *
 * @access public
 * @since  v1.1
 * @var    CalloutInterface.settings   struct
 */
CalloutInterface.settings = {
    images: {
        left:   { src: util.resourceManager.get('http://i.pgcdn.com/images/balloon/left_arrow.gif'),   height: 23, width: 11 },
        top:    { src: util.resourceManager.get('http://i.pgcdn.com/images/balloon/top_arrow.gif'),    height: 11, width: 23 },
        right:  { src: util.resourceManager.get('http://i.pgcdn.com/images/balloon/right_arrow.gif'),  height: 21, width: 11 },
        bottom: { src: util.resourceManager.get('http://i.pgcdn.com/images/balloon/bottom_arrow.gif'), height: 11, width: 23 }
    }
};

/****** END EDIT SECTION ******/







/**
 * CalloutInterface.erase()
 *
 * "Erases" the callout by removing the dom elements created with CalloutInterface.draw().
 *
 * @access public
 * @since  v0.0.1a
 * @return void
 */
function CalloutInterface_Erase() {
    //window.messageQueue.add( new Message('CalloutInterface_Erase', 'called') );
    var callout = document.getElementById(this.calloutId);
    if (callout) {
        //callout.parentNode.removeChild(callout);
        DomUtils.removeElement(callout);
    }
    callout = null;
    //window.messageQueue.add( new Message('CalloutInterface_Erase', 'finished') );
} // End CalloutInterface_Erase


/**
 * CalloutInterface.draw()
 *
 * "Draws" the actual callout by creating the necessary dom elements and applying them to
 * the object's element.
 *
 * @access public
 * @since  v0.0.1a
 * @return void
 */
function CalloutInterface_Draw() {
    //window.messageQueue.add( new Message('CalloutInterface_Draw', 'called') );
    if (!this.calloutId) this.calloutId = this.id+'_Callout';
    var elem    = document.getElementById(this.elemId);
    if (!elem) throw new Error('Unable to find element: '+this.elemId);
    var anchor  = document.getElementById(this.anchorId);
    if (!anchor) throw new Error('Unable to find anchor element: '+this.anchorId);
    if (elem && anchor) {
        elem.style.padding = '1px';
        elem.style.border  = '1px solid #dadada';
        //elem.style.backgroundColor = '#ffffff';
        var callout = document.getElementById(this.calloutId);
        if (callout && callout.parentNode) DomUtils.removeElement(callout);
        var pos                  = this.getAnchorPosition();
        callout                  = document.createElement('img');
        callout.id               = this.calloutId;
        callout.style.position   = 'absolute';
        callout.style.visibility = 'hidden';
        var body = document.getElementsByTagName('body')[0];
        body.appendChild(callout);
        var imgDetails;
        //alert('Callout interface: '+pos);

        switch (pos) {
            case AnchoredInterface.ALIGN.RIGHT_TOP:
                //if (typeof(writeDebug) == 'function') writeDebug('right_top');
                imgDetails        = CalloutInterface.settings.images.top;
                //window.messageQueue.add( new Message('callout img', 'right_top: '+imgDetails.src) );
                callout.src       = util.resourceManager.get(imgDetails.src);
                callout.height    = imgDetails.height;
                callout.width     = imgDetails.width;
                //callout.style.top = (DomUtils.getElementHeight(elem)+2)+'px';
                //if (DomUtils.browser.isIE() && document.compatMode == 'BackCompat') {
                //    eStyle  = DomUtils.getCurrentStyle(elem);
                //    height  = parseInt(DomUtils.getElementHeight(elem));
                //    callout.style.top = parseInt(height+1)+'px';
                //}
                callout.style.left = this.calloutPadding+'px';
                break;
            case AnchoredInterface.ALIGN.RIGHT_BOTTOM:
                //if (typeof(writeDebug) == 'function') writeDebug('right_bottom');
                imgDetails         = CalloutInterface.settings.images.top;
                //window.messageQueue.add( new Message('callout img', 'right_bottom: '+imgDetails.src) );
                callout.src        = util.resourceManager.get(imgDetails.src);
                callout.height     = imgDetails.height;
                callout.width      = imgDetails.width;
                //callout.style.top  = '-'+(callout.height+(DomUtils.browser.isIE() ? -1 : -1))+'px';
                //callout.style.left = this.calloutPadding+'px';
                break;
            case AnchoredInterface.ALIGN.LEFT_TOP:
                imgDetails         = CalloutInterface.settings.images.top;
                //window.messageQueue.add( new Message('callout img', 'left_top: '+imgDetails.src) );
                callout.src        = util.resourceManager.get(imgDetails.src);
                callout.height     = imgDetails.height;
                callout.width      = imgDetails.width;
                //callout.style.top  = (DomUtils.getElementHeight(elem)+2)+'px';
                //window.messageQueue.add( new Message('CalloutInterface_Draw', 'getting elem width for callout') );
                //callout.style.left = (DomUtils.getElementWidth(elem)-1-callout.width-this.calloutPadding)+'px';
                //window.messageQueue.add( new Message('CalloutInterface_Draw', 'finished elem width for callout') );
                break;
            case AnchoredInterface.ALIGN.LEFT_BOTTOM:
            default:
                //if (typeof(writeDebug) == 'function') writeDebug('left_bottom');
                imgDetails         = CalloutInterface.settings.images.bottom;
                //window.messageQueue.add( new Message('callout img', 'left_bottom: '+imgDetails.src) );
                callout.src        = util.resourceManager.get(imgDetails.src);
                callout.height     = imgDetails.height;
                callout.width      = imgDetails.width;
                //callout.style.top  = '-'+(callout.height+(DomUtils.browser.isIE() ? -1 : -1))+'px';
                //window.messageQueue.add( new Message('CalloutInterface_Draw', 'getting elem width for callout') );
                //callout.style.left = (DomUtils.getElementWidth(elem)-1-callout.width-this.calloutPadding)+'px';
                //callout.style.left = (DomUtils.getElementLeft(elem)-1-callout.width-this.calloutPadding)+'px';
                //window.messageQueue.add( new Message(funcname(this), 'finished elem width for callout') );
                break;
        }

        //elem.appendChild(callout);
        //callout.style.zIndex = parseInt(DomUtils.getZIndex(elem))+1;
        //this.alignElement(pos);
        //CalloutInterface_AlignElement.call(this, pos);
    }
    //window.messageQueue.add( new Message('CalloutInterface_Draw', 'finished') );
} // End CalloutInterface_Draw


/**
 * CalloutInterface.alignElement()
 *
 * Aligns the object's element by adjusting its left & top by the proper calculations (which are done
 * in this function) on the height & width & style of the callout.
 *
 * @access public
 * @since  v0.0.1a
 * @see    AnchoredInterface
 * @param  string    pos      One of the constants defined in AnchoredInterface.ALIGN
 * @return void
 */
function CalloutInterface_AlignElement(pos) {
    //window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'called') );
    pos = pos || this.getAnchorPosition();
    var elem    = document.getElementById(this.elemId);
    if (!elem)    throw new Error('Unable to find element: '+this.elemId);
    var callout = document.getElementById(this.calloutId);
    if (!callout) throw new Error('Unable to find callout element: '+this.calloutId);
    var anchor  = document.getElementById(this.anchorId);
    if (!anchor)  throw new Error('Unable to find anchor element: '+this.anchorId);

    var aTop    = parseInt( DomUtils.getElementTop(anchor) );
    var aLeft   = parseInt( DomUtils.getElementLeft(anchor) );
    var aHeight = parseInt( DomUtils.getElementHeight(anchor) );
    var aWidth  = parseInt( DomUtils.getElementWidth(anchor) );

    var eTop    = parseInt( DomUtils.getElementTop(elem) );
    var eLeft   = parseInt( DomUtils.getElementLeft(elem) );
    var eHeight = parseInt( DomUtils.getElementHeight(elem) );
    var eWidth  = parseInt( DomUtils.getElementWidth(elem) );

    var cHeight = parseInt( DomUtils.getElementHeight(callout) );
    var cWidth  = parseInt( DomUtils.getElementWidth(callout) );
    switch (pos) {
        /**
         * Right Top alignment means:
         *
         *             +--------+
         *             | anchor |
         *             +--------+
         *                 /\
         *    +-----------'  '--+
         *    | elem            |
         *    +-----------------+
         */
        case AnchoredInterface.ALIGN.RIGHT_TOP:
            // Adjust main element's position to accomodate callout element
            elem.style.top       = parseInt( eTop  + cHeight )+'px';
            elem.style.left      = parseInt( eLeft + this.calloutPadding )+'px';
            // Position the callout element
            callout.style.left   = parseInt( aLeft + parseInt( aWidth / 2 ) - parseInt(cWidth / 2) )+'px';
            callout.style.top    = parseInt( aTop  + aHeight + 1)+'px';
            callout.style.zIndex = parseInt(DomUtils.getZIndex(elem))+1;
/*
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'alignment position: right_top') );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.left   = '+DomUtils.getElementLeft(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.top    = '+DomUtils.getElementTop(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.height = '+DomUtils.getElementHeight(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.width  = '+DomUtils.getElementWidth(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.left     = '+DomUtils.getElementLeft(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.top      = '+DomUtils.getElementTop(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.height   = '+DomUtils.getElementHeight(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.width    = '+DomUtils.getElementWidth(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'callout.style.left  = '+DomUtils.getElementLeft(callout)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'callout.style.top   = '+DomUtils.getElementTop(callout)) );
*/
            break;
        /**
         * Right Bottom alignment means:
         *
         *    +-----------------+
         *    | elem            |
         *    +-----------,  ,--+
         *                 \/
         *             +--------+
         *             | anchor |
         *             +--------+
         */
        case AnchoredInterface.ALIGN.RIGHT_BOTTOM:
            // Adjust main element's position to accomodate callout element
            elem.style.top       = parseInt( eTop  + cHeight - 1 )+'px';
            elem.style.left      = parseInt( eLeft + this.calloutPadding )+'px';
            // Position the callout element
            callout.style.left   = parseInt( aLeft + parseInt(aWidth/2) - parseInt( cWidth / 2) )+'px';
            callout.style.top    = parseInt( aTop + aHeight )+'px';
            callout.style.zIndex = parseInt( DomUtils.getZIndex(elem) )+1;
/*
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'alignment position: right_bottom') );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.left   = '+DomUtils.getElementLeft(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.top    = '+DomUtils.getElementTop(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.height = '+DomUtils.getElementHeight(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.width  = '+DomUtils.getElementWidth(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.left     = '+DomUtils.getElementLeft(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.top      = '+DomUtils.getElementTop(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.height   = '+DomUtils.getElementHeight(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.width    = '+DomUtils.getElementWidth(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'callout.style.left  = '+DomUtils.getElementLeft(callout)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'callout.style.top   = '+DomUtils.getElementTop(callout)) );
*/
            break;
        /**
         * Left Top alignment means:
         *
         *    +--------+
         *    | anchor |
         *    +--------+
         *        /\
         *    +--'  '-----------+
         *    | elem            |
         *    +-----------------+
         */
        case AnchoredInterface.ALIGN.LEFT_TOP:
            // Adjust main element's position to account for the callout
            elem.style.top       = parseInt( eTop + cHeight - 1 )+'px';
            elem.style.left      = parseInt( eLeft - this.calloutPadding )+'px';
            // Position the callout element
            callout.style.left   = parseInt( aLeft + parseInt(aWidth / 2) - parseInt(cWidth / 2) - 1 )+'px';
            callout.style.top    = parseInt( aTop + aHeight )+'px';
            callout.style.zIndex = parseInt( DomUtils.getZIndex(elem) )+1;
/*
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'alignment position: left_top') );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.left   = '+DomUtils.getElementLeft(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.top    = '+DomUtils.getElementTop(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.height = '+DomUtils.getElementHeight(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.width  = '+DomUtils.getElementWidth(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.left     = '+DomUtils.getElementLeft(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.top      = '+DomUtils.getElementTop(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.height   = '+DomUtils.getElementHeight(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.width    = '+DomUtils.getElementWidth(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'callout.style.left  = '+DomUtils.getElementLeft(callout)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'callout.style.top   = '+DomUtils.getElementTop(callout)) );
*/
            break;
        /**
         * Left Bottom alignment means:
         *
         *    +-----------------+
         *    | elem            |
         *    +--,  ,-----------+
         *        \/
         *    +--------+
         *    | anchor |
         *    +--------+
         */
        case AnchoredInterface.ALIGN.LEFT_BOTTOM:
        default:
            // Adjust main element's position to account for the callout
            elem.style.top       = parseInt( eTop - cHeight - 2)+'px';
            elem.style.left      = parseInt( eLeft - this.calloutPadding )+'px';
            // Position the callout element
            callout.style.left   = parseInt( aLeft - parseInt( cWidth / 2 ) + parseInt( aWidth / 2 ) - 1 )+'px';
            callout.style.top    = parseInt( aTop - cHeight )+'px';
            callout.style.zIndex = parseInt( DomUtils.getZIndex(elem) )+1;
/*
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'alignment position: left_bottom') );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.left   = '+DomUtils.getElementLeft(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.top    = '+DomUtils.getElementTop(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.height = '+DomUtils.getElementHeight(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'anchor.style.width  = '+DomUtils.getElementWidth(anchor)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.left     = '+DomUtils.getElementLeft(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.top      = '+DomUtils.getElementTop(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.height   = '+DomUtils.getElementHeight(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'elem.style.width    = '+DomUtils.getElementWidth(elem)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'callout.style.left  = '+DomUtils.getElementLeft(callout)) );
            window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'callout.style.top   = '+DomUtils.getElementTop(callout)) );
*/
            break;
    }
    //window.messageQueue.add( new Message('CalloutInterface_AlignElement', 'finished') );
} // End CalloutInterface_AlignElement

