/* 
------------------------------------------
	Flipbox written by CrappoMan
	simonpatterson@dsl.pipex.com
------------------------------------------
*/
function flipBox(who) {
	var tmp; 
	if (document.images['b_' + who].src.indexOf('_on') == -1) { 
		tmp = document.images['b_' + who].src.replace('_off', '_on');
		document.getElementById('box_' + who).style.display = 'none';
		document.images['b_' + who].src = tmp;
	} else { 
		tmp = document.images['b_' + who].src.replace('_on', '_off');
		document.getElementById('box_' + who).style.display = 'block';
		document.images['b_' + who].src = tmp;
	} 
}


function addText(elname, wrap1, wrap2) {
	if (document.selection) { // for IE 
		var str = document.selection.createRange().text;
		document.forms['inputform'].elements[elname].focus();
		var sel = document.selection.createRange();
		sel.text = wrap1 + str + wrap2;
		return;
	} else if ((typeof document.forms['inputform'].elements[elname].selectionStart) != 'undefined') { // for Mozilla
		var txtarea = document.forms['inputform'].elements[elname];
		var selLength = txtarea.textLength;
		var selStart = txtarea.selectionStart;
		var selEnd = txtarea.selectionEnd;
		var oldScrollTop = txtarea.scrollTop;
		//if (selEnd == 1 || selEnd == 2)
		//selEnd = selLength;
		var s1 = (txtarea.value).substring(0,selStart);
		var s2 = (txtarea.value).substring(selStart, selEnd)
		var s3 = (txtarea.value).substring(selEnd, selLength);
		txtarea.value = s1 + wrap1 + s2 + wrap2 + s3;
		txtarea.selectionStart = s1.length;
		txtarea.selectionEnd = s1.length + s2.length + wrap1.length + wrap2.length;
		txtarea.scrollTop = oldScrollTop;
		txtarea.focus();
		return;
	} else {
		insertText(elname, wrap1 + wrap2);
	}
}

function insertText(elname, what) {
	if (document.forms['inputform'].elements[elname].createTextRange) {
		document.forms['inputform'].elements[elname].focus();
		document.selection.createRange().duplicate().text = what;
	} else if ((typeof document.forms['inputform'].elements[elname].selectionStart) != 'undefined') { // for Mozilla
		var tarea = document.forms['inputform'].elements[elname];
		var selEnd = tarea.selectionEnd;
		var txtLen = tarea.value.length;
		var txtbefore = tarea.value.substring(0,selEnd);
		var txtafter =  tarea.value.substring(selEnd, txtLen);
		var oldScrollTop = tarea.scrollTop;
		tarea.value = txtbefore + what + txtafter;
		tarea.selectionStart = txtbefore.length + what.length;
		tarea.selectionEnd = txtbefore.length + what.length;
		tarea.scrollTop = oldScrollTop;
		tarea.focus();
	} else {
		document.forms['inputform'].elements[elname].value += what;
		document.forms['inputform'].elements[elname].focus();
	}
}

function CheckLen(field, limit, actfield) {
	var textLength = field.value.length;
	if (textLength >= limit) {
		actfield.disabled=false;
	} else {
		actfield.disabled=true;
	}
}
function SetDisabled(actfield) {
	actfield.disabled=false;
}

function textCounter(field, countfield) {
	countfield.value = field.value.length;
}

// For the bad guys
function update_duration(source,target) {
	var chosenoption=document.getElementById(source).selectedIndex;
	var searchFor = settleDefs[chosenoption];
	/*DEBUG*/ //alert(searchFor+' OF['+chosenoption+']');
	var destMenu = document.getElementById(target);
	var totalGrps = destMenu.options.length;
	for(var z=0;z<totalGrps;z++) {
		var curroption=destMenu.options[z];
		if (curroption.value == searchFor){
			/*DEBUG*/ //alert(curroption.value +' == '+searchFor);
			curroption.selected = "selected";
		} else {
			curroption.selected = "";
		}
	}
}

