function show_comment_block(ob,city)
{
	var Obj = document.getElementById(ob);
	var type = ob.substr(8,ob.length-8);
	var rus_type = '';
	switch (type) 
	{
		case 'avia' : rus_type = 'авиаперевозки'; break;
		case 'avto' : rus_type = 'автоперевозки'; break;
		case 'gd' : rus_type = 'Ж/Д перевозки'; break;
	}
	
	if(Obj.style.display=='none')
	{
		Obj.style.display='block';
		document.getElementById('head_comment_'+ob.substr(8,4)).innerHTML = '<a class=\"href1\" onclick=\";show_comment_block(\''+ob+'\',\''+city+'\');\">скрыть комментарии и услувия '+rus_type+' в г. '+city+'</a>';
	}
	else
	{
		Obj.style.display='none';
		document.getElementById('head_comment_'+ob.substr(8,4)).innerHTML = '<a class=\"href1\" onclick=\";show_comment_block(\''+ob+'\',\''+city+'\');\">показать комментарии и услувия '+rus_type+' в г. '+city+'</a>';
	}
}


function showTr()
{
	var display = userNavigator()=='isIE' ? "block" : "table-row";
	for(var i=0; i<arguments.length; i++)
		$('tr'+arguments[i]).style.display = display;
}
function hideTr()
{
	for(var i=0; i<arguments.length; i++)
		$('tr'+arguments[i]).style.display = "none";
}
function clean(obj)
{
	 if(obj.value == obj.title)
	 {
		  obj.style.color="#000";
		  obj.value="";
	 }
}
function setHelp(obj)
{
	 if(obj.value=="")
	 {
		  obj.style.color="#999";
		  obj.value=obj.title;
	 }
}

function setValDll(punct, val)
{
	try {
		$('dll_po').style.display = 'none';
		$('dll_pn').style.display = 'none';
		if(val != '')
			$('input_'+punct).value = str_replace('*', ' ', val);
	} catch(e) {}	
}

// {{{ str_replace
function str_replace(search, replace, subject) {
    // Replace all occurrences of the search string with the replacement string
    // 
    // +    discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_str_replace/
    // +       version: 812.1017
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Gabriel Paderni
    // +   improved by: Philip Peterson
    // +   improved by: Simon Willison (http://simonwillison.net)
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   bugfixed by: Anton Ongson
    // +      input by: Onno Marsman
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    tweaked by: Onno Marsman
    // *     example 1: str_replace(' ', '.', 'Kevin van Zonneveld');
    // *     returns 1: 'Kevin.van.Zonneveld'
    // *     example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars');
    // *     returns 2: 'hemmo, mars'

    var f = search, r = replace, s = subject;
    var ra = r instanceof Array, sa = s instanceof Array, f = [].concat(f), r = [].concat(r), i = (s = [].concat(s)).length;

    while (j = 0, i--) {
        if (s[i]) {
            while (s[i] = (s[i]+'').split(f[j]).join(ra ? r[j] || "" : r[0]), ++j in f){};
        }
    };

    return sa ? s : s[0];
}// }}}

function _$(id)
{
	return document.getElementById(id);	
}


















