<!-- ------------ POPUP SCRIPT ------------ -->
function popup(mylink, windowname, w, h){
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=' + w + ',height=' + h + ',scrollbars=yes,resizable=1,toolbar=1');
return false;
}

<!-- ------------ PAGE LOADING SCRIPTS (2) ------------ -->
function waitPreloadPage() { //DOM
if (document.getElementById){
document.getElementById('prepage').style.visibility='hidden';
}else{
if (document.layers){ //NS4
document.prepage.visibility = 'hidden';
}
else { //IE4
document.all.prepage.style.visibility = 'hidden';
}
}
}


<!-- ------------ IFRAME LOADING SCRIPT ------------ -->
function xonload()
{
document.getElementById('frameWrapper').id = 'frameWrapperHide';
}

<!-- ------------ CHECK VARIABLE LENGTH SCRIPT ------------ -->
function check_length() {
if (document.forms.PBWMR.manuf_code.value.length < 5) {
alert('Manufacturer code should be at least 5 digits.');
return true
}
else {
return false
}
}

<!-- ------------ TOGGLE SCRIPT (S)------------ -->
function toggle(id) {
if( document.getElementById(id).style.display=='none' ){
document.getElementById(id).style.display = '';
}else{
document.getElementById(id).style.display = 'none';
}
}

function toggleImage(id, sMinus, sPlus)
{
	var img = document.getElementById(id);
	if (img!=null)
	{
	    var bExpand = img.src.indexOf(sPlus) >= 0;
		if (!bExpand)
			img.src = sPlus;
		else
			img.src = sMinus;
	}
}


function toggleBoth(id,iid) {
  toggle(id);
  toggleImage(iid, 'Images/plus_sign.gif', 'Images/negative_sign.gif');
}

<!-- ------------ SHOW/HIDE SCRIPT ------------ -->
function showHideText(box,id)  
{ 
 var elm = document.getElementById(id) 
 elm.style.display = box.checked? "none":"" 
}

<!-- ------------ SHOW/HIDE MENU SCRIPT ------------ -->
function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible"
}
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden"
}

<!-- ------------ VALIDATE EMAIL SCRIPT ------------ -->
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false;}
else {return true;}
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_email(email,"Email address entered is not valid! Please correct.")==false)
  {email.focus();return false;}
}
}

<!-- ------------ CALC HEIGHT SCRIPT ------------ -->
function calcHeight(frame)
{
  var iframe;
  iframe=frame;
  //find the height of the internal page
  var the_height=
    document.getElementById(frame).contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById(frame).height=
      the_height;
}

<!-- ------------ CHANGE CLASS SCRIPT ------------ -->
function changeclass(classID,className) {
  var NAME = document.getElementById(classID);
  NAME.className=className;
} 