function loadDiv(){
	winWidth="350"
	winheight="30"
	
	//y= screen.height/2+18
    //x= (screen.width/2)-winWidth
	thetext="<B>Company name validation is processing. Please wait</B>"
	thename = "msg"
	theobj=document.getElementById(thename)
	
	
	theobj.style.width=winWidth
	theobj.style.height=winheight
	
	theobj.insertAdjacentHTML("BeforeEnd","<table cellspacing=0 cellpadding=3 width="+winWidth+" border=1><tr><td><font type='verdana' size='1' style='color:red;font-weight:normal'>"+thetext+"</font><img src='images/uploading.gif'></td></tr></table>")
	theobj.style.visibility="hidden"
}   
function check() 
{
	
	if (document.searchform.companyname.value == "") 
	{			
			alert("Please input company name ....");
			document.searchform.companyname.focus();
			return false;
	}
		
	var obj_comp_type = document.searchform.comservice	
	if (obj_comp_type[obj_comp_type.selectedIndex].value == "") 
	{
		alert("Please select the company type ....");
		obj_comp_type.focus();
		return false;
	}
	if (obj_comp_type[obj_comp_type.selectedIndex].value == "5") /* from 2 change to 5 */
	{
		popUpWindow('company_type_guarantee.asp', 200, 200, 400, 350)
		
		return false;
	}
	else
	{  
		showDiv()
	document.searchform.submit();
	}
	
		
}
function showDiv(){
	thename = "msg"
	theobj=document.getElementById(thename)
	
	theobj.style.visibility="visible"

	
}
function func_check_type()
{
	var obj_comp_type = document.searchform.comservice
	var str_old_type = document.searchform.hid_comptype_id.value 
	if (str_old_type != "")
	{
		if (obj_comp_type[obj_comp_type.selectedIndex].value != str_old_type) 
		{
			//alert("If you change the company type, you may have to add/change some data. ");
			if(obj_comp_type != str_old_type)
				{
			document.searchform.companyname.value=""
			}
			obj_comp_type.focus();
		}
	}	
}


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


function popupWindow(theURL,winName,width,height) { 
  window.open(theURL,winName,'scrollbars=yes,width='+width+',height='+height);
}