function show_hide(msg_id) {
	msg_id.style.display = msg_id.style.display == 'none' ? 'block' : 'none';
}

function reloadOnChange(selectmenu1) {
	//var selectmenu1 = document.getElementById("mymenu1_<?php print($identifier) ?>");
	//this refers to "selectmenu1"
	var chosenoption=selectmenu1.options[selectmenu1.selectedIndex];
	if (chosenoption.value != "") {
		document.location.href = chosenoption.value;
	}
}

// Finds first occurrence of a string within another  
function strstr(haystack, needle, bool) {
    var pos = 0;
    
    haystack += '';
    pos = haystack.indexOf( needle );
    if (pos == -1) {
        return false;
    } else {
        if (bool) {
            return haystack.substr( 0, pos );
		} else{
            return haystack.slice( pos );
        }
    }
}

/**********************************************************/
/** ________ The future will be crazy with ajax ________ **/
var ajax1 = new sack(); // This thing is cool, ya ? :D
var ajax2 = new sack(); // This thing is cool, ya ? :D
var ajax3 = new sack(); // This thing is cool, ya ? :D
var ajax4 = new sack(); // This thing is cool, ya ? :D

var articleListObj;
//var activeArticle = false;
//var clickedArticle = false;
var pair1_contentObj0 = "";	// Reference to article content <div>
var pair1_contentObj1 = "";	// Reference to article content <div>
var pair1_contentObj2 = "";	// Reference to article content <div>
var pair1_contentObj3 = "";	// Reference to article content <div>

var pair2_contentObj0 = "";	// Reference to article content <div>
var pair2_contentObj1 = "";	// Reference to article content <div>
var pair2_contentObj2 = "";	// Reference to article content <div>
var pair2_contentObj3 = "";	// Reference to article content <div>

var pair3_contentObj0 = "";	// Reference to article content <div>
var pair3_contentObj1 = "";	// Reference to article content <div>
var pair3_contentObj2 = "";	// Reference to article content <div>
var pair3_contentObj3 = "";	// Reference to article content <div>

var pair4_contentObj0 = "";	// Reference to article content <div>
var pair4_contentObj1 = "";	// Reference to article content <div>
var pair4_contentObj2 = "";	// Reference to article content <div>
var pair4_contentObj3 = "";	// Reference to article content <div>

var pair1_cacheCurrent = false;
var pair1_cachedContent = "";

var pair2_cacheCurrent = false;
var pair2_cachedContent = "";

var pair3_cacheCurrent = false;
var pair3_cachedContent = "";

var pair4_cacheCurrent = false;
var pair4_cachedContent = "";
/* Everybody knows that the world is crazy on ajax now :) */

var PATH_PREFIX = "";
var RESPONSE_MODE_OBJ0 = new Array("innerHTML","innerHTML","innerHTML","innerHTML");
var RESPONSE_MODE_OBJ1 = new Array("innerHTML","innerHTML","innerHTML","innerHTML");
var RESPONSE_MODE_OBJ2 = new Array("innerHTML","innerHTML","innerHTML","innerHTML");
var RESPONSE_MODE_OBJ3 = new Array("innerHTML","innerHTML","innerHTML","innerHTML");
function pausecomp(millis) 
{
	var date = new Date();
	var curDate = null;

	do { curDate = new Date(); } 
	while(curDate-date < millis);
} 

