/*

CUSTOM FORM ELEMENTS

Created by Ryan Fait
www.ryanfait.com

The only things you may need to change in this file are the following
variables: checkboxHeight, radioHeight and selectWidth (lines 24, 25, 26)

The numbers you set for checkboxHeight and radioHeight should be one quarter
of the total height of the image want to use for checkboxes and radio
buttons. Both images should contain the four stages of both inputs stacked
on top of each other in this order: unchecked, unchecked-clicked, checked,
checked-clicked.

You may need to adjust your images a bit if there is a slight vertical
movement during the different stages of the button activation.

The value of selectWidth should be the width of your select list image.

Visit http://ryanfait.com/ for more information.

*/

var checkboxHeight = "25";
var selectboxHeight = "25";
var radioHeight = "25";
var selectWidth = "190";


/* No need to change anything after this */

document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; } .disabled { opacity: 0.5; filter: alpha(opacity=50); }</style>');

var CustomFormField = {
	init: function() {
		var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
		for(a = 0; a < inputs.length; a++) {
			if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") {
				//if((inputs[a].type == "radio" || inputs[a].type == "checkbox") && inputs[a].previousSiblings().length > 0 && inputs[a].previousSibling.nodeName.toString().toLowerCase() != "span"){
				    span[a] = document.createElement("span");
				    span[a].className = inputs[a].type;
				
				    if(inputs[a].type == "radio" && inputs[a].getAttribute('onchange') != null){
				     //return alert(inputs[a].getAttribute('onchange'));
				
				      //return alert(span[a].className);
				      if(inputs[a].onchange != '' && inputs[a].onchange.toString().match(/DynamicDysplayCheck\(\)/g) == "DynamicDisplayCheck()"){
				      //alert("span: " + span[a].onclick);
					      span[a].onclick = function(){DynamicDisplayCheck();};
				      //alert("span: " + span[a].onclick);
				      }
				      if(inputs[a].onchange != '' && inputs[a].onchange.toString().match(/HomeworkCheck\(\)/g) == "HomeworkCheck()"){
				      //alert("span: " + span[a].onclick);
					      span[a].onclick = function(){HomeworkCheck();};
				      //alert("span: " + span[a].onclick);
				      }
					  if(inputs[a].onchange != '' && inputs[a].onchange.toString().match(/ChequeOptions\(\)/g) == "ChequeOptions()"){
				      //alert("span: " + span[a].onclick);
					      span[a].onclick = function(){
							  ChequeOptions();
						  };
				      //alert("span: " + span[a].onclick);
				      }
				      //return alert(span[a].getAttribute('onchange'));
				    }
					
					if(inputs[a].type == "checkbox" && inputs[a].getAttribute('onclick') != null){
				     //return alert(inputs[a].getAttribute('onchange'));
				
				      //return alert(span[a].className);
					  //alert(inputs[a].onclick);
					  //return alert(inputs[a].onclick.toString().match(/autoFill\(\)/g));
				      if(inputs[a].onclick != '' && inputs[a].onclick.toString().match(/autoFill\(\)/g) == 'autoFill()'){
				      //alert("span: " + span[a].onclick);
					      span[a].onclick = function(){autoFill();};
				      //alert("span: " + span[a].onclick);
				      }
					  else if(inputs[a].onclick != '' && inputs[a].onclick.toString().match(/togglePending\(\)/g) == 'togglePending()'){
				      //alert("span: " + span[a].onclick);
					      span[a].onclick = function(){
							  togglePending();
							  CustomFormField.clear_form();
							  initInputs();
							  CustomFormField.init();
						  };
				      //alert("span: " + span[a].onclick);
				      }
					  else if(inputs[a].onclick != '' && inputs[a].onclick.toString().match(/toggleComplete\(\)/g) == 'toggleComplete()'){
				      //alert("span: " + span[a].onclick);
					      span[a].onclick = function(){
							  toggleComplete();
							  CustomFormField.clear_form();
							  initInputs();
							  CustomFormField.init();
						  };
				      //alert("span: " + span[a].onclick);
				      }
					  else if(inputs[a].onclick != '' && inputs[a].onclick.toString().match(/hesk_changeAll\(\)/g) == 'hesk_changeAll()'){
				      //alert("span: " + span[a].onclick);
					      span[a].onclick = function(){
							  hesk_changeAll();
							  CustomFormField.clear_form();
							  initInputs();
							  CustomFormField.init();
						  };
				      //alert("span: " + span[a].onclick);
				      }
					  else if(inputs[a].onclick != '' && inputs[a].onclick.toString().match(/toggleCheckbox\(\)/g)){
						  var inobj = inputs[a].onclick.toString().replace(/^javascript: toggleCheckbox\(/, "");
						  inobj = inputs[a].onclick.toString().replace(/\)$/, "");
				      //alert("span: " + span[a].onclick);
					      span[a].onclick = function(){toggleCheckbox(inobj);};
				      //alert("span: " + span[a].onclick);
				      }
				      //return alert(span[a].getAttribute('onchange'));
				    }

				    if(inputs[a].checked == true) {
					    if(inputs[a].type == "checkbox") {
						    position = "0 -" + (checkboxHeight*2) + "px";
						    span[a].style.backgroundPosition = position;
					    } else {
						    position = "0 -" + (radioHeight*2) + "px";
						    span[a].style.backgroundPosition = position;
					    }
				    }
				    inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				    inputs[a].onchange = CustomFormField.clear;
				    if(!inputs[a].getAttribute("disabled")) {
					    span[a].onmouseover = CustomFormField.mover;
					    span[a].onmouseout = CustomFormField.mout;
					    span[a].onmousedown = CustomFormField.pushed;
					    span[a].onmouseup = CustomFormField.check;
				    } else {
					    span[a].className = span[a].className += " disabled";
				    }
			    //}
			}
			/*else if(inputs[a].type == "text" && inputs[a].className == "styled") {
			
			  tinput = inputs[a].value;
			  textnode = document.createTextNode(tinput);
			  
			  span[a] = document.createElement("span");
			  span[a].className = inputs[a].type;
			  span[a].appendChild(textnode);
				
			  if(inputs[a].getAttribute('onchange') != '' && inputs[a].getAttribute('onchange').replace(/javascript:\s/g,'') == "DynamicDisplayCheck();"){
			    
				//alert("span: " + span[a].onclick);
				span[a].onclick = function(){DynamicDisplayCheck();};
				//alert("span: " + span[a].onclick);
			  
			  }
			  if(inputs[a].getAttribute('onchange') != '' && inputs[a].getAttribute('onchange').replace(/javascript:\s/g,'') == "HomeworkCheck();"){
			  
			    //alert("span: " + span[a].onclick);
				span[a].onclick = function(){homeworkCheck();};
				//alert("span: " + span[a].onclick);
				
			  }
			  
			  inputs[a].parentNode.insertBefore(span[a], inputs[a]);
			  inputs[a].onchange = CustomFormField.clear;
			
			  if(!inputs[a].getAttribute("disabled")) {
			  
			    span[a].onmouseover = CustomFormField.mover;
				span[a].onmouseout = CustomFormField.mout;
				span[a].onmousedown = CustomFormField.pushed;
				span[a].onmouseup = CustomFormField.check;
				
			  }
			  else {
			    
				span[a].className = span[a].className += " disabled";
				
			  }
		    }*/
		}
		inputs = document.getElementsByTagName("select");
		for(a = 0; a < inputs.length; a++) {
			if(inputs[a].className == "styled") {
				option = inputs[a].getElementsByTagName("option");
				active = option[0].childNodes[0].nodeValue;
				textnode = document.createTextNode(active);
				for(b = 0; b < option.length; b++) {
					if(option[b].selected == true) {
						textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
					}
				}
				span[a] = document.createElement("span");
				if (inputs[a].getAttribute("id") == "a"){
				  span[a].className = "select-large";
				  inputs[a].style.width = "240px";
				}
				else if (inputs[a].getAttribute("id") == "attachments"){
				  span[a].className = "select-large";
				  inputs[a].style.width = "240px";
				}
				else if (inputs[a].getAttribute("id") == "pri" || inputs[a].getAttribute("id") == "priority"){
				  span[a].className = "select-small";
				  inputs[a].style.width = "115px";
				}
				else {
				  span[a].className = "select";
				}
				span[a].id = "select" + inputs[a].name;
				span[a].appendChild(textnode);
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				if(!inputs[a].getAttribute("disabled")) {
					inputs[a].onmouseover = CustomFormField.smover;
					inputs[a].onmouseout = CustomFormField.smout;
					//inputs[a].onmousedown = CustomFormField.smdown;
					//inputs[a].onmouseup = CustomFormField.smup;
					inputs[a].onfocus = CustomFormField.smover;
					inputs[a].onblur = CustomFormField.smout;
					inputs[a].onkeyup = CustomFormField.choose;
					
					if (inputs[a].getAttribute('id') == "location"){
					
					  inputs[a].onchange = function(){ CustomFormField.choose; SubmitLocation(); };
					
					}
					else if (inputs[a].getAttribute('id') == "cat1"){
					
					  inputs[a].onchange = function(){ CustomFormField.choose; changecat(); };
					
					}
					else if (inputs[a].getAttribute('id') == "pri"){
					
					  inputs[a].onchange = function(){ CustomFormField.choose; changepriority(); };
					
					}
					else if (inputs[a].getAttribute('id') == "saved_replies"){
					
					  inputs[a].onchange = function(){ CustomFormField.choose; setMessage(document.getElementById('saved_replies').value); };
					
					}
					else if (inputs[a].getAttribute('id') == "attachments"){
					
					  inputs[a].onchange = function(){ CustomFormField.choose; handleFile(document.getElementById('attachments').value); };
					
					}
					else if (inputs[a].getAttribute('id') == "courses"){
					
					  inputs[a].onchange = CustomFormField.choose;
				    
					  //alert(inputs[a].onfocus);
					  //alert(inputs[a].onblur);
					  
					  //if (inputs[a].getAttribute('click') == 'width: auto'){
					  
					    //inputs[a].onmouseover = function() { this.style.width = 'auto'; CustomFormField.smover; };
						//inputs[a].onclick = function() { this.style.width = 'auto'; };
					  
					  //}
					  
					  //if (inputs[a].getAttribute('blur') == 'width: 190px'){
					  
					    //inputs[a].onmouseout = function() { this.style.width = '190px'; CustomFormField.smout; };
						//inputs[a].onclick = function() { this.style.width = '190px'; };
					  
					  //}
					
					}
					else if (inputs[a].getAttribute('name').match('fifty') || inputs[a].getAttribute('name').match('onehundred')){
					
					  inputs[a].onchange = function(){ CustomFormField.choose; SubmitDesigns(); };
					  
					}
					else{
					
					  inputs[a].onchange = CustomFormField.choose;
					
					}
				} else {
					inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled";
				}
			}
		}
		document.onmouseup = CustomFormField.clear;
	},
	clear_form: function() {
		var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
		for(a = 0; a < inputs.length; a++) {
			if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled" && null != inputs[a].previousSibling && inputs[a].previousSibling.nodeName.toString().toLowerCase() == "span") {
				    span[a] = inputs[a].previousSibling;
                    span[a].parentNode.removeChild(span[a]);
			}
		}
		inputs = document.getElementsByTagName("select");
		for(a = 0; a < inputs.length; a++) {
			if(inputs[a].className == "styled" && null != inputs[a].previousSibling && inputs[a].previousSibling.nodeName.toString().toLowerCase() == "span") {
				span[a] = inputs[a].previousSibling;
                span[a].parentNode.removeChild(span[a]);
			}
		}
	},
	mover: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight*5 + "px";
		} else if(element.checked == true && element.type == "radio") {
			this.style.backgroundPosition = "0 -" + radioHeight*5 + "px";
		} else if(element.checked != true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight*4 + "px";
		} else {
			this.style.backgroundPosition = "0 -" + radioHeight*4 + "px";
		}
	},
	mout: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
		} else if(element.checked == true && element.type == "radio") {
			this.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
		} else if(element.checked != true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -0px";
		} else {
			this.style.backgroundPosition = "0 -0px";
		}
	},
	smover: function() {
		element = this.previousSibling;
		//alert("smover 1: " + element.style.backgroundPosition = "0 -px");
		if(this.nodeName.toLowerCase() == "select") {
			//alert("smover 2");
			element.style.backgroundPosition = "0 -" + selectboxHeight + "px";
		}
	},
	smout: function() {
		element = this.previousSibling;
		//alert("smout 1: " + element.toString());
		if(this.nodeName.toLowerCase() == "select") {
			//alert("smout 2");
			element.style.backgroundPosition = "0 -0px";
		} else {
			element.style.backgroundPosition = "0 -" + selectboxHeight*2 + "px";
		}
	},
	smdown: function() {
		element = this.previousSibling;
		//alert("smdown 1");
		if(this.nodeName.toLowerCase() == "select") {
			//alert("smdown 2");
			element.style.backgroundPosition = "0 -" + selectboxHeight*2 + "px";
			//alert(this.getAttribute('active'));
		}
	},
	smup: function() {
		element = this.previousSibling;
		//alert("smdown 1");
		if(this.nodeName.toLowerCase() == "select") {
			//alert("smdown 2");
			
			//alert(this.getAttribute('active'));
			if(this.getAttribute('active') == "false"){
				this.setAttribute('active','true');
				element.style.backgroundPosition = "0 -" + selectboxHeight*2 + "px";
			} else if(this.getAttribute('active') == "true"){
				this.setAttribute('active','false');
				element.style.backgroundPosition = "0 -0px";
			}
			//alert(this.getAttribute('active'));
		}
	},
	smblur: function() {
		element = this.previousSibling;
		//alert("smdown 1");
		if(this.nodeName.toLowerCase() == "select") {
			//alert("smdown 2");
			element.style.backgroundPosition = "0 -" + selectboxHeight*2 + "px";
			//alert(this.getAttribute('active'));
			if(this.getAttribute('active') == "false"){
				this.setAttribute('active','true');
			} else if(this.getAttribute('active') == "true"){
				this.setAttribute('active','false');
			}
			//alert(this.getAttribute('active'));
		}
	},
	pushed: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px";
		} else if(element.checked == true && element.type == "radio") {
			this.style.backgroundPosition = "0 -" + radioHeight*3 + "px";
		} else if(element.checked != true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight + "px";
		} else {
			this.style.backgroundPosition = "0 -" + radioHeight + "px";
		}
	},
	check: function() {
		element = this.nextSibling;
		if (element.name == 'registrations[]'){
		
		  return false;
		  
		}
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 0";
			element.checked = false;
		} else {
			if(element.type == "checkbox") {
				this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else {
				this.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
				group = this.nextSibling.name;
				inputs = document.getElementsByTagName("input");
				for(a = 0; a < inputs.length; a++) {
					if(inputs[a].name == group && inputs[a] != this.nextSibling) {
						inputs[a].previousSibling.style.backgroundPosition = "0 0";
					}
				}
			}
			element.checked = true;
		}
	},
	clear: function() {
		inputs = document.getElementsByTagName("input");
		for(var b = 0; b < inputs.length; b++) {
			if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else if(inputs[b].type == "checkbox" && inputs[b].className == "styled" && null != inputs[b].previousSibling) {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
			} else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
			} else if(inputs[b].type == "radio" && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
			}
		}
	},
	choose: function() {
		option = this.getElementsByTagName("option");
		for(d = 0; d < option.length; d++) {
			if(option[d].selected == true) {
				document.getElementById("select" + this.name).style.color = option[d].style.color;
				document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
				if(this.name == "group"){
					GroupOptions(document.getElementById(this.name),'admin_add_form');
				}
			}
		}
	}
}

