function toggleDiv(div) {
    document.getElementById(div).style.display = (document.getElementById(div).style.display == 'none') ? 'block' : 'none';
    return false;
}
function printMe() {
    window.print();
}

function bookmarkMe() {
    var title = "KFC";
    var url = window.location.href;
    if(document.all) { // IE Favorite
        window.external.AddFavorite(url, title); 
    }
    else if(window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(title,url,url);
    } 
}

function voteThis(mainId, id, home) {
    $.ajax({
      url: "/vote.php",
      type: "POST",
      data: "id="+id+"&vote_id="+mainId+"&home="+home,
      success: function(html){
        if(home === true) {
            $("#homeAnketa").html(html);
        } else {
            $("#anketa").html(html);
        }
      }
    });
}


$(function(){
	$.viewMap = {
		'0' : $([]),
		'1' : $('.beograd'),
		'2' : $('.novi_sad')
	};

	$('#city').change(function() {
		$.each($.viewMap, function() { this.hide().find('select').attr('disabled', 'disabled'); });
		if ($(this).val() != ''){
			$.viewMap[$(this).val()].show().find('select').removeAttr('disabled');
		}
	});

});
