function ajax(url, parameters) {
    http_request = false;
    
    if( window.XMLHttpRequest ){ // Mozilla, Safari, ...
        http_request = new XMLHttpRequest();
        if( http_request.overrideMimeType ) http_request.overrideMimeType('text/html');
    } else if( window.ActiveXObject ){ // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e){
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){}
        }
    }
    if( !http_request ){
        alert('ERROR: cannot execute ajax...');
        return false;
    }
    
    http_request.open('POST', url, false);
    http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http_request.setRequestHeader("Content-length", parameters.length);
    http_request.setRequestHeader("Connection", "close");
    http_request.send(parameters);
    
    if( http_request.readyState == 4 && http_request.status == 200 ){
        return http_request.responseText;
    } else return false;
}

function showDiv(id){
    if( document.getElementById(id).style.display == "block" ) document.getElementById(id).style.display = "none";
    else document.getElementById(id).style.display = "block";
}

function swapNews(show, hide){
    document.getElementById(show).style.display = "block";
    document.getElementById(hide).style.display = "none";
}

function showTabs(tab){
    switch( tab ){
        case "description":
            document.getElementById("features").style.display = "none";
            document.getElementById("specifications").style.display = "none";
            document.getElementById("features_a").className = "";
            document.getElementById("specifications_a").className = "";
            break;
        case "features":
            document.getElementById("description").style.display = "none";
            document.getElementById("specifications").style.display = "none";
            document.getElementById("description_a").className = "";
            document.getElementById("specifications_a").className = "";
            break;
        case "specifications":
            document.getElementById("description").style.display = "none";
            document.getElementById("features").style.display = "none";
            document.getElementById("description_a").className = "";
            document.getElementById("features_a").className = "";
            break;
    }
    document.getElementById(tab + "_a").className = "active";
    document.getElementById(tab).style.display = "block";
}

function validateContactForm(){
	var name = document.getElementById('fname').value;
	var lname = document.getElementById('lname').value;
	var email = document.getElementById('email').value;
	var showError="";
	
		if (name == ''){
			showError += 'Please enter your Name\r\n';
		}
		if (lname == ''){
			showError += 'Please enter your Last Name\r\n';
		}
		if (email.indexOf('@') == -1){
			showError += 'Please enter a valid Email Address\r\n';
		}
		
		if (showError != ''){
			alert (showError);
			return false;
		}else{
			return true;
	}
}

function validateContact(){
	
	var name = document.getElementById('fname').value;
	var sname = document.getElementById('sname').value;
	var email = document.getElementById('email').value;
	var company = document.getElementById('company').value;
	var contact = document.getElementById('contact').value;
	var info = document.getElementById('info').value;
	var position = document.getElementById('position').value;
	var showError="";
	
		if (name == ''){
			showError += 'Please enter your Name\r\n';
		}
		if (sname == ''){
			showError += 'Please enter your Surname\r\n';
		}
		if (email.indexOf('@') == -1){
			showError += 'Please enter a valid Email Address\r\n';
		}
		if (company == ''){
			showError += 'Please enter your Company\r\n';
		}
		if (showError != ''){
			alert (showError);
			return false;
		}else{
			return true;
	}
}

function ShowPicture(id,Source) {
	if (Source=="1"){
		document.getElementById(''+id+'').style.display = "block";
	}else{
		document.getElementById(''+id+'').style.display = "none";
	}
} 
function resize(){
	
	var bodyHeight = document.body.clientHeight;
	var bodyWidth = document.body.clientWidth;	
	document.getElementById("footer_img").style.width=bodyWidth+"px";
}

function getPeople(peopleid){
		
		/*selected name in red*/
		$(".names_nav a").removeClass('names_nav_active');
		$("#name"+peopleid).addClass('names_nav_active');
		
		/*selected picture in red*/
		$(".active_portrait").animate({opacity: 0});
		$("#active_portrait"+peopleid).animate({opacity: 1});
		
		var id = ajax("ajax/people.php", "peopleid="+peopleid);
		if( id != "0" && id != "" && id != 0){
			
			//$("#people_content").html(id);
			document.getElementById("people_content").innerHTML = id;
			
		}
}

/*function validateLogin(){
	
	var name = document.getElementById("loginName").value;
	var pword = document.getElementById("loginPword").value;
	
	var id = ajax("ajax/login.php", "name="+name+"&pword="+pword);
	if( id != "0" && id != "" && id != 0){
		//window.location.reload();		
		window.location.href='http://www.dfishinsea.co.uk/client_area/pursue/index.php?section='+id;		
	}else{
		alert("The username and password combination does not exist. Please try again.");
	}
	
}*/

