// JScript File
// This function is used to clear the server controls
function SetFormControls(lstControl) {
    
     for(i = 0; i < lstControl.length; i++)
			{
				elementInfo = lstControl[i].split(",");			
				ele = document.getElementById(elementInfo[0]);
				
				if(ele == null) 
						continue;

				switch(ele.tagName) 
				{
				    
					case "INPUT":
					    node = ele.attributes.getNamedItem("type", null);	
										
						if(node.nodeValue == "checkbox" || node.nodeValue == "radio")
				    			ele.checked = eval(elementInfo[1]);
				        else if (node.nodeValue == "text") 
				        {
							ele.value = eval("\"" + elementInfo[1] + "\"");
						}
						else if(node.nodeValue == "hidden" )						        
				        {
							ele.value = eval("\"" + elementInfo[1] + "\"");
						}	
						break;
					case "SELECT":
				            if (ele.type == "select-multiple")
				            {
				                count = ele.options.length;
				                for (j=0; j<count; j++)					                    
				                    ele.options[j].selected = false;
				            }
				            ele.value = eval("\"" + elementInfo[1] + "\"");

				            if (elementInfo[0] == "ctl00_eContent_ucClientCarrierDropDowns_ddlCarrier")//This was initially added for clearing the client carrier control on the subscriber master page.
				            {
				                ele.style.visibility = "hidden";
				            }

							break;
					case "SPAN":

					    	ele.innerHTML = eval("\"" + elementInfo[1] + "\"");

					    	break;
					 case "TABLE":
					     if (elementInfo[0] == "ctl00_eContent_MultiSelectControl_MyGridView") {

					         for (j = 0; j < ele.rows.length; j++) {
					             cell = ele.rows[j].cells[0];
					             for (x = 0; x < cell.childNodes.length; x++) {
					                 if (cell.childNodes[x].type == "checkbox") {
					                     cell.childNodes[x].checked = false;
					                 }
					             }
					         }
					     }
					     break;
                 }
		  }
}

//this function is used to allow automatic jumping in textboxes [Phone Number]
function JumpTo(control, maxLen, chkControl)
   {
	if (chkControl.value.length==maxLen)
	{
		control.focus();
		control.select();
	}
  }

