/* Omniture H.14 code */

var om_track = "prop1,prop3,prop7,prop5,prop6,prop9,prop10,prop11,prop13,prop16,prop20,prop32,prop34,prop41,prop42,prop43,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";

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); 
}

// Jacques please do something appropriate with this
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.                 */

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;
}

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.14.
Copyright 1997-2008 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 d="function s_dr"
+"(x,o,n){var i=x.indexOf(o);if(i>=0&&x.split)x=(x.split(o)).join(n);"
+"else while(i>=0){x=x.substring(0,i)+n+x.substring(i+o.length);i=x.i"
+"ndexOf(o)}return x}w.s_dr=s_dr;function s_d(x) {var t='`^@$#',l='01"
+"23456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',d,n=0"
+",b,k,w,i=x.lastIndexOf('~~');if(i>0){d=x.substring(0,i);x=x.substri"
+"ng(i+2);while(d){w=d;i=d.indexOf('~');if(i>0){w=d.substring(0,i);d="
+"d.substring(i+1)}else d='';b=parseInt(n/62);k=n-b*62;k=t.substring("
+"b,b+1)+l.substring(k,k+1);x=s_dr(x,k,w);n++}for(i=0;i<5;i++){w=t.su"
+"bstring(i,i+1);x=s_dr(x,w+' ',w)}}return x}w.s_d=s_d;",c=".substrin"
+"g(~.indexOf(~return ~=fun`K(~){`Os=^u~`t $6~;$6~.toLowerCase()~`cFu"
+"n`K('e`s`Os=s_c_il['+@i+']~};s.~.length~.toUpperCase~`cObject~s.wd~"
+"t^D~.location~')q='~dynamicAccount~link~s.apv~ction~$l$X~)$6x^X!Obj"
+"ect||!Object.prototype||!Object.prototype[x])~@G^Al)@G^Al['+@i+'].m"
+"rq(\"'+un+'\")'~var ~s.pt(~ookieDomainPeriods~,`s,'~while(~);s.~.pr"
+"otocol~){$6~visitor~=''~:'')~;@F^Vs[k],255)}~s_c2f~javaEnabled~=new"
+" ~.lastIndexOf('~tm.get~@5\"$Qs.b.addBehavior('# default# ~onclick~"
+"ternalFilters~entElement~Name~javascriptVersion~=parseFloat(~cookie"
+"~parseInt(~s.^J~Type~o^joid~browser~','~else~referrer~colorDepth~St"
+"ring~.host~s.rep(~}catch(e){~r=s.m(f)?s[f](~}$6~s.un~s.eo~s.sq~t=s."
+"ot(o)~track~j='1.~)?'Y':'N'~$dURL~^jc_i~s.ismac~lugins~=='~;for(~Sa"
+"mpling~s.rc[un]~s.b.addEventListener~Download~tfs~resolution~.get@I"
+"()~s.eh~s.isie~s.vl_l~s.vl_t~Height~t,h){t=t?t~isopera~escape(~scre"
+"en.~s.fl(~harCode~&&(~variableProvider~s.gg('objectID')~&&s.~:'';h="
+"h?h~e&&l$kSESSION'~');~f',~_'+~Date~name~home$d~.s_~s.c_r(~s.rl[u~o"
+".href~Lifetime~Width~sEnabled~'){q='~b.attachEvent~&&l$kNONE'){~Ext"
+"ernalLinks~this~charSet~onerror~currencyCode~s=s_gi(~e$SElement~;s."
+"gl(s.vl_g~.parent~Array~lnk~Opera~eval(~Math.~s.fsg~s.ns6~docum~s.o"
+"un~conne~InlineStats~Track~'0123456789~s[k]=~window~onload~Time~s.e"
+"pa(~s.c_w(~o.type~(s.ssl~n=s.oid(o)~LeaveQuery~')>=~&&t~'=')~){n=~+"
+"1))~' '+~s.t()}~\",''),~=s.oh(o);~+(y<1900?~ingServer~s_gs~true~ses"
+"s~campaign~lif~;fun~,100)~s.co(~s._in~x in ~='s_~ffset~s.c_d~'&pe~s"
+".gv(~s.qav~s.pl~=(apn~sqs',q);~Year(~=s.n.app~&&!~(''+~(\")>=~)+'/~"
+"',s~s()+':'+~){p=~():''~a):f(~){v=s.n.~channel~if(~un)~.target~o.va"
+"lue~etscape~(ns?ns:~s_')t=t~omePage~++}~')<~){x~1);~e))~'+n~height~"
+"events~trk~random~code~un,~try{~'MSIE ~.src~INPUT'~floor(~s.pg~s.nu"
+"m(~s.ape(~s.c_gd~s.dc~.inner~transa~Events~page~.set~Group,~Match,~"
+".fromC~++){~?'':~!='~='+~(\")<~?'&~+';~(f){~>=5)~&&i>~[b](~=l[n];~~"
+"fun`K `ae$p`Ox`X,s=0,e,a,b,c;`S1){e=f`1'\"@z);b=f`1'\\\\',s);c=f`1"
+"\"\\n\",s)`6e<0||(b>=0&&b<$Ie=b`6e<0||(c>=0&&c<$Ie=c`6e>=0$G+=(e>s?"
+"f`0s,e)`Y+(e==c?'\\\\n':'\\\\'+f`0e,e@T;s=e+1}`t `2x+f`0s)}`2f}w.`a"
+"e=`ae@f`K `aa$p`Os=f`1'(')+1,e=f`1')'),a`X,c;`Ss>=0&&s<e){c=f`0s,s+"
+"1)`6c==`s)a+='\",\"';`5(\"\\n\\r\\t \")`1c)<0)a+=c;s$E`2a?'\"'+a+'"
+"\"':a}w.`aa=`ae@f`K `a(cc){cc`X+cc;`Ofc='`Of`cFun`K(@z=cc`1';',cc`1"
+"'{')),e=cc`d}'),o,a,d,q,c,f,h,x;fc+=`aa(cc)+',\"`Os`C;';c=cc`0s+1,e"
+");s=c`1'fun`K^d`Ss>=0){d=1;q`X;x=0;f=c`0s);a=`aa(f);e=o=c`1'{@z);e+"
+"+;`Sd>0){h=c`0e,e+1)`6q`Vh==q@vx)q`X`6h^D\\\\')x=x?0:1;`t x=0}`t{$6"
+"h^D\"'||h==\"'\")q=h`6h^D{')d++`6h^D}')d--^1d>0)e$Ec=c`00,s)+'new F"
+"un`K('+(a?a+`s`Y+'\"'+`ae(c`0o+1,$I+'\")'+c`0e+$Hs=c`1'fun`K')}fc+="
+"`ae(c)$o`2s\");';@5fc);`2f}w.`a=`a`6pg){fun`K s_co(o){`O^y\"_\",1,$"
+"H`2@ho)}w^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A=un;"
+"`5(`s+@A+`s)`1$7<0)@A+=`s+un;^2s()`9t`3`4,$M=1,tm`c^g,sed=Math&&@6$"
+"N?@6$U@6$N()*10000000000000):`e@I(),@c='s'+@6$U`e@I()/10800000)%10+"
+"sed,y=`e@t),vt=`e^g(@y'+`eMonth(@y'@Yy+1900:y)+@U`eHour$0`eMinute$0"
+"`eSeconds()+@U`eDay()+@U`e@IzoneO@l(),^J=s.g^J(),ta`X,q`X,qs`X@0`Tu"
+"ns()`6!s.td){`Otl=^J`F,a,o,i,x`X,c`X,v`X,p`X,bw`X,bh`X,^70',k=@K's_"
+"cc`s@b',0^8,hp`X,ct`X,pn=0,ps`6`w&&`w.prototype){^71'`6j.match){^72"
+"'`6tm$eUTC^g){^73'`6^N&&^B&&`J$q^74'`6pn.toPrecision){^75';a`c@2`6a"
+".forEach){^76';i=0;o`C;@5'$Qi`cIterator(o)`z}')`6i&&i.next)^77'}}}}"
+"^1`J>=4)x=^Uwidth+'x'+^U$K`6s.isns||s.^S`V`J>=3$4`b(^8`6`J>=4){c=^U"
+"pixelDepth;bw=`D$a^o;bh=`D$a^Q}}@q=s.n.p^C}`5^N`V`J>=4$4`b(^8;c=^U`"
+"v`6`J$q{bw=s.d.@9`i.o@l^o;bh=s.d.@9`i.o@l^Q`6!^B^ab){`fh$D^dhp=s.b."
+"isH$D(tl^8`z}\");`fclientCaps^dct=s.b.@B`K`p`z}\")}}}`t r`X^1@q)`Sp"
+"n<@q`A&&pn<30){ps=^V@q[pn].^h@g$o'`6p`1ps)<0)p+=ps;pn$Es.^K=x;s.`v="
+"c;s.`k=j;s.`b=v;s.`m^p=k;s.`r^o=bw;s.`r^Q=bh;s.@B`K`p=ct;s.^i=hp;s."
+"p^C=p;s.td=1^1s.useP^C)s.doP^C(s);`Ol=`D`F,r=^J.@9ent.`u`6!s.^9)s.^"
+"9=l`6!s.`u)s.`u=r`6s.@3||^3){`Oo=^3?^3:s.@3`6!o)`2'';`Op=@o'$d`j'),"
+"w=1,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>0)`J`ls.u`0@8+10"
+"));`t `J`lv`Tem=0`6`w$h^W){i=^T`w$h^W(256))`B(`Tem=(i^D%C4%80'?2:(i"
+"^D%U0100'?1:0))}s.sa(un`Tvl_l='`WID,vmk,ppu,^v,`W`jspace,c`Q,`m^n,$"
+"d`j,^9,`u,^x';^P=^O+',^Y,$5,server,$d`p,$b`KID,purchaseID,@d,state,"
+"zip,$L,products,`I`j,`I`p'^E`On=1;n<51;n++)^P+=',prop$J+',eVar$J+',"
+"hier$J;^O2='^K,`v,`k,`b,`m^p,`r^o,`r^Q,@B`K`p,^i,p^C';^P+=`s+^O2;s."
+"vl_g=^P+',`W^F,`W^F$f`HSele`K,`HList,`H$g^6^ILinks,^6^t,^6@C,`I@O`w"
+",`I^IFile`ps,`IEx`h,`IIn`h,`I@DVars,`I@D$c,`I`js,@3';$V=pg@0)`6!ss)"
+"`Ds()}",
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'){
if(s.oun==un)return s;else if(s.fs(s.oun,un)){s.sa(un);return s}}}}
eval(d);c=s_d(c);i=c.indexOf("function s_c(");eval(c.substring(0,i))
if(!un)return 0;c=c.substring(i);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){eval(c);return new s_c(un,pg,ss)}else s=s_c2f(c);return s(
un,pg,ss)}s_gi()