function lostPword(){
	if(document.getElementById("showLostPword").style.display != 'block'){
		document.getElementById("showLostPword").style.display = 'block';
		document.getElementById("showLostPword1").style.display = 'block';
	}else{
		document.getElementById("showLostPword").style.display = 'none';
		document.getElementById("showLostPword1").style.display = 'none';

	}
	
	
}

function getLostPword(){
	var name = document.getElementById("forgotPword").value;
	
	var id = ajax("ajax/forgotPaword.php", "name="+name);
	if( id != "0" && id != "" && id != 0){
		//window.location.reload();		
		//window.location.href='http://www.dfishinsea.co.uk/client_area/pursue/index.php?section='+id;
		alert("The username and password has been sent to you email address.");
	}else{
		alert("The username does not exist. Please try again.");
	}
}

function setOpacity( value, name ) {
 document.getElementById(""+name+"_feed_div").style.opacity = value / 10;
 document.getElementById(""+name+"_feed_div").style.filter = 'alpha(opacity=' + value * 10 + ')';
}
 
function fadeInMyPopup(name) {

 for( var i = 0 ; i <= 300 ; i++ )
   setTimeout( 'setOpacity(' + (i / 30) + ', "'+name+'")' , 8 * i );
}

function toggleSocial(name){	
	if(document.getElementById(""+name+"_feed_div").style.display == 'none'){
	
		$("#twitter_feed_div").fadeTo('fast', 0);
		$("#facebook_feed_div").fadeTo('fast', 0);
		$("#myspace_feed_div").fadeTo('fast', 0);
	
		document.getElementById("facebook_feed_div").style.display = 'none';
		//document.getElementById("facebook_feed_div").style.opacity = 0;
		//document.getElementById("facebook_social_link").setAttribute("class", "");
		$("#facebook_social_link").attr('class', '');
		
		document.getElementById("myspace_feed_div").style.display = 'none';
		//document.getElementById("myspace_feed_div").style.opacity = 0;
		//document.getElementById("myspace_social_link").setAttribute("class", "");
		$("#myspace_social_link").attr('class', '');
		
		document.getElementById("twitter_feed_div").style.display = 'none';
		//document.getElementById("twitter_feed_div").style.opacity = 0;
		//document.getElementById("twitter_social_link").setAttribute("class", "");
		$("#twitter_social_link").attr('class', '');
		
		
		
		document.getElementById(""+name+"_feed_div").style.display = 'block';
		//document.getElementById(""+name+"_social_link").setAttribute("class", "social_ticker_top_active");
		$("#"+name+"_social_link").attr('class', 'social_ticker_top_active');
		$("#"+name+"_feed_div").fadeTo('slow', 1.0);
		//fadeInMyPopup(name);
	 }
}

function showRedDiv(id){
	for (i=1; i<document.getElementsByName("events_gallery_name").length; i++){
		document.getElementById("events_gallery_"+i+"").style.display = 'none';
	}
	document.getElementById("events_gallery_"+id+"").style.display = 'block';
}

function hideRedDiv(id){
	for (i=1; i<document.getElementsByName("events_gallery_name").length; i++){
		document.getElementById("events_gallery_"+i+"").style.display = 'none';
	}
}

function loadArtistList(type){
	//alert(type);
	/*document.getElementById("dj_grid_wrapper_inner").innerHTML = '<img class="loading" src="images/bar-circle.gif"><div class="clearboth"></div>';
	
	
	if(type== 'name'){
		value = document.getElementById("DJname").value;
	}*/
	
	var id = ajax("ajax/artistsList.php", "type="+type);
	if( id != "0" && id != "" && id != 0){
		
		document.getElementById("dj_name_wrapper_inner").innerHTML = id;
	}else{
		alert("The username and password combination does not exist. Please try again.");
	}
	
}


function searchType(id){
	document.getElementById("artists_genre_wrapper").style.display='none';
	document.getElementById("artists_name_wrapper").style.display='none';
	document.getElementById("artists_events_wrapper").style.display='none';
	document.getElementById(id).style.display='block';
	
	document.getElementById("artists_genre_wrapper_text").style.color='#000000';
	document.getElementById("artists_name_wrapper_text").style.color='#000000';
	document.getElementById("artists_events_wrapper_text").style.color='#000000';
	
	document.getElementById(id+"_text").style.color='#ff0000';
}

