// Author: Shuns (www.netgrow.com.au/files), Version: 1.1
var dump3=function(object, showTypes){var dump='';var st=typeof showTypes=='undefined' ? true : showTypes;var winName='dumpWin';var browser=_dumpIdentifyBrowser();var w=760;var h=500;var leftPos=screen.width ?(screen.width-w)/ 2 : 0;var topPos=screen.height ?(screen.height-h)/ 2 : 0;var settings='height='+h+',width='+w+',top='+topPos+',left='+leftPos+',scrollbars=yes,menubar=yes,status=yes,resizable=yes';var title='Dump';var script='function tRow(s){t=s.parentNode.lastChild;tTarget(t, tSource(s));}function tTable(s){var switchToState=tSource(s);var table=s.parentNode.parentNode;for(var i=1;i < table.childNodes.length;i++){t=table.childNodes[i];if(t.style){tTarget(t, switchToState);}}}function tSource(s){if(s.style.fontStyle=="italic"||s.style.fontStyle==null){s.style.fontStyle="normal";s.title="click to collapse";return "open";}else{s.style.fontStyle="italic";s.title="click to expand";return "closed";}}function tTarget(t, switchToState){if(switchToState=="open"){t.style.display="";}else{t.style.display="none";}}';dump+=(/string|number|undefined|boolean/.test(typeof(object))||object==null)? object : recurse(object, typeof object);winName=window.open('', winName, settings);if(browser.indexOf('ie')!=-1||browser=='opera'||browser=='ie5mac'||browser=='safari'){winName.document.write('<html><head><title> '+title+' </title><script type="text/javascript">'+script+'</script><head>');winName.document.write('<body>'+dump+'</body></html>');}else{winName.document.body.innerHTML=dump;winName.document.title=title;var ffs=winName.document.createElement('script');ffs.setAttribute('type', 'text/javascript');ffs.appendChild(document.createTextNode(script));winName.document.getElementsByTagName('head')[0].appendChild(ffs);}winName.focus();function recurse(o, type){var i;var j=0;var r='';type=_dumpType(o);switch(type){case 'regexp':var t=type;r+='<table'+_dumpStyles(t,'table')+'><tr><th colspan="2"'+_dumpStyles(t,'th')+'>'+t+'</th></tr>';r+='<tr><td colspan="2"'+_dumpStyles(t,'td-value')+'><table'+_dumpStyles('arguments','table')+'><tr><td'+_dumpStyles('arguments','td-key')+'><i>RegExp: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o+'</td></tr></table>';j++;break;case 'date':var t=type;r+='<table'+_dumpStyles(t,'table')+'><tr><th colspan="2"'+_dumpStyles(t,'th')+'>'+t+'</th></tr>';r+='<tr><td colspan="2"'+_dumpStyles(t,'td-value')+'><table'+_dumpStyles('arguments','table')+'><tr><td'+_dumpStyles('arguments','td-key')+'><i>Date: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o+'</td></tr></table>';j++;break;case 'function':var t=type;var a=o.toString().match(/^.*function.*?\((.*?)\)/im);var args=(a==null||typeof a[1]=='undefined'||a[1]=='')? 'none' : a[1];r+='<table'+_dumpStyles(t,'table')+'><tr><th colspan="2"'+_dumpStyles(t,'th')+'>'+t+'</th></tr>';r+='<tr><td colspan="2"'+_dumpStyles(t,'td-value')+'><table'+_dumpStyles('arguments','table')+'><tr><td'+_dumpStyles('arguments','td-key')+'><i>Arguments: </i></td><td'+_dumpStyles(type,'td-value')+'>'+args+'</td></tr><tr><td'+_dumpStyles('arguments','td-key')+'><i>Function: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o+'</td></tr></table>';j++;break;case 'domelement':var t=type;r+='<table'+_dumpStyles(t,'table')+'><tr><th colspan="2"'+_dumpStyles(t,'th')+'>'+t+'</th></tr>';r+='<tr><td'+_dumpStyles(t,'td-key')+'><i>Node Name: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o.nodeName.toLowerCase()+'</td></tr>';r+='<tr><td'+_dumpStyles(t,'td-key')+'><i>Node Type: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o.nodeType+'</td></tr>';r+='<tr><td'+_dumpStyles(t,'td-key')+'><i>Node Value: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o.nodeValue+'</td></tr>';r+='<tr><td'+_dumpStyles(t,'td-key')+'><i>innerHTML: </i></td><td'+_dumpStyles(type,'td-value')+'>'+o.innerHTML+'</td></tr>';j++;break;}if(/object|array/.test(type)){for(i in o){var t=_dumpType(o[i]);if(j < 1){r+='<table'+_dumpStyles(type,'table')+'><tr><th colspan="2"'+_dumpStyles(type,'th')+'>'+type+'</th></tr>';j++;}if(typeof o[i]=='object' && o[i]!=null){r+='<tr><td'+_dumpStyles(type,'td-key')+'>'+i+(st ? ' ['+t+']' : '')+'</td><td'+_dumpStyles(type,'td-value')+'>'+recurse(o[i], t)+'</td></tr>';}else if(typeof o[i]=='function'){r+='<tr><td'+_dumpStyles(type ,'td-key')+'>'+i+(st ? ' ['+t+']' : '')+'</td><td'+_dumpStyles(type,'td-value')+'>'+recurse(o[i], t)+'</td></tr>';}else{r+='<tr><td'+_dumpStyles(type,'td-key')+'>'+i+(st ? ' ['+t+']' : '')+'</td><td'+_dumpStyles(type,'td-value')+'>'+o[i]+'</td></tr>';}}}if(j==0){r+='<table'+_dumpStyles(type,'table')+'><tr><th colspan="2"'+_dumpStyles(type,'th')+'>'+type+' [empty]</th></tr>';}r+='</table>';return r;};};_dumpStyles=function(type, use){var r='';var table='font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;cell-spacing:2px;';var th='font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;text-align:left;color: white;padding: 5px;vertical-align :top;cursor:hand;cursor:pointer;';var td='font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;vertical-align:top;padding:3px;';var thScript='onClick="tTable(this);" title="click to collapse"';var tdScript='onClick="tRow(this);" title="click to collapse"';switch(type){case 'string':case 'number':case 'boolean':case 'undefined':case 'object':switch(use){case 'table':r=' style="'+table+'background-color:#0000cc;"';break;case 'th':r=' style="'+th+'background-color:#4444cc;"'+thScript;break;case 'td-key':r=' style="'+td+'background-color:#ccddff;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'array':switch(use){case 'table':r=' style="'+table+'background-color:#006600;"';break;case 'th':r=' style="'+th+'background-color:#009900;"'+thScript;break;case 'td-key':r=' style="'+td+'background-color:#ccffcc;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'function':switch(use){case 'table':r=' style="'+table+'background-color:#aa4400;"';break;case 'th':r=' style="'+th+'background-color:#cc6600;"'+thScript;break;case 'td-key':r=' style="'+td+'background-color:#fff;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'arguments':switch(use){case 'table':r=' style="'+table+'background-color:#dddddd;cell-spacing:3;"';break;case 'td-key':r=' style="'+th+'background-color:#eeeeee;color:#000000;cursor:hand;cursor:pointer;"'+tdScript;break;}break;case 'regexp':switch(use){case 'table':r=' style="'+table+'background-color:#CC0000;cell-spacing:3;"';break;case 'th':r=' style="'+th+'background-color:#FF0000;"'+thScript;break;case 'td-key':r=' style="'+th+'background-color:#FF5757;color:#000000;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'date':switch(use){case 'table':r=' style="'+table+'background-color:#663399;cell-spacing:3;"';break;case 'th':r=' style="'+th+'background-color:#9966CC;"'+thScript;break;case 'td-key':r=' style="'+th+'background-color:#B266FF;color:#000000;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;case 'domelement':switch(use){case 'table':r=' style="'+table+'background-color:#FFCC33;cell-spacing:3;"';break;case 'th':r=' style="'+th+'background-color:#FFD966;"'+thScript;break;case 'td-key':r=' style="'+th+'background-color:#FFF2CC;color:#000000;cursor:hand;cursor:pointer;"'+tdScript;break;case 'td-value':r=' style="'+td+'background-color:#fff;"';break;}break;}return r;};_dumpIdentifyBrowser=function(){var agent=navigator.userAgent.toLowerCase();if (typeof window.opera != 'undefined'){return 'opera';} else if (typeof document.all != 'undefined'){if (typeof document.getElementById != 'undefined'){var browser = agent.replace(/.*ms(ie[\/ ][^ $]+).*/, '$1').replace(/ /, '');if(typeof document.uniqueID != 'undefined') {if (browser.indexOf('5.5') != -1){return browser.replace(/(.*5\.5).*/, '$1');}else{return browser.replace(/(.*)\..*/, '$1');}}else{return 'ie5mac';}}}else if(typeof document.getElementById != 'undefined'){if (navigator.vendor.indexOf('Apple Computer, Inc.')!=-1) {return 'safari';}else if(agent.indexOf('gecko')!=-1) {return 'mozilla';}}return false;};_dumpType=function(obj){var t=typeof(obj);if(t=='function'){var f=obj.toString();if((/^\/.*\/[gi]??[gi]??$/).test(f)){return 'regexp';}else if((/^\[object.*\]$/i).test(f)){t='object'}}if(t !='object'){return t;}switch(obj){case null:return 'null';case window:return 'window';case document:return document;case window.event:return 'event';}if(window.event &&(event.type==obj.type)){return 'event';}var c=obj.constructor;if(c !=null){switch(c){case Array:t='array';break;case Date:return 'date';case RegExp:return 'regexp';case Object:t='object';break;case ReferenceError:return 'error';default:var sc=c.toString();var m=sc.match(/\s*function(.*)\(/);if(m !=null){return 'object';}}}var nt=obj.nodeType;if(nt !=null){switch(nt){case 1:if(obj.item==null){return 'domelement';}break;case 3:return 'string';}}if(obj.toString !=null){var ex=obj.toString();var am=ex.match(/^\[object(.*)\]$/i);if(am !=null){var am=am[1];switch(am.toLowerCase()){case 'event':return 'event';case 'nodelist':case 'htmlcollection':case 'elementarray':return 'array';case 'htmldocument':return 'htmldocument';}}}return t;};

// ---------------------------------------------------------------------------------------------------------------------
// [rel="external"] also becomes [target="_blank"] (opens external links in new windows)
// ---------------------------------------------------------------------------------------------------------------------
function externalLinks()
{ 
	if (!document.getElementsByTagName)
	{
		return; 
	}
	var anchors = document.getElementsByTagName("a"); 
	for (var i = 0; i < anchors.length; i++)
	{ 
		var anchor = anchors[i];
		 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel")) 
		{
			var rels = anchor.getAttribute("rel").split(/\s+/);
			for (var j = 0; j < rels.length; j++)
			{
				if (rels[j].toLowerCase() == "external")
				{
					anchor.setAttribute("target", "_blank");
				}
				break;
			} 
		}
	} 
}

Event.observe(window, "load", externalLinks);

// ---------------------------------------------------------------------------------------------------------------------
// IE6 PNG fix
// ---------------------------------------------------------------------------------------------------------------------
var IEPNGFix=window.IEPNGFix||{};IEPNGFix.tileBG=function(elm,pngSrc,ready){var data=this.data[elm.uniqueID],elmW=Math.max(elm.clientWidth,elm.scrollWidth),elmH=Math.max(elm.clientHeight,elm.scrollHeight),bgX=elm.currentStyle.backgroundPositionX,bgY=elm.currentStyle.backgroundPositionY,bgR=elm.currentStyle.backgroundRepeat;if(!data.tiles){data.tiles={elm:elm,src:'',cache:[],img:new Image(),old:{}};}
var tiles=data.tiles,pngW=tiles.img.width,pngH=tiles.img.height;if(pngSrc){if(!ready&&pngSrc!=tiles.src){tiles.img.onload=function(){this.onload=null;IEPNGFix.tileBG(elm,pngSrc,1);};return tiles.img.src=pngSrc;}}else{if(tiles.src)ready=1;pngW=pngH=0;}
tiles.src=pngSrc;if(!ready&&elmW==tiles.old.w&&elmH==tiles.old.h&&bgX==tiles.old.x&&bgY==tiles.old.y&&bgR==tiles.old.r){return;}
var pos={top:'0%',left:'0%',center:'50%',bottom:'100%',right:'100%'},x,y,pc;x=pos[bgX]||bgX;y=pos[bgY]||bgY;if(pc=x.match(/(\d+)%/)){x=Math.round((elmW-pngW)*(parseInt(pc[1])/100));}
if(pc=y.match(/(\d+)%/)){y=Math.round((elmH-pngH)*(parseInt(pc[1])/100));}
x=parseInt(x);y=parseInt(y);var repeatX={'repeat':1,'repeat-x':1}[bgR],repeatY={'repeat':1,'repeat-y':1}[bgR];if(repeatX){x%=pngW;if(x>0)x-=pngW;}
if(repeatY){y%=pngH;if(y>0)y-=pngH;}
this.hook.enabled=0;if(!({relative:1,absolute:1}[elm.currentStyle.position])){elm.style.position='relative';}
var count=0,xPos,maxX=repeatX?elmW:x+0.1,yPos,maxY=repeatY?elmH:y+0.1,d,s,isNew;if(pngW&&pngH){for(xPos=x;xPos<maxX;xPos+=pngW){for(yPos=y;yPos<maxY;yPos+=pngH){isNew=0;if(!tiles.cache[count]){tiles.cache[count]=document.createElement('div');isNew=1;}
var clipR=(xPos+pngW>elmW?elmW-xPos:pngW),clipB=(yPos+pngH>elmH?elmH-yPos:pngH);d=tiles.cache[count];s=d.style;s.behavior='none';s.left=xPos+'px';s.top=yPos+'px';s.width=clipR+'px';s.height=clipB+'px';s.clip='rect('+
(yPos<0?0-yPos:0)+'px,'+
clipR+'px,'+
clipB+'px,'+
(xPos<0?0-xPos:0)+'px)';s.display='block';if(isNew){s.position='absolute';s.zIndex=-999;if(elm.firstChild){elm.insertBefore(d,elm.firstChild);}else{elm.appendChild(d);}}
this.fix(d,pngSrc,0);count++;}}}
while(count<tiles.cache.length){this.fix(tiles.cache[count],'',0);tiles.cache[count++].style.display='none';}
this.hook.enabled=1;tiles.old={w:elmW,h:elmH,x:bgX,y:bgY,r:bgR};};IEPNGFix.update=function(){for(var i in IEPNGFix.data){var t=IEPNGFix.data[i].tiles;if(t&&t.elm&&t.src){IEPNGFix.tileBG(t.elm,t.src);}}};IEPNGFix.update.timer=0;if(window.attachEvent&&!window.opera){window.attachEvent('onresize',function(){clearTimeout(IEPNGFix.update.timer);IEPNGFix.update.timer=setTimeout(IEPNGFix.update,100);});}

var applyPngFixToRules = ["div#main-image a"];

// only IE7 has native XHR support; IE6 and below has attachEvent and no native XHR
if (window.attachEvent && !window.XMLHttpRequest)
{
	document.observe(
		"dom:loaded",
		function()
		{
			// array of CSS rules that will get the PNG fix
			$$(applyPngFixToRules.join(", ")).each(
				function(elem)
				{
					elem.setStyle(
						{
							behavior: "url(/htc/ie6png.htc)"
						}
					);
				}
			);
		}
	);
}

// ---------------------------------------------------------------------------------------------------------------------
// Suckerfish
// ---------------------------------------------------------------------------------------------------------------------
function bindSuckerfish(target)
{
	target.attachEvent("onmouseover", function()
	{
		target.className += " sfhover";
	});
	
	target.attachEvent("onmouseout", function()
	{
		target.className = target.className.replace(new RegExp(" sfhover\\b"), "");
	});
}

// only IE7 has native XHR support; IE6 and below has attachEvent and no native XHR
if (window.attachEvent && !window.XMLHttpRequest)
{
	window.attachEvent("onload", function()
	{
		var lis = document.getElementsByTagName("li");
		for (var i = 0; i < lis.length; i++)
		{
			bindSuckerfish(lis[i]);
		}
	});
}
