var xmlHttp; var targetcontentid;
function ProcessProExpInst(actfor,targetarea,id)
   { 
   xmlHttp = GetXmlHttpObject();
   if (xmlHttp==null)  { alert ("Browser does not support AJAX technology"); return; }
   targetcontentid = targetarea;
   var url = "ajax/prof_exp_inst.php?actfor=" + actfor + "&id=" + id;
   xmlHttp.onreadystatechange = stateChanged;
   xmlHttp.open("GET",url,true);
   xmlHttp.send(null);
   }

function stateChanged() 
  { 
	  if (xmlHttp.readyState == 1) /* show bussy for getting result from DB */ 
		 { document.getElementById(targetcontentid).innerHTML = '&nbsp;<img src=images/ajax-loader.gif border=0 />'; } 		
	else if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	     { document.getElementById(targetcontentid).innerHTML=xmlHttp.responseText  } 
  }

function GetXmlHttpObject()
  {
	var xmlHttp=null;
	try	{ xmlHttp=new XMLHttpRequest(); } // Firefox, Opera 8.0+, Safari
		catch (e) //Internet Explorer
		 {		 
		 try
		  	{  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");  }
		 catch (e)
		  	{	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");  }
		}
	return xmlHttp;
  }


function NextProccess(actfor, targetarea, values)	
	{ 
	ProcessProExpInst(actfor, targetarea, values);
	}
	
function GetSelectedValues(ofSelectBox)
	{
	var values = '';
	selectBox = document.getElementById(ofSelectBox); 		   
	if (selectBox.type == "select-multiple") 
		{
		for (var i=0; i<selectBox.options.length; i++) 
			{ 
			if (selectBox.options[i].selected == true)
				values = values +  selectBox.options[i].value + '-';
			}
		}
	values = values.substr(0, values.length-1);	
	//document.getElementById(postwith).value = values; // hiden field
	return values;
	}

function ValidateProExpInst()
	{
	 if (document.getElementById('cmbprofession').value == 0)
		{ document.getElementById('expertise_area').innerHTML = '<label style="color:#FF0000">Select Profession</label>'; return false; }
	 if (document.getElementById('cmbexpertise[]').selectedIndex < 0)
		{ document.getElementById('instrument_area').innerHTML = '<label style="color:#FF0000">Select Expertise</label>'; return false; }
	 if (document.getElementById('cmbinstrument[]').selectedIndex < 0)
		{ document.getElementById('next_area').innerHTML = '<label style="color:#FF0000">Select Instrument</label>'; return false; }
	}
	