function validateRegister(){
var tthis='popup/regular.html';
	$(tthis).prettyPopin({width: 550,followScroll:false})
	var fname = document.getElementById("fname").value;
	var lname = document.getElementById("lname").value;
	var email = document.getElementById("emailreg").value;
	var password = document.getElementById("passwordreg").value;
	var cpassword = document.getElementById("cpassword").value;
	var countrySelect = document.getElementById("countrySelect").value;
	var stateSelect = document.getElementById("stateSelect").value;
	var newsletter = 0;
	if(document.getElementById("joinNews").checked){
		newsletter = 1;
	}
	
	var errorMSG='';
	
	
	
	if(fname == ''){
		errorMSG +='Please enter your First name\n';	
	}
	if(lname == ''){
		errorMSG +='Please enter your Last name\n';	
	}
	if (email.indexOf('@') == -1){
		errorMSG += 'Please enter a valid Email Address\n';
	}else{
		var emailCheck = ajax("ajax/emailCheck.php", "email="+email);
		if( emailCheck == "1" && emailCheck != "" && emailCheck == 1){
			errorMSG += 'The email address already exists in our system.\n';
		}
	}
	if(password == ''){
		errorMSG +='Please enter a password\n';	
	}
	if(cpassword != password){
		errorMSG +='The passwords do not match\n';	
	}
	if(stateSelect == ''){
		errorMSG +='Please select a city\n';	
	}
	
	if(errorMSG != ''){
		alert(errorMSG);
		return false;
	}else{
		var reg = ajax("ajax/register.php", "fname="+fname+"&lname="+lname+"&email="+email+"&password="+password+"&countrySelect="+countrySelect+"&stateSelect="+stateSelect+"&newsletter="+newsletter);
		if( reg == "0" || reg == "" || reg == 0){
			alert("An unexpected error occurred. Please try again.");
		}else{
			alert("Thank you for registering with PMG.\n\rAn email with your account details have been sent to "+email+".");
			window.location.reload();
		}
		return false;
	}
}

function validateLogin(){
	var loginName = document.getElementById("loginName").value;
	var loginPword = document.getElementById("loginPword").value;
	var errorMSG='';
	
	if(loginName == '' || loginPword==''){
		errorMSG +='Please enter your email and password to login\n\r';	
	}
	
	if(errorMSG != ''){
		alert(errorMSG);
		return false;
	}else{
		var id = ajax("ajax/login.php", "loginName="+loginName+"&loginPword="+loginPword);
		
		if(id.indexOf('1') > -1 || id.indexOf(1) > -1){
			window.location.reload();
			//alert("oops.");
		}else{
			alert("The email and password combination does not exist in the PMG system.\n\rPlease register or try login again.");
		}
		return false;
	}
}

function getAccInfo(value){
	var type='';
	
	switch(value){
		case 1:
		  type = 'general';
		  break;
		case 2:
		  type = 'billing';
		  break;
		case 3:
		  type = 'shipping';
		  break;
		case 4:
		  type = 'basket';
		  break;  
		default:
		  type = 'general';
	}
	
	var memberInfo = ajax("ajax/memberInfo.php", "type="+type);
	//alert(memberInfo);
	document.getElementById("register_wrapper").innerHTML = '';
	document.getElementById("register_wrapper").innerHTML = memberInfo;
	
	for(i=1; i<4; i++){
		document.getElementById("getAccInfo"+i).style.color = '#ffffff';
	}
	document.getElementById("getAccInfo"+value).style.color = '#ff0000';
}

function updatePriceTotal(price){
	/*alert('k');*/
	/*var ticketType = document.getElementById("ticket_type_"+productId).value;
	var ticketQuantity = document.getElementById("ticket_quantity_"+productId).value;
	var ticketVal = ticketType * ticketQuantity;*/
	
	var price = ajax("ajax/updatePrice.php", "price="+price);
	//alert(price);
	
	$('.basketTotal').html(price);
	return false;
}

function addToBasket(productTable, productId, productUrl){
	
	var ticketType = document.getElementById("ticket_type_"+productId).value;
	var ticketQuantity = document.getElementById("ticket_quantity_"+productId).value;
	var ticketVal = ticketType * ticketQuantity;
	var basket = ajax("ajax/addToBasket.php", "productTable="+productTable+"&productId="+productId+"&ticketVal="+ticketVal+"&ticketQuantity="+ticketQuantity+"&unitPrice="+ticketType+"&productUrl="+productUrl);
	
	var price = ajax("ajax/updatePrice.php", "productTable="+productTable+"&productId="+productId+"&ticketVal="+ticketVal+"&ticketQuantity="+ticketQuantity+"&unitPrice="+ticketType+"&productUrl="+productUrl);
	//alert(price);
	
	$('#basketItemsWrap ul').append(basket);
	$('.basketTotal').html(price);
	
}