function alertCPU(cpu)
{
	cpu=cpu||1;
	var alertContent = '';
	
	if(cpu==1)
	{
		alertContent = '[CPU1]\nCACHE: '+pair1_cachedContent+'\n'+
			'0: '+pair1_contentObj0.innerHTML+'\n'+
			'1: '+pair1_contentObj1.innerHTML+'\n'+
			'2: '+pair1_contentObj2+'\n'+
			'3: '+pair1_contentObj3;
	} else if(cpu==2)
	{
		alertContent = '[CPU2]\nCACHE: '+pair2_cachedContent+'\n'+
			'0: '+pair2_contentObj0.innerHTML+'\n'+
			'1: '+pair2_contentObj1.innerHTML+'\n'+
			'2: '+pair2_contentObj2+'\n'+
			'3: '+pair2_contentObj3;
	} else if(cpu==3)
	{
		alertContent = '[CPU3]\nCACHE: '+pair3_cachedContent+'\n'+
			'0: '+pair3_contentObj0.innerHTML+'\n'+
			'1: '+pair3_contentObj1.innerHTML+'\n'+
			'2: '+pair3_contentObj2+'\n'+
			'3: '+pair3_contentObj3;
	} else if(cpu==4)
	{
		alertContent = '[CPU4]\nCACHE: '+pair4_cachedContent+'\n'+
			'0: '+pair4_contentObj0.innerHTML+'\n'+
			'1: '+pair4_contentObj1.innerHTML+'\n'+
			'2: '+pair4_contentObj2+'\n'+
			'3: '+pair4_contentObj3;
	}
		
	alert(alertContent);
}

