function showhide(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}

function quickNav(selObj){ 
	eval("parent.location='"+selObj.options[selObj.selectedIndex].value+"'");
	//selObj.selectedIndex=0;
}

function PopupPic(Host, PicURL) { 
	window.open(Host + "image.html?" + PicURL, "",  "resizable=1,HEIGHT=10,WIDTH=300"); 
} 

function clearText(obj,text) {
	if (obj.value == text) {
		obj.value = '';
	}
}

function checkForm(obj,text) {
	if (obj.keyword.value == '' || obj.keyword.value == text) {
		alert('Please enter a Keyword');
		return false;
	}
}

function checkAdd(obj,minqty,clear,fobj) {
	if (obj.value == '' && clear == 1) {
		return false;
	}
	
	if (isNumeric(obj.value) == false) {
		alert ("Quantity is invalid");
		if (clear == 1) {
			obj.value = ''
		}
		return false;
	}
	else if (obj.value < minqty) {
		alert ("This product has a minimum quantity of " + minqty);
		if (clear == 1) {
			obj.value = ''
		}
		return false;
	}
	if (fobj != null) {
		fobj.submit()	
	}
}

function checkAddwOption(qobj,oobj,minqty) {
	if (isNumeric(qobj.value) == false) {
		alert ("Quantity is invalid");
		return false;
	}
	else if (qobj.value < minqty) {
		alert ("This product has a minimum quantity of " + minqty);
		return false;
	}
	else if (oobj.selectedIndex == 0) {
		alert ("Please select an option");
		return false;
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function isNumeric(sText) {
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
   
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;   
}

function togglemore(id) {
	var obj = document.getElementById(id);
	if (obj.style.display == 'none') {
		obj.style.display = 'block';
	}
	else {
		obj.style.display = 'none';
	}
}
