var handle;
function getoptions(todo,div,no,folder,id)
{
	handle = getbrowser();
    handle.onreadystatechange = function()
{


    if(handle.readyState==4)
{

document.getElementById(div).innerHTML = handle.responseText;                  
}

}
     url = folder+"ajaxes.php?seId="+Math.random()+"&todo="+todo+"&options="+no+"&id="+id;
    handle.open("GET",url,true);
    handle.send(null);
}
/////////////////////////////////////
function fill_values(no,div,id,lang){
	handle = getbrowser();
    handle.onreadystatechange = function(){

    if(handle.readyState==4){

document.getElementById(div).innerHTML = handle.responseText;                  
}

}
     url = "selectcat.php?seId="+Math.random()+"&no="+no+"&id="+id+"&lang="+lang;
    handle.open("GET",url,true);
    handle.send(null);
}

/////////////////////////////////////


function custom_option(todo,opid,div,folder)
{
	handle = getbrowser();
    handle.onreadystatechange = function()
{


    if(handle.readyState==4)
{

		document.getElementById(div).innerHTML = handle.responseText;   

}

}
     url = folder+"ajaxes.php?seId="+Math.random()+"&opid="+opid+"&todo="+todo;
    handle.open("GET",url,true);
	
    handle.send(null);
}
/////////////////////////////////////
function update_spec(id,div,newval,no)
{
	handle = getbrowser();
    handle.onreadystatechange = function()
{


    if(handle.readyState==4)
{

		document.getElementById(div).innerHTML = handle.responseText;   

}

}
     url = "dir/check.php?seId="+Math.random()+"&num="+id+"&newval="+newval+"&no="+no;

    handle.open("GET",url,true);
	handle.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=Windows-1256");
    handle.send(null);
}
/////////////////////////////////////
//var handle;
function checkName(name,divname,lang)
{
	
	handle = getbrowser();
    handle.onreadystatechange = function()
{


    if(handle.readyState==4)
{

document.getElementById(divname).innerHTML = handle.responseText;                  
}

}
     url = "dir/check.php?seId="+Math.random()+"&uname="+name+"&lang="+lang;
    handle.open("GET",url,true);
    handle.send(null);
}

/////////////////////////////////////
function showdetails(divName)
{
	if(document.getElementById(divName).style.visibility == "visible")
	{
		document.getElementById(divName).style.visibility = "hidden";
		document.getElementById(divName).style.display = "none";
	}
	else
	{
	document.getElementById(divName).style.visibility = "visible";
	document.getElementById(divName).style.display = "inline";
	}
}
/////////////////////////////////////
function hide_div(divName)
{
		document.getElementById(divName).style.visibility = "hidden";
		document.getElementById(divName).style.display = "none";

}
/////////////////////////////////////]
function show_div(divName)
{
	document.getElementById(divName).style.visibility = "visible";
	document.getElementById(divName).style.display = "inline";
	
}
/////////////////////////////////////
function showAndSet(divName,buttonname)
{
	if(document.getElementById(divName).style.visibility == "visible")
	{
		document.getElementById(divName).style.visibility = "hidden";
		document.getElementById(divName).style.display = "none";
		document.getElementById(buttonname).value = "ÚÑÖ";
	}
	else
	{
	document.getElementById(divName).style.visibility = "visible";
	document.getElementById(divName).style.display = "inline";
	document.getElementById(buttonname).value = "ÅÎÝÇÁ";
	}
}
/////////////////////////////////////
function trimString (str) {
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
////////////////////////////////////////
function getbrowser()
{

var handle=null;

try{

handle = new XMLHttpRequest();

}

catch(e)
{

try{

handle = new ActiveXObject("Microsoft.XMLHTTP");

}

catch(e)
{

try{

handle = new ActiveXObject("Msxml2.XMLHTTP");

}

catch(e)
{

alert("your browser does not support AJAX");

}


}


}

return handle;

}