/**
 * $Id: domutils.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
 */

/**
 * DomUtils function namespace
 *
 *
 * @access public
 * @since  v1.1
 */
var DomUtils = new Object;


/**
 * Browser detection function namespace
 *
 * @access public
 * @since  v1.4.8.1.2.4
 */
DomUtils.browser = new Object;

/**
 * RegEx definitions for browser detections based on property tested
 *
 * @access public
 * @since  v1.4.8.1.2.4
 */
DomUtils.browser.regexes = {
    overflowX: new Array(/Firefox\/1\.0/),
    overflowY: new Array(/Firefox\/1\.0/)
};

/**
 * Determines if the browser supports CSS overflowX property correctly
 *
 * @access public
 * @since  v1.4.8.1.2.4
 */
DomUtils.browser.supportsOverflowX = function() {
    for (var i=0; i<DomUtils.browser.regexes.overflowX.length; i++) {
        var regex = DomUtils.browser.regexes.overflowX[i];
        if (navigator.userAgent.match(regex)) {
            return false;
        }
    }
    return true;
}



/**
 * Determines if the browser supports CSS overflowY property correctly
 *
 * @access public
 * @since  v1.4.8.1.2.4
 */
DomUtils.browser.supportsOverflowY = function() {
    for (var i=0; i<DomUtils.browser.regexes.overflowY.length; i++) {
        var regex = DomUtils.browser.regexes.overflowY[i];
        if (navigator.userAgent.match(regex)) {
            return false;
        }
    }
    return true;
}