//window.onload = CustomFormField.init();

var tinputs = document.getElementsByTagName('input');
var tselect = document.getElementsByTagName('select');
var ttextarea = document.getElementsByTagName('textarea');
var input_active = Array();

function initInputs(){
  
  for (var x=0;x<tinputs.length;x++){
  
    if (tinputs[x].type == "text" || tinputs[x].type == "password"){
	
	  input_active[tinputs[x].id] = 0;
	
	  //alert("ID: " + tinputs[x].id + "\nVALUE: " + input_active[tinputs[x].id]);
	
	}
  
  }
  
  for (var x=0;x<ttextarea.length;x++){
  
    input_active[ttextarea[x].id] = 0;
	input_active[ttextarea[x].id + "_background"] = 0;
  
  }
  
  for (var x=0;x<tselect.length;x++){
  
    //alert(tselect[x].id);
  
    var tid = tselect[x].id;
  
    if (tselect[x].className == "listbox"){
	
	  input_active[tid] = 0;
	  //document.getElementById(tid+'-span').onmouseover = function(){mouseoverinput(tid);};
	  //tselect[x].parentNode.onmouseout = function(){mouseoutinput(tselect[x].id);};
	
	  //alert("ID: " + tinputs[x].id + "\nVALUE: " + input_active[tinputs[x].id]);
	
	}
  
  }

}

