function showHideText(pos,z) { 

    if (!document.layers) {		
           if(document.getElementById(pos).style.display != "block") { 
                document.getElementById(pos).style.display = "block";
				document.getElementById(z).src ="css/img/arrow_gry_twist.gif";				
           } else { 
                document.getElementById(pos).style.display = "none";
				document.getElementById(z).src ="css/img/arrow_gry.gif";
           }   
    }

}


function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
	  oldonload();
	  func();
	}
  }
}	

function hideContents(x){
  var xParent = x.parentElement;
  var childrenCount = xParent.children.length;
  var thisChild = 0;
  for(i=0; i<childrenCount; i++){
    thisChild = xParent.children(i);
	if (thisChild != x){
	  if (thisChild.style.display == "")
	    thisChild.style.display = "none";
      else
	    thisChild.style.display ="";
    }
  }
  return;
}

function inputFocus(x) {
  x.select(); 
  x.style.border='2px solid #FF6804';
}
  
function inputBlur(x) {
  if (x.value==''){x.value=''}; 
  x.style.border='2px solid #96A9C9';
}			   


function isNum(form,idname) {
  if (isNaN(form)) {
    alert('Please enter only numerical values into this field');
	
    if (!document.getElementById) return false;
    idField = document.getElementById(idname);
    idField.value = '';
    idField.focus();
    return false;
  }
  return true;
}


<!-- Dynamic Version by: Nannette Thacker -->
<!-- http://www.shiningstar.net -->
<!-- Original by :  Ronnie T. Moore -->
<!-- Web Site:  The JavaScript Source -->
<!-- Use one function for multiple text areas on a page -->
<!-- Limit the number of characters per textarea -->
<!-- Begin
function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}
//  End -->




function validateAdd(x) {
  if (x.Price.value == "") {
	x.Price.focus();
    alert("The Price field is required.");
    return false;
  }
  if (x.ItemDesc.value == "") { 
	x.ItemDesc.focus();
    alert("The ItemDesc field is required.");
    return false;
  }		
  if (x.ImageSm.value == "") { 
	x.ImageSm.focus();
    alert("The Thumbnail Image field is required.");
    return false;
  }
  if (x.ImageLg.value == "") { 
	x.ImageLg.focus();
    alert("The Detailed Image field is required.");
    return false;
  }
  if (x.PictureSizeW.value == "") { 
	x.PictureSizeW.focus();
    alert("The PictureSizeW field is required.");
    return false;
  }
  if (x.PictureSizeH.value == "") { 
	x.PictureSizeH.focus();
    alert("The PictureSizeH field is required.");
    return false;
  }	
} 

function validateRem(x) {
  if (x.Agreement.checked == true) {
    if(x.Confirmation[0].checked == true) {
      if (x.remValue.value == "") {
	    x.remValue.focus();
        alert("The remValue field is required.");
		x.Confirmation[1].checked = true;
        return false;
      }
	  x.Confirmation[1].checked = true;
	  return true;
	}
	else {
      alert("You have not agreed to delete it!");
	  return false;
	}
  }
  else {
    alert("User agreement has not been signed");
	return false;
  }
}

function validateCF(x) {
  if (x.sname.value == "") {
	x.sname.focus();
    alert("The Surname field is required.");
    return false;
  }
  if (x.fname.value == "") {
	x.fname.focus();
    alert("The First Name field is required.");
    return false;
  }
  if (x.email.value == "") {
	x.email.focus();
    alert("The Email field is required.");
    return false;
  }
  if (x.subject.value == "") {
	x.subject.focus();
    alert("The Subject field is required.");
    return false;
  }
  if (x.comments.value == "") {
	x.comments.focus();
    alert("The Comments field is required.");
    return false;
  }
}