/**
 * Determines if the browser supports the Document Object Model
 *
 * @access public
 * @since  v1.4.8.1.2.4
 */
DomUtils.browser.supportsDom = function() {
    return (document.getElementById) ? true : false;
}

/**
 * Determines if the browser is Internet Explorer
 *
 * @access public
 * @since  v1.4.8.1.2.4
 */
DomUtils.browser.isIE = function() {
    return (document.all && navigator.appName.indexOf('Microsoft Internet Explorer') > -1) ? true : false;
}

/**
 * Determines if the browser is Internet Explorer 6
 *
 * @access public
 * @since  v1.4.8.1.2.4
 */
DomUtils.browser.isIE6 = function(){
	temp=navigator.appVersion.split('MSIE');
    ieVer=parseInt(temp[1]);
    return (ieVer == 6)?1:0;	
}

/**
 * Determines if the browser is Safari
 *
 * @access public
 * @since  v1.4.8.1.2.4
 */
DomUtils.browser.isSafari = function() {
    return (navigator.userAgent.toLowerCase().indexOf('safari') > -1) ? true : false;
}







/**
 * Fixes pseudo-leaks in Internet Explorer.
 *
 * Use this method anytime you need to remove an element
 * since it will do it in a memory clean manner for both
 * Internet Explorer and Firefox.
 *
 * @access public
 * @since  v1.4.8.1.2
 * @param  DomNode   elem
 * @return void
 */
DomUtils.removeElement = function(elem) {
    if (DomUtils.browser.isIE()) {
        var garbageBin = document.getElementById('IELeakGarbageBin');
        if (!garbageBin) {
            garbageBin = document.createElement('DIV');
            garbageBin.id = 'IELeakGarbageBin';
            garbageBin.style.display = 'none';
            document.body.appendChild(garbageBin);
        }
        // move the element to the garbage bin
        garbageBin.appendChild(elem);
        garbageBin.innerHTML = '';
    } else {
        elem.parentNode.removeChild(elem);
    }
}




/**
 * Returns the window width in pixels (integer form)
 *
 * @access public
 * @since  v1.1
 * @param  Window    win    Window object (optional)
 * @return integer
 */
DomUtils.getWindowWidth   = function(win) {
    win = (win) ? win : window;
    if (document.compatMode == 'CSS1Compat') return parseInt(win.document.body.parentNode.clientWidth);
    else if (DomUtils.browser.isIE())        return parseInt(win.document.body.clientWidth);
    else                                     return parseInt(win.innerWidth);
}


/**
 * Returns the window height in pixels (integer form)
 *
 * @access public
 * @since  v1.1
 * @param  Window    win    Window object (optional)
 * @return integer
 */
DomUtils.getWindowHeight  = function(win) {
    win = (win) ? win : window;
    if (document.compatMode == 'CSS1Compat') return parseInt(win.document.body.parentNode.clientHeight);
    else if (DomUtils.browser.isIE())        return parseInt(win.document.body.clientHeight);
    else                                     return parseInt(win.innerHeight);
}


/**
 * Returns the window's scrolled position on the x-axis in pixels (integer form)
 *
 * @access public
 * @since  v1.1
 * @param  Window    win    Window object (optional)
 * @return integer
 */
DomUtils.getWindowScrollX = function(win) {
    win = (win) ? win : window;
    if (document.compatMode == 'CSS1Compat' && win.document.body.parentNode.scrollLeft) return parseInt(win.document.body.parentNode.scrollLeft);
    else if (DomUtils.browser.isIE())					  return parseInt(win.document.body.scrollLeft);
    else if (typeof( window.pageXOffset ) == 'number' || window.pageXOffset === 0 )   return parseInt(window.pageXOffset);
    else										          return parseInt(win.scrollX);
}


/**
 * Returns the window's scrolled position on the y-axis in pixels (integer form)
 *
 * @access public
 * @since  v1.1
 * @param  Window    win    Window object (optional)
 * @return integer
 */
DomUtils.getWindowScrollY = function(win) {
    win = (win) ? win : window;
    if (document.compatMode == 'CSS1Compat' && win.document.body.parentNode.scrollTop) return parseInt(win.document.body.parentNode.scrollTop);
    else if (DomUtils.browser.isIE())                   return parseInt(win.document.body.scrollTop);
    else if (typeof( window.pageYOffset ) == 'number' ) return parseInt(window.pageYOffset);
    else                                                return parseInt(win.scrollY);
}


///**
// * Returns the element's width after css clipping
// *
// * @access public
// * @since  v1.1
// * @deprecated       Unnecessary -- I think. Keep the code just in case
// * @param  Element   elem  Element to get the clip width
// * @return integer
// */
//DomUtils.getElementClipWidth = function(elem) {
//    var currStyle = DomUtils.getCurrentStyle(elem);
//    var pre = document.createElement('pre');
//    var str = "current style props:\n";
//    for (var prop in currStyle) {
//        str += prop+": "+currStyle[prop]+"\n";
//    }
//    pre.appendChild(document.createTextNode(str));
//    document.body.appendChild(pre);
//}


/**
 * Returns the element width in pixels (integer form)
 *
 * @access public
 * @since  v1.1
 * @param  Element    elem    Element object
 * @return integer
 */
DomUtils.getElementWidth  = function(elem) {
    var eStyle, prop, width;
    var w = 0;
    if (elem.tagName == 'IMG')                    w = parseInt(elem.width);
    else if (document.compatMode == 'CSS1Compat') w = parseInt(elem.offsetWidth);
    else if (document.compatMode == 'BackCompat') {
        eStyle = DomUtils.getCurrentStyle(elem);
        width  = parseInt(eStyle.width);
        if (DomUtils.browser.isIE()) width = elem.offsetWidth;
        var bLeft  = parseInt(eStyle.borderLeft);
        var bRight = parseInt(eStyle.borderRight);
        var pLeft  = parseInt(eStyle.paddingLeft);
        var pRight = parseInt(eStyle.paddingRight);
        w  = parseInt(width);
        w += !isNaN(bLeft)  ? parseInt(bLeft)  : 0;
        w += !isNaN(bRight) ? parseInt(bRight) : 0;
        w += !isNaN(pLeft)  ? parseInt(pLeft)  : 0;
        w += !isNaN(pRight) ? parseInt(pRight) : 0;
    } else if (DomUtils.browser.isSafari()) {
        if (typeof(writeDebug) == 'function') writeDebug('browser is safari...');
        width = elem.offsetWidth;
        w = parseInt(width);
    }
    return w;
}