function addToBasketProduct(productTable, productId, productUrl){
	
	var prodColour = document.getElementById("chosenColor").innerHTML;
	var prodQty = document.getElementById("product_qty_select").value;
	if(document.getElementById("product_sizes_select")){
		var prodSize = document.getElementById("product_sizes_select").value;
	}else{
		var prodSize = '';
	}
	
	var basket = ajax("ajax/addToBasketProduct.php", "productTable="+productTable+"&productId="+productId+"&prodColour="+prodColour+"&prodQty="+prodQty+"&prodSize="+prodSize+"&productUrl="+productUrl);
}

function getPrice(id){
	var ticketType = document.getElementById("ticket_type_"+id).value;
	var ticketQuantity = document.getElementById("ticket_quantity_"+id).value;
	
	var ticketVal = ticketType * ticketQuantity;
	
	document.getElementById("ticket_price_"+id).innerHTML = "&pound;"+ticketVal;
}

function basketTotals(basketQuantity, basketTot){
	document.getElementById("basketTot").innerHTML = 'Items : 0'+basketQuantity+'<br>Total : &pound;'+basketTot+'';
	return false;
}

function UpdateGeneralDetails(){
	/*fname, lname, emailreg, countrySelect, stateSelect, phone*/
	var fname = document.getElementById("fname").value;
	var lname = document.getElementById("lname").value;
	var emailreg = document.getElementById("emailreg").value;
	var countrySelect = document.getElementById("countrySelect").value;
	var stateSelect = document.getElementById("stateSelect").value;
	var phone = document.getElementById("phone").value;
	
	var UpdateMemberInfo = ajax("ajax/UpdateMemberInfo.php", "type=general&fname="+fname+"&lname="+lname+"&emailreg="+emailreg+"&billing_country="+countrySelect+"&billing_city="+stateSelect+"&phone="+phone);
	//alert(memberInfo);
	/*document.getElementById("register_wrapper").innerHTML = '';
	document.getElementById("register_wrapper").innerHTML = memberInfo;*/
	if( UpdateMemberInfo.indexOf('fail') == -1){
		alert("Your details have been updated.\n\rThank You.");
	}else{
		alert("An unexpected error occurred.\n\rPlease try again..");
	}
	
}

function UpdateBillingDetails(){
	/*billing_add1, billing_add2, billing_add3, countrySelect, stateSelect, billing_pcode*/
	var billing_add1 = document.getElementById("billing_add1").value;
	var billing_add2 = document.getElementById("billing_add2").value;
	var billing_add3 = document.getElementById("billing_add3").value;
	var countrySelect = document.getElementById("countrySelect").value;
	var stateSelect = document.getElementById("stateSelect").value;
	var billing_pcode = document.getElementById("billing_pcode").value;
	
	var UpdateMemberInfo = ajax("ajax/UpdateMemberInfo.php", "type=billing&billing_add1="+billing_add1+"&billing_add2="+billing_add2+"&billing_add3="+billing_add3+"&billing_country="+countrySelect+"&billing_city="+stateSelect+"&billing_pcode="+billing_pcode);
	//alert(memberInfo);
	/*document.getElementById("register_wrapper").innerHTML = '';
	document.getElementById("register_wrapper").innerHTML = memberInfo;*/
	if( UpdateMemberInfo != "0" || UpdateMemberInfo != "" || UpdateMemberInfo != 0){
		alert("Your details have been updated.\n\rThank You.");
	}else{
		alert("An unexpected error occurred.\n\rPlease try again..");
	}
	
}

