$.fn.clear_focus = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
};
$(document).ready(function(){
	$("#cust-login,#cust-password,#search").clear_focus();
	$("#tabs a").click(function(){
		var thisClass = $(this).parent().attr("class");
		var pos = new Array(7);
		pos[0] = "0";
		pos[1] = "-22px";
		pos[2] = "-44px";
		pos[3] = "-66px";
		pos[4] = "-88px";
		pos[5] = "-110px";
		pos[6] = "-132px";
		$("#tabs-content > div").hide();
		$('#' + thisClass+"-content").show();
		$("#tabs").css("background-position","0 "+pos[thisClass.slice(3)]);
	});          
});

function loadXML(url, id)
	{
	x = false;
	if (window.XMLHttpRequest)
		{
		try
			{
			x = new XMLHttpRequest();
			}
		catch (e)
			{
			x = false;
			}
		}
	else if (window.ActiveXObject)
		{
		try
			{
			x = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				x = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				x = false;
				}
			}
		}
	if (x)
		{
		x.onreadystatechange = function()
			{
			if (x.readyState == 4 && x.status == 200)
				{
				document.getElementById(id).innerHTML = x.responseText;
				}
			}
		x.open("GET", url, true);
		x.send(null);
		}
}
	