/**
 * Returns the element height in pixels (integer form)
 *
 * @access public
 * @since  v1.1
 * @param  Element    elem    Element object
 * @return integer
 */
DomUtils.getElementHeight = function(elem) {
    var h = 0;
    var eStyle, height;
    if (elem.tagName && elem.tagName == 'IMG')    h = parseInt(elem.height);
    else if (document.compatMode == 'CSS1Compat') h = parseInt(elem.offsetHeight);
    else if (document.compatMode == 'BackCompat') {
        eStyle  = DomUtils.getCurrentStyle(elem);
        height  = parseInt(eStyle.height);
        if (DomUtils.browser.isIE()) height = elem.offsetHeight;
        var bTop    = parseInt(eStyle.borderTop);
        var bBottom = parseInt(eStyle.borderBottom);
        var pTop    = parseInt(eStyle.paddingTop);
        var pBottom = parseInt(eStyle.paddingBottom);
        h  = parseInt(height);
        if (!DomUtils.browser.isIE()) {
            h += !isNaN(bTop)    ? parseInt(bTop)    : 0;
            h += !isNaN(bBottom) ? parseInt(bBottom) : 0;
            h += !isNaN(pTop)    ? parseInt(pTop)    : 0;
            h += !isNaN(pBottom) ? parseInt(pBottom) : 0;
        } else {
            h -= !isNaN(bTop) ? parseInt(bTop) : 0;
            h -= !isNaN(bBottom) ? parseInt(bBottom) : 0;
        }
    } else if (DomUtils.browser.isSafari()) {
        height = elem.offsetHeight;
        h = parseInt(height);
    }
    return h;
}


/**
 * Returns the element's left position in pixels (integer form)
 *
 * @todo   add error handling code -- find out what falls into catch code block
 * @access public
 * @since  v1.1
 * @param  Element    elem    Element object
 * @return integer
 */
DomUtils.getElementLeft   = function DomUtils_GetElementLeft(elem) {
    var left = 0;
    try {
        if (elem.offsetParent) {
            while (elem.offsetParent) {
                left += parseInt(elem.offsetLeft);
                elem  = elem.offsetParent;
            }
        } else if (elem.x) {
            left += parseInt(elem.x);
        }
        return left;
    } catch (e) {
        /**
         */
        return 0;
    }
}


/**
 * Returns the element's top position in pixels (integer form)
 *
 * @todo   add error handling code -- find out what falls into catch code block
 * @access public
 * @since  v1.1
 * @param  Element    elem    Element object
 * @return integer
 */
DomUtils.getElementTop    = function(elem) {
    try {
        var top = 0;
        if (elem.offsetParent) {
            while (elem.offsetParent) {
                top += parseInt(elem.offsetTop);
                elem = elem.offsetParent;
            }
        } else if (elem.y) {
            top += parseInt(elem.y);
        }
        return top;
    } catch (e) {
        return 0;
    }
}







/**
 * Centers an element inside its window.
 *
 * @access public
 * @since  v1.1
 * @param  Element    elem    Element object
 * @return void
 */
DomUtils.center = function(elem) {
    var wWidth  = parseInt(DomUtils.getWindowWidth());
    var wHeight = parseInt(DomUtils.getWindowHeight());
    var eWidth  = parseInt(DomUtils.getElementWidth(elem));
    var eHeight = parseInt(DomUtils.getElementHeight(elem));
    var xScroll = parseInt(DomUtils.getWindowScrollX());
    var yScroll = parseInt(DomUtils.getWindowScrollY());
    
    var left = parseInt(wWidth / 2) - parseInt(eWidth / 2) + xScroll;
    var top  = parseInt(wHeight / 2) - parseInt(eHeight / 2) + yScroll;
    elem.style.left = left+'px';
    elem.style.top  = top+'px';
}







/**
 * Returns the element's current style object
 *
 * @access public
 * @since  v1.1
 * @param  Element   elem   Element object
 * @return Style
 */
DomUtils.getCurrentStyle  = function(elem) {
    if (elem && elem.currentStyle) {
        return elem.currentStyle;
    } else if (document.defaultView && document.defaultView.getComputedStyle) {
        return document.defaultView.getComputedStyle(elem, '');
    }
}

/**
 * Copies the current style applied on element 1 to element 2.
 * 
 * @access public
 * @since  v1.8
 * @param  Element    elem1
 * @param  Element    elem2
 * @return void
 */
DomUtils.duplicateStyle = function(elem1, elem2) {
    var style1 = DomUtils.getCurrentStyle(elem1);
    //var str = 'style1: '+style1+"<br/>\n";
    for (prop in style1) {
        try {
            //elem2.style[prop] = style1[prop];
            eval('elem2.style.'+prop+' = style1.'+prop);
            //var span = document.createElement('span');
            //span.innerHTML = 'set style1.'+prop+': '+style1[prop]+"<br/>\n";
            //document.getElementsByTagName('body')[0].appendChild(span);
        } catch(e) {
            //var span = document.createElement('span');
            //span.innerHTML = 'failed setting style1.'+prop+': '+style1[prop]+"<br/>\n";
            //document.getElementsByTagName('body')[0].appendChild(span);
        }
    }
};


/**
 * Returns the element's zIndex attribute (integer form)
 *
 * @access public
 * @since  v1.1
 * @param  Element   elem   Element object
 * @return integer
 */
DomUtils.getZIndex = function(elem) {
    var eStyle = DomUtils.getCurrentStyle(elem);
    var zIdx   = 0;
    if (eStyle.zIndex && isNaN(eStyle.zIndex)) {
        if (elem.offsetParent) {
            while (elem.offsetParent) {
                zIdx   = (parseInt(eStyle.zIndex) > zIdx) ? parseInt(eStyle.zIndex) : zIdx;
                eStyle = DomUtils.getCurrentStyle(elem);
                elem   = elem.offsetParent;
            }
        }
    } else {
        zIdx = parseInt(eStyle.zIndex);
    }
    return zIdx;
}




