var whitespace = " \t\n\r";
var state = 'hidden';
var counter = 0;





function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = ""
     }
 }

function display_orders()
{
	typev = document.getElementById("type");
	colour2id = document.getElementById("colour2id");
	colour3id= document.getElementById("colour3id");			
				
    if (typev.value == 'Two colour Sash 3 inch' || typev.value == 'Two colour Sash 4 inch' || typev.value == 'Two colour Sash 6 inch')
	{
		colour2id.style.display = '';
		colour3id.style.display = 'none';
	}
	else if (typev.value == 'Tri colour Sash 4 1/2 inch' || typev.value == 'Tri colour Sash 6 inch')
	{
		colour2id.style.display = '';
		colour3id.style.display = '';
	}
	else
	{
		colour2id.style.display = 'none';
		colour3id.style.display = 'none';
	}

}

function imgchange()
{
 var si =  document.frm.selbox.selectedIndex;
 var fname = document.frm.selbox.options[si].value
 document.img.src = fname
} 

function disableFrmatt(obj)
{
	fieldname = document.getElementById(obj);
	fieldname.disabled = true;
}

function enableFrmatt(obj)
{
	fieldname = document.getElementById(obj);
	fieldname.disabled = false;
}

function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) ||
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

function stripChars (s, str){   
			var i;    
			var returnString = "";    
			for (i = 0; i < s.length; i++)    { 
			var c = s.charAt(i);        if (str.indexOf(c) == -1) 
			returnString += c;    }    
			return returnString;
			} 

function stripWhitespace (s)
			{   
			return stripChars (s, whitespace)
			}



