var sbuf = "";
function SubActive(id)
{
	sbuf = document.getElementById('img_'+id).src;
	document.getElementById('img_'+id).src = document.getElementById('aimg_'+id).src;
}

function SubDeActive(id)
{
	document.getElementById('img_'+id).src = sbuf;
}

function ViewForgotDiv()
{
	el = document.getElementById('divforgot');
	if (el.style.display == 'none')
		el.style.display  = "block";
	else	
		el.style.display  = "none";

}

function ChangeLang()
{
	document.changeLang.submit();
}

function MakeOn(url)
{
//	var expand = document.getElementById('expand');
//	url = url+"&expand="+expand.value;
	location.href=url;
}

function DopImg()
{
        targetId="dopimg";
        targetElement = document.getElementById(targetId);
	if (targetElement.style.display == "none")
	        targetElement.style.display= "";
	else targetElement.style.display = "none";
	location.href = "#dopimg";
}

function open_window(url)
{
	cwin = window.open(url,"attach","width=350,height=400,toolbar=no,resizable=yes");
}

function ViewResume(id)
{
	var targetId = "res"+id;
	var buf = document.getElementById(targetId);
	if (buf.style.visibility == "")
	{
		buf.style.visibility = "hidden";
		buf.style.display = "none";		
	}
	else 
	{
		buf.style.visibility = "";
		buf.style.display = "";		
	}
}

function CChange(id, lang)
{
	var buf = document.getElementById('himg'+id);
	var buf2 = document.getElementById('cimg');
	buf2.src = buf.src;
//	SmoothHide('cimg', 0.3, id, lang);
}
var hT, sT;    
function SmoothShow(objId, x)   
{    
	var obj = document.getElementById(objId);   
	op = (obj.style.opacity)?parseFloat(obj.style.opacity):parseInt(obj.style.filter)/100; 	        
	if(op < x)     
	{       
		clearTimeout(hT);      
		op += 0.05;       
		obj.style.opacity = op;       
		obj.style.filter='alpha(opacity='+op*100+')';       
		sT=setTimeout('SmoothShow(\''+objId+'\', '+x+')',0.5);    
	} 
} 	    

function SmoothHide(objId, x, id, lang)
{    
	var obj = document.getElementById(objId);   
	op = (obj.style.opacity)?parseFloat(obj.style.opacity):parseInt(obj.style.filter)/100; 	        
	if(op > x)     
	{       
		clearTimeout(sT);      
		op -= 0.05;       
		obj.style.opacity = op;       
		obj.style.filter='alpha(opacity='+op*100+')';       
		hT=setTimeout('SmoothHide(\''+objId+'\', '+x+', '+id+', \''+lang+'\')',0.5);    
	} 
	else
	{		
		var buf = document.getElementById('himg'+id);
		var buf2 = document.getElementById('cimg');
		buf2.src = buf.src;
		SmoothShow('cimg', 1);
	}
}