///**
// * alerts an image's ready state if not complete
// *
// * @access public
// * @deprecated       I highly doubt this is used anywhere?
// * @since  v1.1
// * @param  Window    win    Window object (optional)
// * @return integer
// */
//DomUtils.checkImage = function() {
//    if (this.readyState != 'complete') {
//        alert(this.src+"\n"+this.readyState);
//    }
//}




/**
 * Returns a reference to the document's body tag
 *
 * @access public
 * @since  v1.1
 * @return Element
 */
DomUtils.getBody = function() {
    return document.getElementsByTagName('body')[0];
}





/**
 * Returns the window height in pixels (integer form)
 *
 * This should probably be deprecated / removed in favor
 * of net.RequestQueue
 *
 * @access public
 * @deprecated       Use net.RequestQueue instead
 * @since  v1.1
 * @return integer
 */
DomUtils.XmlHttp = function() {
    var request = null;
    try {
        ActiveXObject.prototype.jsonRequest = null;
        request = new ActiveXObject('Msxml2.XMLHTTP');
    } catch (e) {
        try {
            ActiveXObject.prototype.jsonRequest = null;
            request = new ActiveXObject('Microsoft.XMLHTTP');
        } catch (e) {
            try {
                XMLHttpRequest.prototype.jsonRequest = null;
                request = new XMLHttpRequest();
            } catch (e) {
                //request = new IframeHttpRequest();
                request = null;
            }
        }
    }
    return request;
}




















/**
 * Adds method function to Function objects
 *
 * @access public
 * @since  v1.1
 * @param  string    name   Name of the method to create
 * @param  Function  func   Function reference to assign to the method
 * @return Function
 */
Function.prototype.method = function(name, func) {
    this.prototype[name] = func;
    return this;
}

/**
 * Returns true if param is not a javascript object
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isAlien(a) {
   return isObject(a) && typeof a.constructor != 'function';
}

/**
 * Returns true if the param is an array
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isArray(a) {
    return isObject(a) && a.constructor == Array;
}

/**
 * Returns true if the param is a boolean data type
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean 
 */
function isBoolean(a) {
    return typeof a == 'boolean';
}

/**
 * Returns true if the param is empty (contains no value)
 *
 * @access public
 * @since  v1.1
 * @param  mixed     o      test this param
 * @return boolean
 */
function isEmpty(o) {
    var i, v;
    if (isObject(o)) {
        for (i in o) {
            v = o[i];
            if (isUndefined(v) && isFunction(v)) {
                return false;
            }
        }
    }
    return true;
}

/**
 * Returns true if the param is a float
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isFloat(a) {
    return typeof a == 'number' && parseFloat(a) == a;
}

/**
 * Returns true if the param is a function
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isFunction(a) {
    return typeof a == 'function';
}

/**
 * Returns true if the param is an integer
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isInteger(a) {
    return typeof a == 'number' && parseInt(a) == a;
}

/**
 * Returns true if the param is null
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isNull(a) {
    return typeof a == 'object' && !a;
}

/**
 * Returns true if the param is a number
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isNumber(a) {
    return typeof a == 'number' && isFinite(a);
}

/**
 * Returns true if the param is an object
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isObject(a) {
    return (a && typeof a == 'object') || isFunction(a);
}

/**
 * Returns true if the param is a string
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isString(a) {
    return typeof a == 'string';
}

/**
 * Returns true if the param is undefined
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function isUndefined(a) {
    return typeof a == 'undefined';
}

/**
 * Fix PNG images for IE
 *
 * @access public
 * @since  v1.1
 * @param  mixed     a      test this param
 * @return boolean
 */
function fixPNG_IE (image) {
	//Only fix PNGs for IE
	if(DomUtils.browser.isIE()) { 
		image.outerHTML = '<div style="width:' + image.width + '; height:' + image.height + '; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + image.src + '\', sizingMethod=\'scale\');"></div>';
	}
}



































/** BEGIN getElementsBySelector CODE ******************************************/

/* document.getElementsBySelector(selector)
   - returns an array of element objects from the current document
     matching the CSS selector. Selectors can contain element names, 
     class names and ids and can be nested. For example:
     
       elements = document.getElementsBySelect('div#main p a.external')
     
     Will return an array of all 'a' elements with 'external' in their 
     class attribute that are contained inside 'p' elements that are 
     contained inside the 'div' element which has id="main"

   New in version 0.4: Support for CSS2 and CSS3 attribute selectors:
   See http://www.w3.org/TR/css3-selectors/#attribute-selectors

   Version 0.4 - Simon Willison, March 25th 2003
   -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows
   -- Opera 7 fails 
*/

function getAllChildren(e) {
  // Returns all children of element. Workaround required for IE5/Windows. Ugh.
  return e.all ? e.all : e.getElementsByTagName('*');
}