function focusinput(input){

  input_active[input.id] = 1; 
  var inputc = input.className;
  
  if (inputc == "input" || inputc == "input-active"){
  
    input.className = 'input-active';
  
  }
  else if (inputc == "input_error" || inputc == "input_error-active"){
  
    input.className = 'input_error-active';
  
  }
  else if (inputc == "inputmed" || inputc == "inputmed-active"){
  
    input.className = 'inputmed-active';
  
  }
  else if (inputc == "inputmed_error" || inputc == "inputmed_error-active"){
  
    input.className = 'inputmed_error-active';
  
  }
  else if (inputc == "inputsm" || inputc == "inputsm-active"){
  
    input.className = 'inputsm-active';
  
  }
  else if (inputc == "inputsm_error" || inputc == "inputsm_error-active"){
  
    input.className = 'inputsm_error-active';
  
  }
  else if (inputc == "inputxl" || inputc == "inputxl-active"){
  
    input.className = 'inputxl-active';
  
  }
  else if (inputc == "inputxl_error" || inputc == "inputxl_error-active"){
  
    input.className = 'inputxl_error-active';
  
  }
  else if (inputc == "textarea" || inputc == "textarea-active"){
  
    input.className = 'textarea-active';
  
  }
  else if (inputc == "textarea-large" || inputc == "textarea-large-active"){
  
    input.className = 'textarea-large-active';
  
  }
  else if (inputc == "textarea-large_error" || inputc == "textarea-large_error-active"){
  
    input.className = 'textarea-large_error-active';
  
  }
  else if (inputc == "textarea-xlarge" || inputc == "textarea-xlarge-active"){
  
    input.className = 'textarea-xlarge-active';
  
  }
  else if (inputc == "textarea-xlarge_error" || inputc == "textarea-xlarge_error-active"){
  
    input.className = 'textarea-xlarge_error-active';
  
  }
  else if (inputc == "listbox" || inputc == "listbox-active"){
  
    input.className = 'listbox-active';
  
  }

}

