













function dvJump(obj)
{
eval("window.location='" + obj.options[obj.selectedIndex].value + "'");
}

function openwindow(url)
{
	window.open(url,"mywindow","menubar=1,scrollbars=1,resizable=1,width=728,height=500");
}


function openclose( whatmenu, whatbutton ) {

  if( document.getElementById(whatmenu).className == 'openlist' ) {
    document.getElementById(whatmenu).className = 'closedlist';
  }
  else { 
    document.getElementById(whatmenu).className = 'openlist' 
  }
}

function fieldcolour(selectfield, fieldname) {
 
	if (document.formc[selectfield].value == 1)
 		document.formc[fieldname].style.backgroundColor = '#e1e1e1';
	else
		document.formc[fieldname].style.backgroundColor = '#FFFFFF'; 
}

// used to define where to send the customer in the basket area.
function BasketSubmit(option)
{
	if (option==1)
		document.basket.action.value = "basket.php";
	else if (option==2)
		document.basket.action.value = "checkout.php";
		
	document.basket.submit();
	return true;
}
// When Qty is changed this function is executed.
function sendForm(fieldname) 

{
	if (document.basket[fieldname].value == 0) {
		if (confirm("Setting this items qty to 0 will comletely remove this item from the basket")) 
		{
			//window.location = 'checkout.php';
			document.basket.submit();
			return true
    	}
		else		
			return false;
		
	}// end if qty = 0 //
	else 
		document.basket.submit(); 
		//BasketSubmit(1);
	
} // end function


// When Country is changed this function is executed.
function ChangeShipping() 
{
	if (alert("Changing the country could also affect delivery charges.\n\nPlease see the basket summary on the right or return to the shopping basket.")) 
		{
			//document.formc.submit();
			return true
    	}
		else		
			return false;
} // end function


var highlightbehavior="TD"

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TABLE")
return
while(source.tagName!=highlightbehavior && source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}

function submitonce(theform){
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
		//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++){
			var tempobj=theform.elements[i]
				if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
			//disable em
			tempobj.disabled=true
		}
	}
}
