function ajaxf(link, resId, loadId){
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
      document.getElementById(resId).innerHTML=xmlhttp.responseText;
      if(loadId != ""){
         document.getElementById(loadId).innerHTML="";
   	}
    }else{
    	if(loadId == ""){
    		document.getElementById(resId).innerHTML="Loading...";

    	}else{
    		document.getElementById(loadId).innerHTML="Loading...";
    	}
    }
  }
xmlhttp.open("GET",link,true);
xmlhttp.send();
}

function setCookie(c_name, c_value){
document.cookie=c_name + "=" + c_value;
}

function tryOut(){
	alert("Sanāca!!");
}

function show_confirm(showText,link)
{
var r=confirm(showText);
if (r==true)
  {
  location.href=link;
  }

}

function hitCounter(id,link){
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
		location.href=link;
    }
  }
xmlhttp.open("GET","inc/hitCounter.php?id="+id);
xmlhttp.send();
}
