    
    function Resize(t)
    {
       var tt=document.getElementById(t);
      
       if (tt.scrollHeight > 150)  
       
       {
       tt.style.height=tt.scrollHeight;}
   }

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function validateForm(whichform) {
  var validationMSG = "";
  for (var i=0; i<whichform.elements.length; i++) {
    var element = whichform.elements[i];
    if (element.className.indexOf("required") != -1) {
      if (!isFilled(element)) {
        validationMSG += "Please Fill the "+element.name+" Field \n";

      }
    }
	
    if (element.className.indexOf("email") != -1) {
      if (!isEmail(element)) {
        validationMSG += "Please Fill the "+element.name+" Field \n";

      }
    }
	
	if (element.className.indexOf("dropList") != -1) {
	  if (!isSel(element)) {
        validationMSG += "Please Select a "+element.name+" \n";
      }
    }
  }
  if(validationMSG != ""){
  	alert (validationMSG);
	return false;
	}
  
  
  return true;
}

function isFilled(field) {
  if (field.value.length < 1) {
    return false;
  } else {
    return true;
  }
}

function isEmail(field) {
  if (field.value.indexOf("@") == -1 || field.value.indexOf(".") == -1) {
    return false;
  } else {
    return true;
  }
}

function isSel(field) {
  if (field.selectedIndex == 0) {
    return false;
  } else {
    return true;
  }
}

function prepareForms() {
  for (var i=0; i<document.forms.length; i++) {
    var thisform = document.forms[i];
    thisform.onsubmit = function() {
      return validateForm(this);
    }
  }
}

addLoadEvent(prepareForms);

// Show Hide
var state = 'none';
function showhide(layer_ref) {
	if (state == 'block') {
		state = 'none';
		}
	else {
		state = 'block';
		}
	hza = document.getElementById(layer_ref);
	hza.style.display = state;
}
	
// For Flash
AC_FL_RunContent = 0;
