function vote_opinion(type,id,value) {
	if (ge("u_"+id).className == "vote_up" && ge("d_"+id).className == "vote_down") {
		var ajax = new Ajax();
		qArr = new Array();
		qArr['type'] = type;
		qArr['id'] = id;
		qArr['value'] = value;
		ajax.onDone = function(ajaxObj,responseText) {
			ge("vote_"+id).innerHTML = responseText;
			
			if (value > 0) {
				ge("u_"+id).className = "vote_up_ok";
				ge("d_"+id).className = "vote_down_disable";
			} else {
				ge("u_"+id).className = "vote_up_disable";
				ge("d_"+id).className = "vote_down_ok";
			}
			
		}; 
		ajax.get('/add/opinion_voter.php', qArr);
	}
}

function ajaxSaveCity (cityDomain) {
	var ajax = new Ajax();
	qArr = new Array();
	qArr['city_domain'] = cityDomain;
	ajax.onDone = function(ajaxObj,responseText) {
		alert (responseText);
	}; 
	ajax.post('/add/set_city.php', qArr);
}

function ge()
{
  var ea;
  for( var i = 0; i < arguments.length; i++ ) {
    var e = arguments[i];
    if( typeof e == 'string' )
      e = document.getElementById(e);
    if( arguments.length == 1 )
      return e;
    if( !ea )
      ea = new Array();
    ea[ea.length] = e;
  }
  return ea;
}


function isIE() {
 return (navigator.userAgent.toLowerCase().indexOf("msie") != -1);
}   

