function togglePlayer() {
	$billboard = $('#player_outer');
	$player = $('#player');
	var userAgent = navigator.userAgent.toLowerCase();
	var ff = false;
	if (/mozilla/.test (userAgent) && !/(compatible|webkit)/.test(userAgent)) { ff = true; }
	if ($billboard.height() < '250') {
		(ff) ? $billboard.height('250px') : $billboard.animate({ height: '250px' }, 'slow');
		(ff) ? $player.height('250px') : $player.animate({ height: '250px' }, 'slow');
	} else {
		(ff) ? $billboard.height('30px') : $billboard.animate({ height: '30px' }, 'slow');
		(ff) ? $player.height('30px') : $player.animate({ height: '30px' }, 'slow');
	}
}
function signout(){
	$.ajax({
		url: 'signout.php',
		type: 'POST', 
		data: "",
		async: false,
		cache: false,
		timeout: 30000,
		error: function(){
			alert('Sorry there was an error - please try again later!');
			return false;
		},
		success: function(msg){ 
			$("#signin").html("LOGIN: <span id=\"signin_pointer\" style=\"display:none;\"><img src=\"images/arrow_blinking_red.gif\"></span><input name=\"signin_email\" id=\"signin_email\" type=\"text\" class=\"signinTxt\" value=\"username\" onclick=\"document.getElementById('signin_email').value=''\"/> <input name=\"singin_pass\" id=\"singin_pass\" type=\"password\" class=\"signinTxt\" value=\"password\" onclick=\"document.getElementById('singin_pass').value=''\"/> <input type=\"submit\" name=\"submit\" id=\"signinSubmit\" value=\"GO\" class=\"signinSubmit\"/>");
			//$(".lcomment").html("<a href=\"signup.php\" class=\"iframe zoom_signup\">SIGN UP</a> or LOGIN to leave a comment!");
			$(".lcomment").fadeOut(300);
			$(".ncomment").fadeIn(600);
			//alert('logged out');
			return false;
		}
	});	
}
function save_comment(type,id,fix){
	var comment	= $("#commentbox_"+type+"_"+fix).val();
	//alert(comment);
	$.ajax({
		url: 'save_comment.php',
		type: 'POST', 
		data: "t="+type+"&i="+id+"&c="+comment,
		async: false,
		cache: false,
		timeout: 30000,
		error: function(){
			alert('Sorry there was an error saving your comment - please try again later!');
			return false;
		},
		success: function(msg){ 
			//alert(msg);
			if (parseFloat(msg) == 1){
				//- success! reload section
				if(type == 'photo'){
					loadPhoto(id,fix);
				}
				else if(type == 'live'){
					loadLive(id,fix);
				}
				else if(type == 'news'){
					loadNews(id,'',fix);
				}
				return false;
			} else if(parseFloat(msg) == 3){
				alert('You didn\'t write anything!');
				return false;
			}
			else {
				alert('Sorry, there was a problem saving your comment.\nPlease make sure you are logged in.');
				return false;
			}
		}
	});	
	return false;
}
function loadDisc(what,fix) {
	//$("#show").load('load_disc.php?id='+what);
	$(".disc_middle").fadeOut();
	$.ajax({
		url : 'load_disc.php?id='+what+'&fix='+fix,
		success : function (data) {
			$("#show_disc_"+fix).html(data);
			$(".disc_middle").fadeIn(1000);
			$.scrollTo("#show_disc_"+fix, 800);
		}
	});
}
function loadPhoto(what,fix) {
	//alert(what +'\n'+fix);
	$(".photo_left").fadeOut();
	$.ajax({
		url : 'load_photo.php?id='+what+'&fix='+fix,
		success : function (data) {
			$("#show_photo_"+fix).html(data);
			$(".photo_left").fadeIn(1000);
			$.scrollTo("#show_photo_"+fix, 800);
		}
	});
}
function loadVideo(what,fix) {
	//alert(what +'\n'+fix);
	$(".video_main").fadeOut();
	$.ajax({
		url : 'load_video.php?id='+what+'&fix='+fix,
		success : function (data) {
			$("#show_video_"+fix).html(data);
			$(".video_main").fadeIn(1000);
			$.scrollTo("#show_video_"+fix, 800);
		}
	});
}
function loadScrap(what,fix) {
	$(".scrap_main").fadeOut();
	$.ajax({
		url : 'load_scrap.php?id='+what+'&fix='+fix,
		success : function (data) {
			$("#show_scrap_"+fix).html(data);
			$(".scrap_main").fadeIn(1000);
			$.scrollTo("#show_scrap_"+fix, 800);
		}
	});
}
function loadNews(what,lang,fix) {
	//alert(what +'\n'+lang+'\n'+fix);
	$(".news_right").fadeOut(100);
	$.ajax({
		url : 'load_news.php?id='+what+'&filter='+lang+'&fix='+fix,
		success : function (data) {
			$("#show_news_"+fix).html(data);
			$(".news_right").fadeIn(800);
		}
	});	
}
function loadLive(what,fix) {
	//alert(what);
	$(".live_right").fadeOut(100);
	$.ajax({
		url : 'load_live.php?id='+what+'&fix='+fix,
		success : function (data) {
			$("#show_live_"+fix).html(data);
			$(".live_right").fadeIn(1000);
		}
	});	
}
function highlightLogin(){
	$("#signin_pointer").fadeIn(1000);
	$.scrollTo("#wrapper", 800);
}
function toggleTracklist(fix) {
	$("#tracklist_show_"+fix).slideToggle();
}
		
function submitChooseArtistForm(){
		//alert('here');
	var artist_id =document.getElementById('artist_id').value;	
	window.location.href='../login/admin.php?artist_id='+artist_id;
}
function popUp(strURL){
	newwindow=window.open(strURL,'name',"menubar=no,width=668,height=608,toolbar=no,resizable=no");
	if (window.focus) {newwindow.focus()}
}
function popUpShare(strURL){
	newwindow=window.open(strURL,'name',"menubar=no,width=668,height=608,toolbar=no,resizable=yes");
	if (window.focus) {newwindow.focus()}
}