document.getElementsBySelector = function(selector) {
  // Attempt to fail gracefully in lesser browsers
  if (!document.getElementsByTagName) {
    return new Array();
  }
  // Split selector in to tokens
  var tokens = selector.split(' ');
  var currentContext = new Array(document);
  for (var i = 0; i < tokens.length; i++) {
    token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
    if (token.indexOf('#') > -1) {
      // Token is an ID selector
      var bits = token.split('#');
      var tagName = bits[0];
      var id = bits[1];
      var element = document.getElementById(id);
      if (tagName && element.nodeName.toLowerCase() != tagName) {
        // tag with that ID not found, return false
        return new Array();
      }
      // Set currentContext to contain just this element
      currentContext = new Array(element);
      continue; // Skip to next token
    }
    if (token.indexOf('.') > -1) {
      // Token contains a class selector
      var bits = token.split('.');
      var tagName = bits[0];
      var className = bits[1];
      if (!tagName) {
        tagName = '*';
      }
      // Get elements matching tag, filter them for class selector
      var found = new Array;
      var foundCount = 0;
      for (var h = 0; h < currentContext.length; h++) {
        var elements;
        if (tagName == '*') {
            elements = getAllChildren(currentContext[h]);
        } else {
            elements = currentContext[h].getElementsByTagName(tagName);
        }
        for (var j = 0; j < elements.length; j++) {
          found[foundCount++] = elements[j];
        }
      }
      currentContext = new Array;
      var currentContextIndex = 0;
      for (var k = 0; k < found.length; k++) {
        if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {
          currentContext[currentContextIndex++] = found[k];
        }
      }
      continue; // Skip to next token
    }
    // Code to deal with attribute selectors
    if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
      var tagName = RegExp.$1;
      var attrName = RegExp.$2;
      var attrOperator = RegExp.$3;
      var attrValue = RegExp.$4;
      if (!tagName) {
        tagName = '*';
      }
      // Grab all of the tagName elements within current context
      var found = new Array;
      var foundCount = 0;
      for (var h = 0; h < currentContext.length; h++) {
        var elements;
        if (tagName == '*') {
            elements = getAllChildren(currentContext[h]);
        } else {
            elements = currentContext[h].getElementsByTagName(tagName);
        }
        for (var j = 0; j < elements.length; j++) {
          found[foundCount++] = elements[j];
        }
      }
      currentContext = new Array;
      var currentContextIndex = 0;
      var checkFunction; // This function will be used to filter the elements
      switch (attrOperator) {
        case '=': // Equality
          checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
          break;
        case '~': // Match one of space seperated words 
          checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
          break;
        case '|': // Match start with value followed by optional hyphen
          checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
          break;
        case '^': // Match starts with value
          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
          break;
        case '$': // Match ends with value - fails with "Warning" in Opera 7
          checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
          break;
        case '*': // Match ends with value
          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
          break;
        default :
          // Just test for existence of attribute
          checkFunction = function(e) { return e.getAttribute(attrName); };
      }
      currentContext = new Array;
      var currentContextIndex = 0;
      for (var k = 0; k < found.length; k++) {
        if (checkFunction(found[k])) {
          currentContext[currentContextIndex++] = found[k];
        }
      }
      // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);
      continue; // Skip to next token
    }
    // If we get here, token is JUST an element (not a class or ID selector)
    tagName = token;
    var found = new Array;
    var foundCount = 0;
    for (var h = 0; h < currentContext.length; h++) {
      var elements = currentContext[h].getElementsByTagName(tagName);
      for (var j = 0; j < elements.length; j++) {
        found[foundCount++] = elements[j];
      }
    }
    currentContext = found;
  }
  return currentContext;
}

/* That revolting regular expression explained 
/^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/
  \---/  \---/\-------------/    \-------/
    |      |         |               |
    |      |         |           The value
    |      |    ~,|,^,$,* or =
    |   Attribute 
   Tag
*/
/** END getElementsBySelector CODE ********************************************/

// Alias old DomUtils.getElementsBySelector to this same function
// in order to maintain compatibility if anyone was using the old one
DomUtils.getElementsBySelector = document.getElementsBySelector;



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

/**
 * Class is an event manager that handles attaching events and
 * maintaining function/variable scope in a cross-browser manner.
 *
 * Note: Do not define your handler as an anonymous function as this
 * will cause rampant memory leaks in Internet Explorer.
 *
 * Basic example:
 *
 *    <script language="JavaScript" src="js/classes/eventmanager.js" type="text/javascript"></script>
 *    <script language="JavaScript">
 *    function Document_KeyDown_Handler(e) {
 *        e = (e) ? e : ((window.event) ? window.event : null);
 *        if (e) alert(e.keyCode);
 *    }
 *    window.addEvent(document, 'keydown', Document_KeyDown_Handler, document, true);
 *    </script>
 *
 * @since     v0.0.1a
 * @return    EventManager
 */


function EventManager() {

    window.onload = null;
    window.onunload = null;
//    this.addEvent    = EventManager_AddEvent;
//    this.removeEvent = EventManager_RemoveEvent;
//    this.addOnLoad   = EventManager_AddOnLoad;
//    this.addOnUnload = EventManager_AddOnUnload;
//    this.addOnResize = EventManager_AddOnResize;
    
    
    
    this.alterEventObject = function(e) { };
    
    
	var registry      = {};
	var targetIdCount = 0;

	function registryKey(id, type, fn) {
		return id+'#'+type+'#'+fn;
	}

	function isInRegistry(key) {
		return registry[key] != null;
	}

	function invoke(key, evt) {
		if (!isInRegistry(key)) return null;
		if (window.eventManager) {
    		var _evt = window.eventManager.alterEventObject(evt);
    		if (typeof(_evt) == 'object') evt = _evt;
    		var handler = registry[key];
    		var scope   = handler.scope;
    		scope.__EventManager_Listener__ = handler.listener;
    		scope.__EventManager_Listener__(evt);
    		scope.__EventManager_Listener__ = null;
    		return true;
		} else {
		    return false;
		}
	}

	function targetId(target) {
		if (target == document)      return "__EventManager_ID_document";
		if (target == window)        return "__EventManager_ID_window";
		if (target+'' == xmlhttp+'') return "__EventManager_ID_xmlhttp";
		try {
    		var id = target.getAttribute('id') || target.uniqueID;
    		if (id == null) {
    			id = "__EventManager_ID_"+(targetIdCount++);
    			target.setAttribute('id', id);
    		}
		} catch (e) {
//		    throw new Error('target: "'+target+'" vs xmlhttp: "'+xmlhttp+'"');
		}
		return id;
	}

	this.isEventRegistered = function(target, type, listener) {
    		var key = registryKey(targetId(target), type, listener);
		return isInRegistry(key);
	}


    this.addEvent = function(target, type, listener, scope, capture) {
    	var key, handler;
    	key   = registryKey(targetId(target), type, listener);
    	scope = scope || target;
    	if (isInRegistry(key)) window.removeEvent(target, type, listener);
    	handler = { listener: listener, scope: scope, capture: capture, invoker: function(evt) { invoke(key, evt); } };
    	registry[key] = handler;
    	if (target.addEventListener) target.addEventListener(type, handler.invoker, capture);
    	else if (target.attachEvent) target.attachEvent('on'+type, handler.invoker);
    	else                         return false;
    	if (typeof(window.addOnUnload) == 'function') window.addOnUnload( function() { /*alert('calling window.removeEvent.');*/ window.removeEvent(target, type, listener); target = type = listener = null; } );
    	scope = null;
    	return true;
    }

    this.removeEvent = function(target, type, listener) {
        var key, invoker, capture;
        key = registryKey(targetId(target), type, listener);
        if (!isInRegistry(key)) return false;
        invoker       = registry[key].invoker;
        capture       = registry[key].capture;
        registry[key] = null;
        if (target.removeEventListener) target.removeEventListener(type, invoker, capture);
        else if (target.detachEvent)    target.detachEvent("on" + type, invoker);
        else                            return false;
        return true;
    }


//    this.handleOnload = function() {
//        for (var i=0; i<window.eventManager.onload.length; i++) {
//            window.eventManager.onload[i]();
//        }
//    }
    
//    this.addOnLoad = function(func) {
//        if (window.onload != this.handleOnload) {
//            window.eventManager.onload[window.eventManager.onload.length] = window.onload;
//            window.onload = this.handleOnload;
//        }
//        window.eventManager.onload[window.eventManager.onload.length] = func;
////        if (typeof(window.onload) != 'function') window.onload = func;
////        else {
////            var oldLoad = window.onload;
////            window.onload = function() {
////                oldLoad();
////                func();
////            }
////        }
//    }
    
//    this.addOnUnload = function(func) {
//        if (typeof(window.onunload) != 'function') window.onunload = func;
//        else {
//            var oldUnload = window.onunload;
//            window.onunload = function() {
//                alert('running '+oldUnload);
//                oldUnload();
//                alert('running '+func);
//                func();
//            }
//        }
//    }
    
    this.addOnResize = function(func) {
        if (typeof(window.onresize) != 'function') window.onresize = func;
        else {
            var oldResize = window.onresize;
            window.onresize = function() {
                oldResize();
                func();
            }
        }
    }
    
    return this;
}