function blurinput(input){

  input_active[input.id] = 0; 
  var inputc = input.className;
  
  if (inputc == "input" || inputc == "input-active"){
  
    input.className = 'input';
  
  }
  else if (inputc == "input_error" || inputc == "input_error-active"){
  
    input.className = 'input_error';
  
  }
  else if (inputc == "inputmed" || inputc == "inputmed-active"){
  
    input.className = 'inputmed';
  
  }
  else if (inputc == "inputmed_error" || inputc == "inputmed_error-active"){
  
    input.className = 'inputmed_error';
  
  }
  else if (inputc == "inputsm" || inputc == "inputsm-active"){
  
    input.className = 'inputsm';
  
  }
  else if (inputc == "inputsm_error" || inputc == "inputsm_error-active"){
  
    input.className = 'inputsm_error';
  
  }
  else if (inputc == "inputxl" || inputc == "inputxl-active"){
  
    input.className = 'inputxl';
  
  }
  else if (inputc == "inputxl_error" || inputc == "inputxl_error-active"){
  
    input.className = 'inputxl_error';
  
  }
  else if (inputc == "textarea" || inputc == "textarea-active"){
  
    input.className = 'textarea';
  
  }
  else if (inputc == "textarea-large" || inputc == "textarea-large-active"){
  
    input.className = 'textarea-large';
  
  }
  else if (inputc == "textarea-large_error" || inputc == "textarea-large_error-active"){
  
    input.className = 'textarea-large_error';
  
  }
  else if (inputc == "textarea-xlarge" || inputc == "textarea-xlarge-active"){
  
    input.className = 'textarea-xlarge';
  
  }
  else if (inputc == "textarea-xlarge_error" || inputc == "textarea-xlarge_error-active"){
  
    input.className = 'textarea-xlarge_error';
  
  }
  else if (inputc == "listbox" || inputc == "listbox-active"){
  
    input.className = 'listbox';
  
  }


}

