
function ajaxShow(item)
{
	var dataSrc = "http://" + window.location.hostname + "/data.php?action="+item;
    advAJAX.get({
    url: dataSrc,
    onSuccess : function(obj) {
    	document.getElementById('bodyText').innerHTML = obj.responseText;
    },
    onTimeout : function() {    	
       if(document.getElementById('bodyText'))
       {
          document.getElementById('bodyText').innerHTML="<span style='color:red;margin-left:38px;padding-top:48px;height:270px;'>Klaida!</span>";
       } 
    },
    onError : function(obj) {
      if(document.getElementById('bodyText'))
      {
         document.getElementById('bodyText').innerHTML="<span style='color:red;margin-left:38px;padding-top:48px;height:270px;'>Klaida: "+ obj.status +"</span>";
      } 
    },
    onLoading : function() {
        if(document.getElementById('bodyText'))
        {
            document.getElementById('bodyText').innerHTML="<div style='margin-left:38px;padding-top:48px;height:270px;'>Kraunasi...</div>";
        }
    },
	onFinalization : function() {
	     if(document.getElementById('loading'))
	     {
	        document.getElementById('loading').className = "loadingNone";
	     }
    }

	});
}

function getChecked(formName) {
	list = "";
	checkForm = formName;
	for (i=0; i <= checkForm.length-1; i++)
	{
		if (checkForm.elements[i].type == "checkbox")
		{
			if (checkForm.elements[i].checked == true)
			{
				list += checkForm.elements[i].value+",";
			}
		}
	}
	return list;
}


function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   document.location.href="index.php?cid=4&lang={lang}&filter=3&q="+escape(document.getElementById("quick_search").value);
   return false;
   }
else
   return true;
}

function trimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );
  return sInString.replace( /\s+$/g, "" );
}

function ajaxTimer()
{
   setInterval("ajaxAtsiliepimas()", 20000);
}

