
function vote(mix, upOrDown) {
    var 
        whichMix, whichMixRating;
    whichMix = '#mixID_' + mix;
    whichMixRating = '#mixRating_' + mix;
    d = "mix_id=" + mix + "&UpOrDown=" + upOrDown;
    $.ajax({
        'type': 'get',
        'data': d,
        'url': "/vote",
        'dataType': 'html',
        'error': function(req, stat, err) {
                    alert("A server error occurred.");
                },
        'success': function(msg, stat, req) { 
                    if (msg != 'novote') {
                        $(whichMix).effect('explode');
                        $(whichMixRating).empty();
                        $(whichMixRating).append(msg);
                    } else {
						alert("Sorry, you're either not logged in or you have voted on this track already.");
					}
                }
    }); 


}


function checkNav() {
			var agent = navigator.userAgent.toLowerCase();
			var is_khtml = (agent.indexOf('khtml')!= -1);
			var is_ie = (agent.indexOf('msie')!= -1);
			var is_chrome = (agent.indexOf('chrome')!= -1);
			var is_safari = (agent.indexOf('safari')!= -1);
			var pad;
			var fill = 6;
			pad = 37;
			if (is_khtml) { 
				//$("#topWidgets").css("width", "960px");
				pad = 17;
			} 
				
			if (is_ie) {
				pad = 27; //25;
			}

			if (is_safari) {
					pad = 23;
					fill = 6;
			}

			if (is_chrome) {
				pad = 40; //32
			}


			var twh = document.getElementById('scTopMixes').offsetHeight;
			var eh = document.getElementById('eventBox').offsetHeight;
				var nh = twh - eh - 161 - pad;
				if (is_chrome) {nh = nh + 20;}
				if (is_ie) {nh = nh + 8;}
				if (is_safari) {
						nh = nh + fill;
					}
			$('#gigBox').css('height', nh + 'px');
			var gbox = document.getElementById('gigBox').offsetHeight;
			var gcontent = document.getElementById('gigContent').offsetHeight;
			var gheading = document.getElementById('gigHeading').offsetHeight;
			var gbuttons = (document.getElementById('gigButtons').offsetHeight * 2);
			if (is_khtml) {
				var bmargin = nh - gcontent - gheading - gbuttons - pad;
			} else {
				var bmargin = nh - gcontent - gheading - gbuttons - pad;
			}
			$('#gigButtons').css('margin-top', bmargin + 'px');
}


