

/* Clear Field Value On Click `*/
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

/* Submit Login Form */
function do_login(){
document.login.submit();
}

/* Submit Search Form */
function do_search() {
document.search.submit();
}

function do_search2() {
document.search_price.submit();
}


/* This is just a dummy untill the actuall "add to basket" php script OR WHATEVER is added :D */
function add_to_basket(product){

alert(product + ' \nwas added to your basket');

}

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}

	var sfEls2 = document.getElementById("nav_customers").getElementsByTagName("LI");
	for (var i=0; i<sfEls2.length; i++) {
		sfEls2[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}

}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function popUp(url,width,height)
{
   newWindow = window.open(url,'windowNew','width='+width+',height='+height+',status=no,toolbar=no,menubar=no,scrollbars=no,screenX=200,screenY=200,left=200,top=200,resizable=yes');
}


function writeit(text,id){
	if (document.getElementById){
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	} else if (document.all){
		x = document.all[id];
		x.innerHTML = text;
	} else if (document.layers){
		x = document.layers[id];
		text2 = '<P CLASS="testclass">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
	x.document.close();
	}
};

function switchImage(target, source, link, linksource){
	target.src = source;
	link.href = linksource;
}