function UpdateShippingDetails(){
	/*billing_add1, billing_add2, billing_add3, countrySelect, stateSelect, billing_pcode*/
	var shipping_add1 = document.getElementById("shipping_add1").value;
	var shipping_add2 = document.getElementById("shipping_add2").value;
	var shipping_add3 = document.getElementById("shipping_add3").value;
	var countrySelect = document.getElementById("countrySelect").value;
	var stateSelect = document.getElementById("stateSelect").value;
	var shipping_pcode = document.getElementById("shipping_pcode").value;
	
	var UpdateMemberInfo = ajax("ajax/UpdateMemberInfo.php", "type=shipping&shipping_add1="+shipping_add1+"&shipping_add2="+shipping_add2+"&shipping_add3="+shipping_add3+"&shipping_country="+countrySelect+"&shipping_city="+stateSelect+"&shipping_pcode="+shipping_pcode);
	//alert(memberInfo);
	/*document.getElementById("register_wrapper").innerHTML = '';
	document.getElementById("register_wrapper").innerHTML = memberInfo;*/
	if( UpdateMemberInfo != "0" || UpdateMemberInfo != "" || UpdateMemberInfo != 0){
		alert("Your details have been updated.\n\rThank You.");
	}else{
		alert("An unexpected error occurred.\n\rPlease try again..");
	}
	
}


function loadServiceContent(page_id){
	var getInfo = ajax("ajax/loadServices.php", "pageid="+page_id);
	var ua = window.navigator.userAgent;
	var msie = ua.indexOf ( "MSIE " );
	//alert(document.getElementsByName("serviceTabId").length);
	for(i=0; i<document.getElementsByName("serviceTabId").length; i++){
		document.getElementsByName("serviceTabId")[i].style.backgroundColor = '#fff';
		document.getElementsByName("serviceTabId")[i].style.color = '#000';
	}
	
	document.getElementById("serviceTabId_"+page_id).style.backgroundColor = '#ff0000';
	document.getElementById("serviceTabId_"+page_id).style.color = '#fff';
	
	/*if(msie < 0){
		document.getElementById("img_cap0").setAttribute('onclick', 'actionEvent("orange")');
		document.getElementById("img_map0").setAttribute('onclick', 'actionEvent("orange")');
	}else{
		document.getElementById("img_cap0").onclick = function() { actionEvent("orange"); };
		document.getElementById("img_cap0").onclick = function() { actionEvent("orange"); };

	}*/

	
	if( getInfo != "0" || getInfo != "" || getInfo != 0){
		document.getElementById("services_special_wrapper").innerHTML = '';
		document.getElementById("services_special_wrapper").innerHTML = getInfo;
	}else{
		
	}
}

function loadBrands(boxid){
	var getInfo = ajax("ajax/loadBrands.php", "boxid="+boxid);
	var ua = window.navigator.userAgent;
	var msie = ua.indexOf ( "MSIE " );
	
	if( getInfo != "0" || getInfo != "" || getInfo != 0){
		document.getElementById("carousel-caption-div").innerHTML = '';
		document.getElementById("carousel-caption-div").innerHTML = getInfo;
	}else{
		
	}
}


function launchLightBox(type){
	
	var clientHeight = document.body.clientHeight;
	var clientWidth = document.body.clientWidth;
	document.getElementById("greyBoxWrapper").style.display="block";
	document.getElementById("greyBoxWrapper").style.height=clientHeight+"px";
	document.getElementById("greyBoxWrapper").style.width=clientWidth+"px";
	var str='';
	
	switch(type){
		case 'product':
		  str+='<div class="PopupWrapper" style="width:200px; height:200px;"><table width="100%" height="100%" cellspacing="0" cellpadding="0"><tr><td valign="middle" align="center">The item has been added to you basket.</td></tr></table></div>';
		  break;
		default:
		  str+='Unexpected ERROR.';
	}
	
	document.getElementById("greyBoxWrapperInner").innerHTML = str;
	
	return false;
}

function loadProduct(prodid){
	var UpdateProduct = ajax("ajax/UpdateProduct.php", "prodid="+prodid);
	//alert(memberInfo);
	
	if( UpdateProduct != "0" || UpdateProduct != "" || UpdateProduct != 0){
		document.getElementById("product_item_wrapper").innerHTML = '';
		document.getElementById("product_item_wrapper").innerHTML = UpdateProduct;
	}else{
		
	}
}

function selectedColour(id,color){
	var myCount = document.getElementsByName("colorSelect");
	for(i=0; i < myCount.length; i++){
		document.getElementById('colorSelect_'+i).style.display='none';
	}
	document.getElementById('colorSelect_'+id).style.display='block';
	document.getElementById('chosenColor').innerHTML=color;
}