EventManager.prototype             = new Object;
EventManager.prototype.constructor = EventManager;
EventManager.superclass            = Object.prototype;

window.eventManager = new EventManager();
window.EventManager = window.eventManager;

function EventManager_CleanWindow() {
    window.onafterprint   = null;
    window.onbeforeprint  = null;
    window.onbeforeunload = null;
    window.onblur         = null;
    window.ondragdrop     = null;
    window.onerror        = null;
    window.onfocus        = null;
    window.onhelp         = null;
    window.onload         = null;
    window.onmove         = null;
    window.onresize       = null;
    window.onscroll       = null;
    window.onunload       = null;
}

EventManager.instance = null;
EventManager.getInstance = function() {
    if (!EventManager.instance) EventManager.instance = new EventManager();
    return EventManager.instance;
}

/**
 * Methods opened up to the window object:
 *
 *   addEvent
 *   removeEvent
 *   addOnload
 *   addOnUnload
 *   addOnResize
 *
 */

window.addEvent = function(target, type, listener, scope, capture) {
    if (window.eventManager) window.eventManager.addEvent(target, type, listener, scope, capture);
    else return false;
}

window.removeEvent = function(target, type, listener) {
    if (window.eventManager) window.eventManager.removeEvent(target, type, listener);
    else return false;
}

window.isEventRegistered = function(target, type, listener) {	
    if (window.eventManager) return window.eventManager.isEventRegistered(target, type, listener);
    else return false;
}





/**
 * Handles for multiple onLoad functions.
 */
window.loadQueue = new Array();
// Alias the names so it makes sense for everyone
window.addOnLoad = window.addOnload = function Window_AddOnLoad(func) {
    if (!(window.onload instanceof Function)) {
        if (window.onload) {
            var oldOnload = window.onload;
            window.loadQueue.push(function() { oldOnload });
        }
        window.onload = Window_OnLoadQueue;
    } else if (window.onload !== Window_OnLoadQueue) {
        loadQueue.push(window.onload);
        window.onload = Window_OnLoadQueue;
    }
    var sz = window.loadQueue.length;
    window.loadQueue[sz] = func;
}
function Window_OnLoadQueue() {
    for (var i=0; i<window.loadQueue.length; i++) {
        var loadFunc = window.loadQueue[i];
        loadFunc();
    }
}
window.onload = Window_OnLoadQueue;








/**
 * Handles for multiple onUnload functions.
 */
window.unloadQueue = new Array();
function Window_OnUnloadQueue() {
    for (var i=0; i<window.unloadQueue.length; i++) {
        var unloadFunc = window.unloadQueue[i];
        unloadFunc();
    }
    /**
     * Google Maps API Version 2 introduced a javascript
     * closure cleanup function... call it if its defined.
     */ 
    if (typeof(GUnload) == 'function') GUnload();
    // Cleanup event manager memory space
    window.onload       = null;
    window.onunload     = null;
    window.onresize     = null;
    window.eventManager = null;
    window.EventManager = null;
}
// Alias the names so it make sense for everyone
window.addOnunload = window.addOnUnLoad = window.addOnUnload = function Window_AddOnUnload(func) {
    if (!(window.onunload instanceof Function)) {
        if (window.onunload) {
            var oldUnload = window.onunload;
            window.unloadQueue.push(function() { oldUnload });
        }
        window.onunload = Window_OnUnloadQueue;
    } else if (window.onunload !== Window_OnUnloadQueue) {
        window.unloadQueue.push(window.onunload);
        window.onunload = Window_OnUnloadQueue;
    }
    window.unloadQueue.push(func);
}
window.onunload = Window_OnUnloadQueue;










window.addOnResize = function(func) {
    if (window.eventManager) window.eventManager.addOnResize(func);
    else return false;
}



if (typeof window.addOnUnload == 'function') window.addOnUnload(EventManager_CleanWindow);









/**
 * I have to instantiate an XMLHttpRequest
 * in order to come up with a valid id for them in the event manager.
 */
var xmlhttp = null;
try {
    xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
    try {
        xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
    } catch (e) {
        try {
            xmlhttp = new XMLHttpRequest();
        } catch (e) {
            //this.request = new IframeHttpRequest();
            xmlhttp = null;
        }
    }
}



var AJAX_REQUEST = {
    DEBUG:           false,
    DEFAULT_ASYNC:   false,
    DEFAULT_METHOD:  'POST',
    DEFAULT_URL:     'rpcServer.php',
    MAX_REQUESTS:    10,
    REQUEST_TIMEOUT: 30000
}
if (!window.ajax)  {
    window.ajax = {
        NEXT_ID:        0,
        COUNT:          0,
        MAX_CONCURRENT: AJAX_REQUEST.MAX_REQUESTS
    };
}

