function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}



function showCommentForm()
{
  document.getElementById("bw_udv").style.display = "none";
  document.getElementById("bw_nick").style.display = "";
  document.getElementById("bw_mail").style.display = "";
}
function hideCommentForm()
{
  document.getElementById("bw_udv").style.display = "";
  document.getElementById("bw_nick").style.display = "none";
  document.getElementById("bw_mail").style.display = "none";
}  

function keres(hol,mit)
{
document.location.href="http://"+hol+".blogweb.hu/kereses/"+mit+"/0";
}

    function createRequestObject() { 

       var req; 
    
       if(window.XMLHttpRequest){ 
          // Firefox, Safari, Opera... 
          req = new XMLHttpRequest(); 
       } else if(window.ActiveXObject) { 
          // Internet Explorer 5+ 
          req = new ActiveXObject("Microsoft.XMLHTTP"); 
       } else { 
          // There is an error creating the object, 
          // just as an old browser is being used. 
          alert('Problem creating the XMLHttpRequest object'); 
       } 
    
       return req; 
    
    } 
    
    // Make the XMLHttpRequest object 
    var http = createRequestObject(); 
    
    function sendRequest(q) { 
    
       // Open PHP script for requests 
       http.open('get', 'suggest.php?q='+q); 
       http.onreadystatechange = handleResponse; 
       http.send(null); 
    
    } 
   
    
    function GetUserBar() { 
    
       // Open PHP script for requests 
       http.open('get', 'userbar.php'); 
       http.onreadystatechange = handleBar; 
       http.send(null); 
    
    }

 function handleBar() { 
    
       if(http.readyState == 4 && http.status == 200){ 
    
          // Text returned FROM the PHP script 
          var response = http.responseText; 
    
          if(response) { 
             // UPDATE ajaxTest content 
             document.write(response); 
          } 
    
       } 
    
    }       
    function handleResponse() { 
    
       if(http.readyState == 4 && http.status == 200){ 
    
          // Text returned FROM the PHP script 
          var response = http.responseText; 
    
          if(response) { 
             // UPDATE ajaxTest content 
             document.getElementById("searchResults").innerHTML = response; 
          } 
    
       } 
    
    } 

function nyitzar(mit)
{
if (document.getElementById(mit).style.display=="none") {

	document.getElementById(mit).style.display="block";

} else {
	document.getElementById(mit).style.display="none";
	
}

}
function muti(mit)
{
document.getElementById(mit).style.display="block";



}
function tuntet(mit)
{
	document.getElementById(mit).style.display="none";

}
function insertIMG(img)
{
tinyMCE.execCommand('mceInsertContent',false,'<img src="http://blogweb.hu/img/'+img+'">');
nyitzar('kepshower');
return false;
}
function insertReplay(url,nick)
{
tinyMCE.execCommand('mceInsertContent',false,'<a href="'+url+'">'+nick+'</a>:');
return false;
}

function autoSave() {
today = new Date()
var exp = 'Tue, 1 Mar 2008 01:01:29'

var szoveg=tinyMCE.getContent();

setTimeout("autoSave()", 15000);
if (false) {
    document.cookie = 'megj_'+id+'='+escape(szoveg)+'; expires='+exp+' UTC; path=/'
}
}
function startSave() {
setTimeout("autoSave()", 5000);

}
var tinycss;
if (tinycss) {
tinyMCE.init({
		
		mode : "textareas",
		theme : "advanced",
	plugins : "blogwebbreak,emotions",
	theme_advanced_buttons1_add : "charmap,blogwebbreak,blogwebaudio,blogwebyoutube,blogwebflash,emotions",
      invalid_elements : "javascript,object",
		theme_advanced_disable : "cleanup,help,code,removeformat,styleselect,anchor,formatselect,sub,sup",
		content_css: tinycss,
theme_advanced_buttons3 : ""
	});

} else {
tinyMCE.init({
		
		mode : "textareas",
		theme : "advanced",
	plugins : "blogwebbreak,emotions",
	theme_advanced_buttons1_add :"charmap,blogwebbreak,blogwebaudio,blogwebyoutube,blogwebflash,emotions",
      invalid_elements : "javascript,object",
		theme_advanced_disable : "cleanup,help,code,removeformat,styleselect,anchor,formatselect,sub,sup",
theme_advanced_buttons3 : ""
	});
}
	function toggleEditor(id) {
		var elm = document.getElementById(id);

		if (tinyMCE.getInstanceById(id) == null)
			tinyMCE.execCommand('mceAddControl', false, id);
		else
			tinyMCE.execCommand('mceRemoveControl', false, id);
	}



