var xmlHttp;
var root = 'http://'+location.hostname+'/projects/imotdnes/';

function ajax_http()
{
	try
    {
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	return xmlHttp;
}

function clean_str(str)
{
	str=str.replace(/&/gi,"");
	str=str.replace(/</gi,"");
	str=str.replace(/>/gi,"");
	
	return str;
}

function show_additional_options(id)
{
	xmlHttp_1=ajax_http();
	
	var url= root + "includes/ajax/ShowAdditionalOptions.inc.php";
	var parameters="id="+ encodeURI(id);
	
	xmlHttp_1.onreadystatechange=function()
	{
		document.getElementById('additional_options').innerHTML=xmlHttp_1.responseText;
	}
	 xmlHttp_1.open('POST', url, true);
	 xmlHttp_1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp_1.setRequestHeader("Content-length", parameters.length);
     xmlHttp_1.setRequestHeader("Connection", "close");
     xmlHttp_1.send(parameters);
}

function activateComments()
{
	var tmp = confirm('Вие сте човек ?');
	if(tmp == 1)
	{
		xmlHttp_4=ajax_http();
		
		var url= root + "includes/ajax/activateComments.inc.php";
		var parameters = "";
		
		xmlHttp_4.onreadystatechange=function()
		{
			if(xmlHttp_4.readyState==4)
	  		{
	  			bot_check=1;
				document.getElementById("activateButtonid").style.display = 'none';
				document.getElementById("sthshow").innerHTML = xmlHttp_4.responseText;
			}
		}
		 xmlHttp_4.open('POST', url, true);
		 xmlHttp_4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	     xmlHttp_4.setRequestHeader("Content-length", parameters.length);
	     xmlHttp_4.setRequestHeader("Connection", "close");
	     xmlHttp_4.send(parameters);
 	}
}

function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

var tmp_s = 0.5;
function adjustFontSize(type)
{
	if(type == 1)
	{
		tmp_s+=0.05;
	}
	else
	{
		tmp_s-=0.05;
	}
	document.getElementById("description_1").style.fontSizeAdjust=tmp_s;
}