function AjaxRequest(method, url, async, requestTimeout, user, password) {

    this.abort = function() {
        if (AJAX_REQUEST.DEBUG && typeof(writeDebug) == 'function') writeDebug('AjaxRequest.abort() called.');
        if (this.request && this.busy) {
            if (window.ajaxRequests && window.ajaxTimers && this.requestId >= 0) {
                if (AJAX_REQUEST.DEBUG && typeof(writeDebug) == 'function') writeDebug('abort(): clearing timeout: '+self.requestId+', timerId: '+window.ajaxTimers[self.requestId]);
                clearTimeout(window.ajaxTimers[this.requestId]);
                window.ajaxTimers[this.requestId] = null;
                window.ajaxRequests[this.requestId] = null;
            }
            this.request.onreadystatechange = function() { }; // Clear it for IE
            this.request.abort();
            this.request = null;
            this.busy    = false;
            window.ajax.COUNT--;
        }
    }
    this.send  = function() {
        try {
            this.request = new ActiveXObject('Msxml2.XMLHTTP');
        } catch (e) {
            try {
                this.request = new ActiveXObject('Microsoft.XMLHTTP');
            } catch (e) {
                try {
                    this.request = new XMLHttpRequest();
                } catch (e) {
                    this.request = null;
                }
            }
        }
        if (this.request) {
            var url     = this.url;
            if (this.async && this.callback) {
                this.request.onreadystatechange = this.onStateChange;
                if (this.requestTimeout != null && this.timeout > 0 && this.requestId == null) {
                    if (window.ajax.COUNT < window.ajax.MAX_CONCURRENT) {
                        this.requestId = window.ajax.NEXT_ID++;
                        window.ajax.COUNT++;
                    } else {
                        alert('Too many concurrent ajax requests.');
                        return false;
                    }
                    if (AJAX_REQUEST.DEBUG && typeof(writeDebug) == 'function') writeDebug('XmlHttpRequest '+this.requestId+' setting timeout: '+this.requestTimeout);
                    self.requestTimer = setTimeout(function() { self.abort(); self.requestTimer = null; if (typeof(writeDebug) == 'function') writeDebug('XmlHttpRequest '+self.requestId+' aborted.'); }, this.requestTimeout);
                }
            }
            if (this.method == 'POST') {
                this.request.open(this.method, this.url, this.async, this.user, this.password);
                this.request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
                this.busy = true;
                this.request.send(this.params.join('&'));
            } else {
                url = this.url+(this.params.length > 0 ? '?'+this.params.join('&') : '');
                this.request.open(this.method, url, this.async, this.user, this.password);
                this.busy = true;
                this.request.send('');
            }

            if (!this.async) {
                this.busy = false;;
                return this.request.responseXML;
            }
        }
    }

    this.setParameter = function(name, value) {
        if (AJAX_REQUEST.DEBUG && typeof(writeDebug) == 'function') writeDebug('AjaxRequest.setParameter('+name+', '+value+') called.');
        this.params.push(name+'='+encodeURIComponent(value));
    }

    this.setResponseType = function(ResponseType){
       this.ResponseType = (ResponseType=='html' ? 'html' : 'xml');
    }

    this.setCallback = function(func) {
        if (typeof(func) == 'function') this.callback = func;
        else                            alert('Unable to set callback handler. Must be a function.');
    }

    this.onStateChange = function() {
        if (self.request && self.request.readyState && self.request.readyState == 4) {
            if (self.requestTimer && self.requestId) {
                if (AJAX_REQUEST.DEBUG && typeof(writeDebug) == 'function') writeDebug('XmlHttpRequest '+this.requestId+' clearing timeout.');
                clearTimeout(self.requestTimer);
                self.requestTimer = null;
                self.requestId    = null;
            }
            self.busy = false;
            if (AJAX_REQUEST.DEBUG && typeof(writeDebug) == 'function') writeDebug('XmlHttpRequest.reponseText: '+self.request.responseText);
//			console.log(self.request.responseText);
            if(self.ResponseType && self.ResponseType=='html'){
               self.callback(self.request.responseText);
            }else{
               self.callback(self.request.responseXML);
            }
        }
    }



    this.method         = method          || AJAX_REQUEST.DEFAULT_METHOD;
    this.url            = url             || AJAX_REQUEST.DEFAULT_URL;
    this.async          = async           || AJAX_REQUEST.DEFAULT_ASYNC;
    this.requestTimeout = requestTimeout  || AJAX_REQUEST.REQUEST_TIMEOUT;
    this.user           = user            || null;
    this.password       = password        || null;
    this.callback       = null;
    this.params         = new Array;
    this.request        = null;
    this.requestTimer   = null;
    this.ResponseType   = 'xml'; // html or xml



    /**
     * JavaScript Closure Variable
     */
    var self = this;

}

function submitSearchRequest(page_id, requestParams, vendorIds, st, sv){

	var keyword = document.getElementById('shopForInput').value;
	var ajax = new AjaxRequest('POST', '/rpc_searchRequest.php', true, 3000);
	ajax.setParameter('keyword', keyword);
	if(page_id){
		ajax.setParameter('page_id', page_id);
	}
	if(requestParams){
		ajax.setParameter('requestParams', requestParams);
	}
	if(vendorIds){
		ajax.setParameter('vendorIds', vendorIds);
	}
    if( st ) {
		ajax.setParameter('st', st);
    }
    if( sv ) {
		ajax.setParameter('sv', sv);
    }

	var searchBar = document.getElementById('pgSiteSearch');
	if(searchBar && searchBar.getElementsByTagName('select')[0]){
		var searchSelect = searchBar.getElementsByTagName('select')[0].value;
		ajax.setParameter('searchLocation', searchSelect);
	}

	ajax.setCallback(getSearchAction);
	ajax.send();

	return false;

}

function getSearchAction(xml){

	var search_action = xml.getElementsByTagName('search_action');
	var json = search_action[0].firstChild; 
	var url = eval(json.firstChild.nodeValue);
    var a = document.createElement('a');
    //Non-IE Browsers (click is IE-specific)
    if( !a.click ) {
        location.href = url;
        return url;
    }
    //Workaround to make IE pass a referrer
    else {
        a.setAttribute('href', url);
        a.style.display = 'none';
        document.body.appendChild(a);
        a.click();
    }
}