function ajax_showContent(cpu)	// Displaying content in the content <div>
{
	cpu = cpu||1;
	var respArrId = cpu-1;
	var respTypeObj0 = RESPONSE_MODE_OBJ0[respArrId];
	var respTypeObj1 = RESPONSE_MODE_OBJ1[respArrId];
	var respTypeObj2 = RESPONSE_MODE_OBJ2[respArrId];
	var respTypeObj3 = RESPONSE_MODE_OBJ3[respArrId];
	var resp = '';
	var resp0 = '';
	var resp1 = '';
	var resp2 = '';
	var resp3 = '';
	var cachedContent = '';
	var multiMatcher = '[[[MULTIRESP]]]';
	
	if(cpu==1) {
		resp = ajax1.response;
		cachedContent = pair1_cachedContent;
	} else if(cpu==2) {
		resp = ajax2.response;
		cachedContent = pair2_cachedContent;
	} else if(cpu==3) {
		resp = ajax3.response;
		cachedContent = pair3_cachedContent;
	} else if(cpu==4) {
		resp = ajax4.response;
		cachedContent = pair4_cachedContent;
	}
	if(strstr(resp,multiMatcher) !== false) {
		splitedResp = (resp.substr(multiMatcher.length)).split('|||');
		if(splitedResp.length >= 1) resp0 = splitedResp[0];
		if(splitedResp.length >= 2) resp1 = splitedResp[1];
		if(splitedResp.length >= 3) resp2 = splitedResp[2];
		if(splitedResp.length >= 4) resp3 = splitedResp[3];
	} else {
		resp0 = cachedContent;
		resp1 = resp;
		resp2 = '';
		resp3 = '';
	}
	/*~~~~~~~~~~~~~~~~~~ DEBUG ~~~~~~~~~~~~~~~~~~~*/
	/*alert(
		'CPU: ' +cpu+
		'\n resp: ' +resp+
		'\n resp0: ' +resp0+
		'\n resp1: ' +resp1+
		'\n resp2: ' +resp2+
		'\n resp3: ' +resp3
	);*/
	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
	
	if(cpu==1)
	{
		if(pair1_contentObj0)
		{
			if(respTypeObj0 == "class")
				pair1_contentObj0.className = resp0;
			else
				pair1_contentObj0.innerHTML = resp0;
		}
		if(pair1_contentObj1 && resp != 'FAILED')
		{
			if(respTypeObj1 == "class")
				pair1_contentObj1.className = resp1;	// ajax.response is a variable that contains the content of the external file
			else
				pair1_contentObj1.innerHTML = resp1;	// ajax.response is a variable that contains the content of the external file
		}
		if(pair1_contentObj2)
		{
			if(respTypeObj2 == "class")
				pair1_contentObj2.className = resp2;
			else
				pair1_contentObj2.innerHTML = resp2;
		}
		if(pair1_contentObj3)
		{
			if(respTypeObj3 == "class")
				pair1_contentObj3.className = resp3;
			else
				pair1_contentObj3.innerHTML = resp3;
		}
	} else if(cpu==2)
	{
		if(pair2_contentObj0)
		{
			if(respTypeObj0 == "class")
				pair2_contentObj0.className = resp0;
			else
				pair2_contentObj0.innerHTML = resp0;
		}
		if(pair2_contentObj1 && resp != 'FAILED')
		{
			if(respTypeObj1 == "class")
			{
				pair2_contentObj1.className = resp1;	// ajax.response is a variable that contains the content of the external file
			} else {
				pair2_contentObj1.innerHTML = resp1;	// ajax.response is a variable that contains the content of the external file
			}
		}
		if(pair2_contentObj2)
		{
			if(respTypeObj2 == "class")
				pair2_contentObj2.className = resp2;
			else
				pair2_contentObj2.innerHTML = resp2;
		}
		if(pair2_contentObj3)
		{
			if(respTypeObj3 == "class")
				pair2_contentObj3.className = resp3;
			else
				pair2_contentObj3.innerHTML = resp3;
		}
	} else if(cpu==3)
	{
		resp = ajax3.response;
		if(pair3_contentObj0)
		{
			if(respTypeObj0 == "class")
				pair3_contentObj0.className = resp0;
			else
				pair3_contentObj0.innerHTML = resp0;
		}
		if(pair3_contentObj1 && resp != 'FAILED')
		{
			if(respTypeObj1 == "class")
			{
				pair3_contentObj1.className = resp1;	// ajax.response is a variable that contains the content of the external file
			} else {
				pair3_contentObj1.innerHTML = resp1;	// ajax.response is a variable that contains the content of the external file
			}
		}
		if(pair3_contentObj2)
		{
			if(respTypeObj2 == "class")
				pair3_contentObj2.className = resp2;
			else
				pair3_contentObj2.innerHTML = resp2;
		}
		if(pair3_contentObj3)
		{
			if(respTypeObj3 == "class")
				pair3_contentObj3.className = resp3;
			else
				pair3_contentObj3.innerHTML = resp3;
		}
	}
	else if(cpu==4)
	{
		resp = ajax4.response;
		if(pair4_contentObj0)
		{
			if(respTypeObj0 == "class")
				pair4_contentObj0.className = resp0;
			else
				pair4_contentObj0.innerHTML = resp0;
		}
		if(pair4_contentObj1 && resp != 'FAILED')
		{
			if(respTypeObj1 == "class")
			{
				pair4_contentObj1.className = resp1;	// ajax.response is a variable that contains the content of the external file
			} else {
				pair4_contentObj1.innerHTML = resp1;	// ajax.response is a variable that contains the content of the external file
			}
		}
		if(pair4_contentObj2)
		{
			if(respTypeObj2 == "class")
				pair4_contentObj2.className = resp2;
			else
				pair4_contentObj2.innerHTML = resp2;
		}
		if(pair4_contentObj3)
		{
			if(respTypeObj3 == "class")
				pair4_contentObj3.className = resp3;
			else
				pair4_contentObj3.innerHTML = resp3;
		}
	}
	//alertCPU(cpu);
}
function __cpu1__ajax_showContent() {return ajax_showContent(1);}
function __cpu2__ajax_showContent() {return ajax_showContent(2);}
function __cpu3__ajax_showContent()	{return ajax_showContent(3);}
function __cpu4__ajax_showContent()	{return ajax_showContent(4);}