function mouseoverinput(input){

  //alert(input);
  
  //if (input === undefined){
  
    //return alert(input.id);
  
  //}

  if (input_active[input.id] == 0){ 
  
    var inputc = input.className;
  
    if (inputc == "input" || inputc == "input-active"){
  
      input.className = 'input-active';
  
    }
	else if (inputc == "input_error" || inputc == "input_error-active"){
  
      input.className = 'input_error-active';
  
    }
	else if (inputc == "inputmed" || inputc == "inputmed-active"){
  
      input.className = 'inputmed-active';
  
    }
	else if (inputc == "inputmed_error" || inputc == "inputmed_error-active"){
  
      input.className = 'inputmed_error-active';
  
    }
    else if (inputc == "inputsm" || inputc == "inputsm-active"){
  
      input.className = 'inputsm-active';
  
    }
    else if (inputc == "inputsm_error" || inputc == "inputsm_error-active"){
  
      input.className = 'inputsm_error-active';
  
    }
	else if (inputc == "inputxl" || inputc == "inputxl-active"){
  
      input.className = 'inputxl-active';
  
    }
	else if (inputc == "inputxl_error" || inputc == "inputxl_error-active"){
  
      input.className = 'inputxl_error-active';
  
    }
    else if (inputc == "textarea" || inputc == "textarea-active"){
  
      input.className = 'textarea-active';
  
    }
    else if (inputc == "textarea-large" || inputc == "textarea-large-active"){
  
      input.className = 'textarea-large-active';
  
    }
    else if (inputc == "textarea-large_error" || inputc == "textarea-large_error-active"){
  
      input.className = 'textarea-large_error-active';
  
    }
    else if (inputc == "textarea-xlarge" || inputc == "textarea-xlarge-active"){
  
      input.className = 'textarea-xlarge-active';
  
    }
    else if (inputc == "textarea-xlarge_error" || inputc == "textarea-xlarge_error-active"){
  
      input.className = 'textarea-xlarge_error-active';
  
    }
    else if (inputc == "listbox" || inputc == "listbox-active"){
  
      input.className = 'listbox-active';
  
    }
  
  }

}

