<!--
/*--------- Javascripts -----------*/

/*---------------------------------*/
//  Check the value of a Quantity input and remove non-numerical keystrokes
/*---------------------------------*/
function keyCheck(obj){
	var newStr = ""
	text = obj.value
	for ( var i=0; i < text.length; i++ ) {
		if ( text.charAt(i) > 0 || text.charAt(i) < 9 ) {
			newStr = newStr + text.charAt(i)
		}
	}
	obj.value = newStr
}

function openWindow(ipath,itemNumber,width,height){
	//alert(width)
	//alert(height)
	width= parseInt(width) + 10
	height=parseInt(height) + 20
	url = "popProdDetail.asp?ipath="+ipath
	window.open(url, itemNumber, 'menubar=no, toolbar=no, directories=no, status=no, scrollbars=no, resizable=no, dependant=no, alwaysRAised=no, width=' + width + ', height=' + height + ',left=10, top=10')
}

function checkLen(objFormField,strAlertText){
	
	strValue = remove_XS_whitespace(objFormField)
	
	
	if(!strValue.length){
		alert(strAlertText)
		return false
	}		
	return true
}

function remove_XS_whitespace(item)
{
  var tmp = "";
  var item_length = item.value.length;
  var item_length_minus_1 = item.value.length - 1;
  for (index = 0; index < item_length; index++)
  {
    if (item.value.charAt(index) != ' ')
    {
      tmp += item.value.charAt(index);
    }
    else
    {
      if (tmp.length > 0)
      {
        if (item.value.charAt(index+1) != ' ' && index != item_length_minus_1)
        {
          tmp += item.value.charAt(index);
        }
      }
    }
  }
  return tmp;
  
}
// CHECK CURRENT FRAMESET LAYOUT

function forceTop(){
	top.location.href='<%=thisPage %>'
}

function changeNavMenu (divname) {
	divArray = new Array("divCS", "divAcct")
	for (i=0; i<(divArray.length); i++){
		obj = MM_findObj(divArray[i]);
		obj.style.display = "none"; 
	}
	if(divname != "none"){
		showDiv = MM_findObj(divname);
		showDiv.style.display = 'block';
	//	objTD = MM_findObj('tabTD2');
	}
}


//-->