function ajax_showWaitMessage(cpu)
{
	//var loadingIMG = '<img src=../images/loading.gif alt=loading>';
	var loadingIMG = '<img src='+PATH_PREFIX+'images/loading.gif alt=loading>';
	var loadingCLASS = 'loading';
	cpu = cpu||1;
	
	var respArrId = cpu-1;
	var respTypeObj0 = RESPONSE_MODE_OBJ0[respArrId];
	var respTypeObj1 = RESPONSE_MODE_OBJ1[respArrId];
	var respTypeObj2 = RESPONSE_MODE_OBJ2[respArrId];
	var respTypeObj3 = RESPONSE_MODE_OBJ3[respArrId];

	if(cpu==1 && pair1_contentObj0 != '')
	{
		if(respTypeObj0 == "class")
			pair1_contentObj0.className = loadingCLASS;
		else
			pair1_contentObj0.innerHTML = loadingIMG;
	}
	if(cpu==2 && pair2_contentObj0 != '')
	{
		if(respTypeObj0 == "class")
			pair2_contentObj0.className = loadingCLASS;
		else
			pair2_contentObj0.innerHTML = loadingIMG;
	}
	if(cpu==3 && pair3_contentObj0 != '')
	{
		if(respTypeObj0 == "class")
			pair3_contentObj0.className = loadingCLASS;
		else
			pair3_contentObj0.innerHTML = loadingIMG;
	}
	if(cpu==4 && pair4_contentObj0 != '')
	{
		if(respTypeObj0 == "class")
			pair4_contentObj0.className = loadingCLASS;
		else
			pair4_contentObj0.innerHTML = loadingIMG;
	}
}
function __cpu1__ajax_showWaitMessage() {return ajax_showWaitMessage(1);}
function __cpu2__ajax_showWaitMessage() {return ajax_showWaitMessage(2);}
function __cpu3__ajax_showWaitMessage()	{return ajax_showWaitMessage(3);}
function __cpu4__ajax_showWaitMessage()	{return ajax_showWaitMessage(4);}

function ajax_getAjaxFile(cpu,fileName)
{
	if(cpu==1)
	{
		ajax1.requestFile = fileName;		// Specifying which file to get
		ajax1.onCompletion 	= __cpu1__ajax_showContent;	// Specify function that will be executed after file has been found
		ajax1.onLoading 	= __cpu1__ajax_showWaitMessage;	// Action when AJAX is loading the file
		ajax1.runAJAX();		// Execute AJAX function
	} else if(cpu==2)
	{
		ajax2.requestFile = fileName;		// Specifying which file to get
		ajax2.onCompletion 	= __cpu2__ajax_showContent;	// Specify function that will be executed after file has been found
		ajax2.onLoading 	= __cpu2__ajax_showWaitMessage;	// Action when AJAX is loading the file
		ajax2.runAJAX();		// Execute AJAX function
	} else if(cpu==3)
	{
		ajax3.requestFile = fileName;		// Specifying which file to get
		ajax3.onCompletion 	= __cpu3__ajax_showContent;	// Specify function that will be executed after file has been found
		ajax3.onLoading 	= __cpu3__ajax_showWaitMessage;	// Action when AJAX is loading the file
		ajax3.runAJAX();		// Execute AJAX function
	} else if(cpu==4)
	{
		ajax4.requestFile = fileName;		// Specifying which file to get
		ajax4.onCompletion 	= __cpu4__ajax_showContent;	// Specify function that will be executed after file has been found
		ajax4.onLoading 	= __cpu4__ajax_showWaitMessage;	// Action when AJAX is loading the file
		ajax4.runAJAX();		// Execute AJAX function
	}
}

