/* Credits: http://www.alistapart.com/articles/dropdowns/ */

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;


/* Popup function */


function popitup_colour(url)
{
	newwindow=window.open(url,'name','top=200, left=400, height=300, width=370, scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitup_size(url)
{
	newwindow=window.open(url,'name','top=100, left=200, height=500, width=560, scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function enlarge(url)
{
	newwindow=window.open(url, '', 'top=60, left=150, height=550, width=720, scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

/* form validation */

function validate(theForm)
{   
     
     var filledYN = true;    

     for (i=0; i<theForm.length; i++)
     {          
          if ((theForm[i].selectedIndex == 0))
          {
               filledYN = false;
          }
     }     

     if (!filledYN)
     {
          alert('Please select a colour and size.');
     }
     return filledYN;
}

// Confirmation dialog
function confirmation(url, message)
{
    if (window.confirm(message)) {
        document.location = url;
    }
}

