//main interface section

function setSiteLang(idlang,newUrl,isAdmin)
{
	if(typeof(isAdmin)=='undefined')
		document.location = 'switchlang-idlang'+idlang+'.htm';
	else
		document.location = 'switchlang.php?idlang='+idlang;
}

function launchWin(url)
{	
popWin = window.open(url,'nav_win','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=750,height=550,left=200,top=100');
}

function sele(ele)
{
	ele.value="";
}

function unsele()
{
	if(document.frm.txtkeyword.value=="")
		document.frm.txtkeyword.value="...";
}

function cauta()
{
	document.frm.submit();
}

function getkey(e)
{
if (window.event)
   return window.event.keyCode;
else if (e)
   return e.which;
else
   return null;
}

function trap(e)
{
	var key, keychar;
	key = getkey(e);
	window.status = key;
	if(key==13) 
	{
		cauta();
		return false;
	}
	return true;
}

function setNewbgcolor(bg,ele)
{
	ele.style.bgcolor = bg;
}

//admin interface section
function loadEditor(act,id)
{
	new_loc = "edit.php?action="+act+"&identity="+id;
	document.editor.location = new_loc;
}

function takecontent(divelem)
{
	divcontents=divelem.innerHTML;
	divcontents = divcontents.replace('"','&quot;');
	divcontents = divcontents.replace('<','&lt;');
	divcontents = divcontents.replace('>','&gt;');
	document.editor.hiddentext.value=divcontents;
}