/* ws_catalog jscript
   version 2.0
   15-07-2005
*/

/*
*  Expenanding element
*/
function Expand(element_id) {
       var element = document.getElementById(element_id)
       if (element.style.display == "none") {
              element.style.display = "";
       } else {
              element.style.display = "none";
       }
}

/*
*  Submitting cart-form
*/
function submitCart(ix) {
  
   var form = document.forms['cartform'];
   if (!ix) {
		ix = 'all';
   }
   form.index.value = ix;
   form.submit()
}
/*
*  Setting focus to first input field
*  and defining on_focus style
*/
function set_focus_handler()
{   
  
   var form = document.forms['cartform'];
   
   var n = form.elements.length
   for ( i=0; i<n; i++) {
	    form.elements[i].onfocus  = setFocusStyle;
		form.elements[i].onblur	 = setBlurStyle;
   }
}

function setFocusStyle() {
	//IE
	if(this.currentStyle){
		oldBorder = this.currentStyle.borderColor
		oldBackground = this.currentStyle.backgroundColor
		this.style.borderColor 	   = focusBorderColor;
		this.style.backgroundColor = focusBackgroundColor;
	//FF
	} else if (document.defaultView.getComputedStyle(this,"")){
		oldBorder = document.defaultView.getComputedStyle(this,"").getPropertyValue("border-color");
		oldBackground = document.defaultView.getComputedStyle(this,"").getPropertyValue("background-color");
		this.style.borderColor 	   = focusBorderColor;
		this.style.backgroundColor = focusBackgroundColor;	
	}
		
}
function setBlurStyle() {
	this.style.borderColor 	   = oldBorder;
	this.style.backgroundColor = oldBackground;
}

var oldBorder = '';
var oldBackground = '';
var focusBorderColor = '';
var focusBackgroundColor = '';
set_focus_handler();

	