// JavaScript Document
function show_nganhbox(id)
{
	
  	for(i=1;i<=2;i++)
	{
		if(id==i)
		{
			$("#box_nganh"+i).show(100);
			document.getElementById("btn_nganh"+i).className='newstitle_over';
		}else
		{
			//if(document.getElementById("btn_spec"+i))
		//	{
				$("#box_nganh"+i).hide(100);		
				document.getElementById("btn_nganh"+i).className='newstitle_none';
		//	}
		}
	}
	
}

function show_specbox(id)
{
	
  	for(i=1;i<=2;i++)
	{
		if(id==i)
		{
			$("#box_spec"+i).show(100);
			document.getElementById("btn_spec"+i).className='newstitle_over';
		}else
		{
			//if(document.getElementById("btn_spec"+i))
		//	{
				$("#box_spec"+i).hide(100);		
				document.getElementById("btn_spec"+i).className='newstitle_none';
		//	}
		}
	}
	
}

function show_specbox_top(id)
{
	
  	for(i=3;i<=4;i++)
	{
		if(id==i)
		{
			$("#box_spec"+i).show(100);
			document.getElementById("btn_spec"+i).className='newstitle_over';
		}else
		{
			//if(document.getElementById("btn_spec"+i))
		//	{
				$("#box_spec"+i).hide(100);		
				document.getElementById("btn_spec"+i).className='newstitle_none';
		//	}
		}
	}
	
}

function KeepCount_ct(form_name,cb_name)
{
	var NewCount = 0
	var cb      = document.forms[form_name].elements[cb_name];
	var cb_len  = cb.length;
	//var bln_allbox = document.forms[form_name].elements[cball_name].checked;
	for (var i = 0; i < cb_len; i++) 
	{
		if(cb[i].checked== true)
		{
			NewCount = NewCount + 1
		}
	}
	if (NewCount == 4)
	{
	alert('Chỉ chọn tối đa 3 Tỉnh/Thành')
	document.addpro; return false;
	}
}

function KeepCount_nn(form_name,cb_name)
{
	var NewCount = 0
	var cb      = document.forms[form_name].elements[cb_name];
	var cb_len  = cb.length;
	//var bln_allbox = document.forms[form_name].elements[cball_name].checked;
	for (var i = 0; i < cb_len; i++) 
	{
		if(cb[i].checked== true)
		{
			NewCount = NewCount + 1
		}
	}
	if (NewCount == 4)
	{
	alert('Chỉ chọn tối đa 3 ngành nghề')
	document.addpro; return false;
	}
}

function setHomePage()
{
    var isIE= navigator.userAgent.indexOf('MSIE') != -1;
    
    if(isIE)
    {
        var url = 'http://www.epicompany.com';
        
        var homePage = document.body;
        
        homePage.style.behavior = 'url(#default#homepage)';
        homePage.setHomePage(url);
    }
    else
    {
        alert('[Ctrl+D] set hompage!');
    }
}


function load_tab(val)
{
  	for(i=1;i<=4;i++)
	{
		if(val==i)
		{
			$("#tab_"+val).show(10);
			document.getElementById('class_'+val).className='tab_active';
		}else{
			$("#tab_"+i).hide(10);	
			document.getElementById('class_'+i).className='tab_none';
		}
	}
}
function changeOpenmenu(id){

	var f=document.getElementById(id).className;
	if(f=='cen_sub_none'){
		document.getElementById(id).className='cen_sub';
	}else{
		document.getElementById(id).className='cen_sub_none';
	}

}

loadstatustext = '';
function ajaxLoad(url,id)
   {
       if (document.getElementById) {
           var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
           }
           if (x)
               {
           x.onreadystatechange = function()
                   {
                       el = document.getElementById(id);
                      // el.innerHTML = loadstatustext;
               if (x.readyState == 4 && x.status == 200)
                       {
                       el.innerHTML = x.responseText;
                   }
                   }
               x.open("GET", url, true);
               x.send(null);
               }
       }


