﻿d=document;w=window;m=Math;
l={};l.isIE=navigator.appName=="Microsoft Internet Explorer";
l.gt=function(id){return (typeof(id)=='string')?d.getElementById(id):id;};
l.op=function(ur,nm,pr){w.open(ur,nm,pr||'menubar=0,statusbar=0,width=640,height=480,scrollbars=yes');};
l.ae=function(ob,en,fn){ return (l.isIE)?ob.attachEvent('on'+en,fn):ob.addEventListener(en, fn, false);};
l.parent=function(ob,i){while(i--) ob=ob.parentNode;return ob;};
l.mm=function(pt,ar,dm){if(!dm)var dm='\\$';for(var i=0;i<ar.length;i++) pt = pt.replace(RegExp(dm+i+dm,'g'), ar[i]);return pt.replace(new RegExp(dm+'[0-9]+?'+dm,'g'),'');	};

g={};
//g.st=function(ob,st,vl){(typeof ob=='string'?l.gt(ob):ob).style[st]=vl;};
g.st = function(){}
g.cn=function(ob,cn){(typeof ob=='string'?l.gt(ob):ob).className=cn;};g.sh=function(obs,obh){if(obs)g.cn(obs,'visible');if(obh)g.cn(obh,'hidden');};
g.col=function(ob,cl,out){if(!out){var obs=ob.style.backgroundColor;l.ae(ob,'mouseout',function(){g.st(ob,'backgroundColor',obs);});};g.st(ob,'backgroundColor',cl||'#f9f6ff');};

ajx={};
ajx.x=function() { ajx.x = w.XMLHttpRequest ? function() { return new w.XMLHttpRequest(); } : w.ActiveXObject ? function() { return new ActiveXObject('Microsoft.XMLHTTP'); } : null;	return ajx.x(); };
ajx.g=function(u,f) { var x=ajx.x(); x.open('GET',u,true); x.onreadystatechange=function(){ if(x.readyState==4&&x.status==200)f(x.responseText) }; x.send(null); };


var querystring = {};
window.location.search.replace(
	new RegExp( "([^?=&]+)(=([^&]*))?", "g" ),
	function( $0, $1, $2, $3 ){ querystring[$1.toLowerCase()] = $3; }
);

function info(show, hide)
{
	g.sh(show, hide);
};

var panel = { };
panel.ix = 'charts';
panel.show = function(ix)
{
	if(ix == panel.ix) return false;
	
	$('#panel_'+panel.ix).hide();
	$('#panel_'+ix).fadeIn();
	
	//g.sh('panel_'+ix, 'panel_'+panel.ix);
	g.cn('tab_'+ix, 'selected');
	g.cn('tab_'+panel.ix, '');

	panel.ix=ix;
	return false;
}

var jform = { };
jform.col = function(obj, cval)
{
	var oldCol = obj.style.borderColor;
	obj.style.borderColor = cval || '#fda';
	obj.onblur=function() {obj.style.borderColor = oldCol;};
};

