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 getform(im)
{
	//alert(im);
	var buf = document.getElementById("kl_"+im);
	var kl = buf.value;
	if (!kl)
		alert('Товар не добавлен!');
	else
	{	
		JsHttpRequest.query('/include/core/ord.php',{im:im,kl:kl},	
		function(result, errors) {changeMain(result);}, true);	
	}
  	return false;		
}

function changeMain(result){	
	if(!result) return false;
	alert('Товар добавлен!');
	var obj = document.getElementById("klv");		
	if (result != null)
		obj.value = result;			
	return false;
}