function ajax_getResponse(cpu,fileName,object0Id,object1Id,object2Id,object3Id)	// User have clicked on an article
{
	cpu = cpu||1;
	if(cpu == 1) {
		pair1_cachedContent = pair1_contentObj0 = pair1_contentObj1 = pair1_contentObj2 = pair1_contentObj3 = "";
		
		if(object0Id != '')	pair1_contentObj0 = document.getElementById(object0Id);
		if(object1Id != '')	pair1_contentObj1 = document.getElementById(object1Id);
		if(object2Id != '')	pair1_contentObj2 = document.getElementById(object2Id);
		if(object3Id != '')	pair1_contentObj3 = document.getElementById(object3Id);
	
		if(pair1_cacheCurrent && object0Id)
		{
			pair1_cachedContent = pair1_contentObj0.innerHTML;
		}
	} else if(cpu == 2) {
		pair2_cachedContent = pair2_contentObj0 = pair2_contentObj1 = pair2_contentObj2 = pair2_contentObj3 = "";
		
		if(object0Id != '')	pair2_contentObj0 = document.getElementById(object0Id);
		if(object1Id != '')	pair2_contentObj1 = document.getElementById(object1Id);
		if(object2Id != '')	pair2_contentObj2 = document.getElementById(object2Id);
		if(object3Id != '')	pair2_contentObj3 = document.getElementById(object3Id);
		
		if(pair2_cacheCurrent && object0Id)
		{
			pair2_cachedContent = pair2_contentObj0.innerHTML;
		}
	} else if(cpu == 3) {
		pair3_cachedContent = pair3_contentObj0 = pair3_contentObj1 = pair3_contentObj2 = pair3_contentObj3 = "";
		
		if(object0Id != '')	pair3_contentObj0 = document.getElementById(object0Id);
		if(object1Id != '')	pair3_contentObj1 = document.getElementById(object1Id);
		if(object2Id != '')	pair3_contentObj2 = document.getElementById(object2Id);
		if(object3Id != '')	pair3_contentObj3 = document.getElementById(object3Id);
		
		if(pair3_cacheCurrent && object0Id)
		{
			pair3_cachedContent = pair3_contentObj0.innerHTML;
		}
	} else if(cpu == 4) {
		pair4_cachedContent = pair4_contentObj0 = pair4_contentObj1 = pair4_contentObj2 = pair4_contentObj3 = "";
		
		if(object0Id != '')	pair4_contentObj0 = document.getElementById(object0Id);
		if(object1Id != '')	pair4_contentObj1 = document.getElementById(object1Id);
		if(object2Id != '')	pair4_contentObj2 = document.getElementById(object2Id);
		if(object3Id != '')	pair4_contentObj3 = document.getElementById(object3Id);
		
		if(pair4_cacheCurrent && object0Id)
		{
			pair4_cachedContent = pair4_contentObj0.innerHTML;
		}
	}
	
	//ajax_getAjaxFile(cpu,'../'+fileName);	// Calling the getAjaxFile function. argument to the function is id of this <li> + '.html', example "article1.html"
	ajax_getAjaxFile(cpu,PATH_PREFIX+fileName); // Calling the getAjaxFile function. argument to the function is id of this <li> + '.html', example "article1.html"
	//alertCPU(cpu);
}
function act_cache(cpu,act)
{
	cpu=cpu||1;
	act=act||'enable';
	
	if(cpu==1)
	{
		if(act=='enable') { pair1_cacheCurrent = true; }else{ pair1_cacheCurrent = false; }
	} else if(cpu==2)
	{
		if(act=='enable') { pair2_cacheCurrent = true; }else{ pair2_cacheCurrent = false; }
	} else if(cpu==3)
	{
		if(act=='enable') { pair3_cacheCurrent = true; }else{ pair3_cacheCurrent = false; }
	} else if(cpu==4)
	{
		if(act=='enable') { pair4_cacheCurrent = true; }else{ pair4_cacheCurrent = false; }
	}
}
function enable_cache(cpu) { cpu=cpu||1; return act_cache(cpu,'enable'); }
function disable_cache(cpu){ cpu=cpu||1; return act_cache(cpu,'disable'); }

function update_counters(cpu)
{
	if(document.getElementById('site_counters') != null)
	{
		cpu = cpu||1;
		ajax_getResponse(cpu,'infusions/ip_panel/include.counters_ajax.php?ref='+escape(document.referrer)+'&h='+ screen.height +'&w='+ screen.width + '&cs='+Math.random()*9999,'','site_counters');
	}
}