function mouseoutinput(input){

  if (input_active[input.id] == 0){ 
  
    var inputc = input.className;
  
    if (inputc == "input" || inputc == "input-active"){
  
      input.className = 'input';
  
    }
	else if (inputc == "input_error" || inputc == "input_error-active"){
  
      input.className = 'input_error';
  
    }
	else if (inputc == "inputmed" || inputc == "inputmed-active"){
  
      input.className = 'inputmed';
  
    }
	else if (inputc == "inputmed_error" || inputc == "inputmed_error-active"){
  
      input.className = 'inputmed_error';
  
    }
    else if (inputc == "inputsm" || inputc == "inputsm-active"){
  
      input.className = 'inputsm';
  
    }
    else if (inputc == "inputsm_error" || inputc == "inputsm_error-active"){
  
      input.className = 'inputsm_error';
  
    }
	else if (inputc == "inputxl" || inputc == "inputxl-active"){
  
      input.className = 'inputxl';
  
    }
	else if (inputc == "inputxl_error" || inputc == "inputxl_error-active"){
  
      input.className = 'inputxl_error';
  
    }
    else if (inputc == "textarea" || inputc == "textarea-active"){
  
      input.className = 'textarea';
  
    }
    else if (inputc == "textarea-large" || inputc == "textarea-large-active"){
  
      input.className = 'textarea-large';
  
    }
    else if (inputc == "textarea-large_error" || inputc == "textarea-large_error-active"){
  
      input.className = 'textarea-large_error';
  
    }
    else if (inputc == "textarea-xlarge" || inputc == "textarea-xlarge-active"){
  
      input.className = 'textarea-xlarge';
  
    }
    else if (inputc == "textarea-xlarge_error" || inputc == "textarea-xlarge_error-active"){
  
      input.className = 'textarea-xlarge_error';
  
    }
    else if (inputc == "listbox" || inputc == "listbox-active"){
  
      input.className = 'listbox';
  
    }
  
  }

}
