function explode (delimiter, string, limit) {
    // Splits a string on string separator and return array of components. If limit is positive only limit number of components is returned. If limit is negative all components except the last abs(limit) are returned.  
    // 
    // version: 1006.1915
    // discuss at: http://phpjs.org/functions/explode    // +     original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     improved by: kenneth
    // +     improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     improved by: d3x
    // +     bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)    // *     example 1: explode(' ', 'Kevin van Zonneveld');
    // *     returns 1: {0: 'Kevin', 1: 'van', 2: 'Zonneveld'}
    // *     example 2: explode('=', 'a=bc=d', 2);
    // *     returns 2: ['a', 'bc=d']
     var emptyArray = { 0: '' };
    
    // third argument is not required
    if ( arguments.length < 2 ||
        typeof arguments[0] == 'undefined' ||        typeof arguments[1] == 'undefined' ) {
        return null;
    }
 
    if ( delimiter === '' ||        delimiter === false ||
        delimiter === null ) {
        return false;
    }
     if ( typeof delimiter == 'function' ||
        typeof delimiter == 'object' ||
        typeof string == 'function' ||
        typeof string == 'object' ) {
        return emptyArray;    }
 
    if ( delimiter === true ) {
        delimiter = '1';
    }    
    if (!limit) {
        return string.toString().split(delimiter.toString());
    } else {
        // support for limit argument        var splitted = string.toString().split(delimiter.toString());
        var partA = splitted.splice(0, limit - 1);
        var partB = splitted.join(delimiter.toString());
        partA.push(partB);
        return partA;    }
}


function show_popup_window_sop(title,href)
{	
	$_js('popup_frame').src = href;
		
	$_js('popup_window_title').innerHTML = title;
	
	$_js('popup_window_back').style.display = 'block';
	$_js('popup_window').style.display = 'block';
	
	$_js('popup_window_back').style.height = document.body.scrollHeight + 'px';
	$_js('popup_window_back').style.width = document.body.clientWidth + 'px';
	
	$_js('popup_window').style.height = Math.round(BodySize().height*0.7) + 'px';
	$_js('popup_window').style.top  	= Math.round((BodySize().height/2) - ($_js('popup_window').clientHeight/2) + document.body.scrollTop) + 'px';
	$_js('popup_window').style.left 	= Math.round((BodySize().width/2) - ($_js('popup_window').clientWidth/2)) + 'px';
}

function hide_popup_window_sop()
{
	$_js('popup_window_back').style.display = 'none';
	$_js('popup_window').style.display = 'none';
}

function BodySize()
{
var width = document.body.clientWidth; // ширина 
var height = document.body.clientHeight; // высота

return {"width":width, "height":height};
}

function show_hide_add_response()
{
	var nav = userNavigator();
	display = (nav=='isIE' ? "block" : "table-row");
		
	if($('add_response').style.display == 'none')
		$('add_response').style.display = display;
	else
		$('add_response').style.display = 'none';
}

function check_response_text()
{
	var obj = $_js('response_text');
	var text_len = obj.value.length;
	
	if(text_len<=250)
		$_js('count_response').innerHTML = 250-text_len;
	else
	{
		obj.value = obj.value.substr(0,250);
	}
}


