/*	Cambler © 2009, http://cambler.pl/	*/

var pg=1;

function psh(o){o.getElementsByTagName('div')[0].className = 'ic';o.style.backgroundColor = '#FFF';}
function psn(o){o.getElementsByTagName('div')[0].className = 'ic2';o.style.backgroundColor = '#FBFBFB';}
function psh2(o){o.style.backgroundColor = '#FFF';}
function psn2(o){o.style.backgroundColor = '#FBFBFB';}

function installSearchEngine() {
 if (window.external && ("AddSearchProvider" in window.external)) {
   // Firefox 2 and IE 7, OpenSearch
   window.external.AddSearchProvider('http://q.cambler.pl/opensearch/search.xml');
 } else if (window.sidebar && ("addSearchEngine" in window.sidebar)) {
   // Firefox <= 1.5, Sherlock
   window.sidebar.addSearchEngine(
      'http://q.cambler.pl/opensearch/cambler.src',
      'http://s.cambler.pl/favicon.ico',
      'Cambler Szukaj',
      '');
 }/* else {
   // No search engine support (IE 6, Opera, etc).
   alert("Twoja przeglÄ?darka nie obsA*?uguje dodatku wyszukiwania.");
 }
 */
}

function m_search(q) {
var client = new HttpClient();
client.pcs='pcm';

client.callback = function(result) {
	var tb = new Array();
    tb = result.split('<<');
	pg = tb[1]; 
	if(tb[1]!=0) {
		if(tb[1]==1) document.getElementById('more').style.display = 'none';
		document.getElementById('qposts').innerHTML += tb[0];
	} else document.getElementById('more').style.display = 'none';
}
	client.makeRequest('http://q.cambler.pl/more.php?q='+q+'&pg='+pg,null);
}

function remove(id) {
if(confirm('Czy na pewno chcesz usunÄ…Ä‡ ten post?')){
	var client = new HttpClient();
	client.pcs='';
	
	client.callback = function(result) {
		if(result) {
				document.getElementById('p'+id).parentNode.removeChild(document.getElementById('p'+id));
		}
	}
   client.makeRequest('http://q.cambler.pl/del_post.php?id='+id,null);
   return false; 
}
}

function fav(id,o) {
var client = new HttpClient();
client.pcs='';
if(o.className == 'a1') {
	client.callback = function(result) {if(result==1) {o.className = 'a4';}}
	client.makeRequest('http://q.cambler.pl/add_fav.php?id='+id,null);
} else {
	client.callback = function(result) {if(result==1) {o.className = 'a1';}}
	client.makeRequest('http://q.cambler.pl/del_fav.php?id='+id,null);
}
return false; 
}

//if (!ie7) {var eley = element.offsetTop;} else {var eley = element.offsetTop + element.parentNode.offsetTop;}

var timerID=0;
function close_all() {document.getElementById('dropdown_9').style.display='none';}
function hide_menu() {timerID = setTimeout('close_all()', 200);         }
function show_menu2(el,th) {close_all();document.getElementById(el).style.left=th.offsetLeft+'px';document.getElementById(el).style.top=th.offsetTop+20+'px';document.getElementById(el).style.display='block';clearTimeout(timerID);}
function clear_timer() {clearTimeout(timerID);}