function update_banners(cpu)
{
	if(document.getElementById('site_banners') != null)
	{
		cpu = cpu||1;
		ajax_getResponse(cpu,'infusions/banner_panel/include.banner_ajax.php','','site_banners');
	}
}
function update_shoutbox(cpu,buttonClickDone)
{
	if(document.getElementById('site_shoutbox') != null)
	{
		cpu = cpu||1;
		buttonClickDone = buttonClickDone||false;
		var par2 = '';
		if(buttonClickDone != false)
		{
			enable_cache(cpu);
			par2 = 'refresh_shoutbox';
		}
		ajax_getResponse(cpu,'infusions/shoutbox_panel/include.shoutbox_ajax.php',par2,'site_shoutbox');
		if(buttonClickDone != false) disable_cache(cpu);
	}
}
function refresh_shoutbox()
{
	update_shoutbox(1,'click');
	update_counters(2);
	update_banners(3);
}

function delete_post(postId,delete_prefix,object1_prefix,object2_prefix,object3_prefix)
{
	var delObjId;
	var object1Id;
	var object2Id;
	var object3Id;
	delete_prefix = delete_prefix || "";
	object2_prefix = object2_prefix || "";
	object3_prefix = object3_prefix || "";
	object3_prefix = object3_prefix || "";
	if(delete_prefix) 	delObjId = delete_prefix+ postId;
	if(object1_prefix) 	object1Id = object1_prefix + postId;
	if(object2_prefix)	object2Id = object2_prefix + postId;
	if(object3_prefix) 	object3Id = object3_prefix + postId;
	
	PATH_PREFIX = '../';
	var delUrl = 'includes/include.post_ajax.php?act=delete&post_id='+postId;
	ajax_getResponse(1,delUrl,delObjId,object1Id,object2Id,object3Id);
	update_shoutbox(2);
	update_counters(3);
	update_banners(4);
}

function delete_comment(commentId,delete_prefix,object1_prefix,object2_prefix,object3_prefix)
{
	var delObjId;
	var object1Id;
	var object2Id;
	var object3Id;
	delete_prefix = delete_prefix || "";
	object2_prefix = object2_prefix || "";
	object3_prefix = object3_prefix || "";
	object3_prefix = object3_prefix || "";
	if(delete_prefix) 	delObjId = delete_prefix+ commentId;
	if(object1_prefix) 	object1Id = object1_prefix + commentId;
	if(object2_prefix)	object2Id = object2_prefix + commentId;
	if(object3_prefix) 	object3Id = object3_prefix + commentId;
	
	PATH_PREFIX = '';
	var delUrl = 'includes/include.comments_ajax.php?act=delete&comment_id='+commentId;
	ajax_getResponse(1,delUrl,delObjId,object1Id,object2Id,object3Id);
	update_shoutbox(2);
	update_counters(3);
	update_banners(4);
}

function post_votebox(act,postId,update_prefix,object1_prefix,object2_prefix,object3_prefix)
{
	//alert('aaaaa');
	var updObjId;
	var object1Id;
	var object2Id;
	var object3Id;
	RESPONSE_MODE_OBJ0[0] = 'class';
	RESPONSE_MODE_OBJ1[0] = 'innerHTML';
	RESPONSE_MODE_OBJ2[0] = 'class';
	RESPONSE_MODE_OBJ3[0] = 'innerHTML';
	update_prefix = update_prefix || "";
	object2_prefix = object2_prefix || "";
	object3_prefix = object3_prefix || "";
	object3_prefix = object3_prefix || "";
	if(update_prefix) 	updObjId = update_prefix + postId;
	if(object1_prefix) 	object1Id = object1_prefix + postId;
	if(object2_prefix)	object2Id = object2_prefix + postId;
	if(object3_prefix) 	object3Id = object3_prefix + postId;
	if(act == "vote_up" || act == "vote_down" || act == "vote_best")
	{
		PATH_PREFIX = '../';
		var updUrl = 'includes/include.post_ajax.php?act='+act+'&post_id='+postId;
		ajax_getResponse(1,updUrl,updObjId,object1Id,object2Id,object3Id);
		update_shoutbox(2);
		update_counters(3);
		update_banners(4);
	} else
	{
		alert('Nežinomas veiksmas');
	}
}