function sendEmail(){
	var yourName = document.getElementById("yourName").value;
	var yourEmail = document.getElementById("yourEmail").value;
	var friendsName = document.getElementById("friendsName").value;
	var friendsEmail = document.getElementById("friendsEmail").value;
	var subject = document.getElementById("emailSubject").innerHTML;
	var url = document.getElementById("emailURL").innerHTML;
	
	var errorMSG='';
	if(yourName == ''){
		errorMSG += 'Please enter your name.\n';
	}
	if (yourEmail.indexOf('@') == -1){
		errorMSG += 'Please enter your valid email address\n';
	}
	if(friendsName == ''){
		errorMSG += 'Please enter your friends name.\n';
	}
	if (friendsEmail.indexOf('@') == -1){
		errorMSG += 'Please enter a valid friends email address\n';
	}

	if(errorMSG != ''){
		alert(errorMSG);
		return false;
	}else{
		var emailFriend = ajax("ajax/emailFriend.php", "subject="+subject+"&yourName="+yourName+"&yourEmail="+yourEmail+"&friendsName="+friendsName+"&friendsEmail="+friendsEmail+"&url="+url);
		if( emailFriend != "0" || emailFriend != "" || emailFriend != 0){
			alert("Thank You.\n\r"+friendsName+" will receive an email shortly");
			window.location.reload();
		}else{
			alert("An unexpected error occurred.\n\rPlease try again..");
		}
	}

}

function goToDJ(url){
	window.location.href=''+url+'';
}

function prev(i){
	//for(i=0; i<10; i++){
		$('#prev'+i+'')
		.ready(function(){	
			
			$('#dj_name_wrapper_inner').animate({
			  marginTop: "+=146px"
			}, function(){ 
					
				}
			);
			
		})
	//}
}

function next(i){
	//for(i=0; i<10; i++){
		$('#next'+i+'')
		.ready(function(){	
			
			$('#dj_name_wrapper_inner').animate({
			  marginTop: "-=146px"
			}, function(){ 
					
				}
			);
			
		})
	//}
}

function loadDJInfo(djid){
	
	$('#dj_name_wrapper_inner li')
	.ready(function(){	
		if(document.getElementById("1-djcontent").style.display == "none"){
			/*loadArtist(djid);
			newdjMenu("1", "1");
			$('#dj_info_wrapper_div').animate({ opacity: 1 }, 800);
			$.scrollTo( '#1-djcontent', 2000);*/
			//setTimeout( 'newdjMenu("1","1")' , 2000 );
			
			$('#1-djcontent').stop().fadeOut('medium', function(){
				loadArtist(djid);								   	
				$('#1-djcontent').fadeIn('slow');															   	
				$('#1-djcontent').css('display','block');
				$('#1-djcontent').css('height','');
				$('#dj_info_wrapper_div').stop().fadeTo('slow',1);	
				$.scrollTo( '#1-djcontent', 500);
			});
			
		}else{
			
			//$('#1-djcontent').animate({ height: 0 }, 500);
			
			
					$('#1-djcontent').stop().fadeOut('medium', function(){
						loadArtist(djid);								   	
						$('#1-djcontent').fadeIn('slow');															   	
						$('#1-djcontent').css('display','block');
						$('#1-djcontent').css('height','');
						$('#dj_info_wrapper_div').stop().fadeTo('slow',1);	
						$.scrollTo( '#1-djcontent', 500);
					});
					/*$('#1-djcontent').css('display','block');
					$('#1-djcontent').css('height','');*/
					
					//newdjMenu("1", "0");
					
		}
	})
}

function loadArtist(djid){
	
	document.getElementById("dj_info_wrapper_div").innerHTML = '<img class="loading" src="images/bar-circle.gif"><div class="clearboth"></div>';
	
	var id = ajax("ajax/artists.php", "djid="+djid);
	if( id != "0" && id != "" && id != 0){
		
		document.getElementById("dj_info_wrapper_div").innerHTML = id;
		
		
		//$('#dj_info_wrapper_div').animate({ opacity: 0 }, 500);
		
		
	}else{
		alert("An unexpected error occurred.\n\rPlease try again..");
	}
	
}

function deleteFromBasket(prodID){
	
	var id = ajax("ajax/deleteFromBasket.php", "prodID="+prodID);
	if( id != "0" && id != "" && id != 0){
		
		window.location.reload();
		
	}else{
		alert("An unexpected error occurred. Please try again.");
		window.location.reload();
	}

}

function updateQuantity(prodID){
	
	var selectVal = document.getElementById("checkOutSelect_"+prodID).value;

	
	var id = ajax("ajax/updateBasket.php", "prodID="+prodID+"&quantity="+selectVal);
	if( id != "0" && id != "" && id != 0){
		
		window.location.reload();
		
	}else{
		alert("An unexpected error occurred. Please try again.");
		window.location.reload();
	}

}
