$(document).ready(function() {
						   
						   
	// signup form left nav
	$("#signup_submit").click(function() {

		$.ajax({
		   type: "GET",
		   url: sitedir + "process/signup.php",
		   data: "signup_email="+$("input#signup_email").val(),
		   success: function(msg){
			   
				if(jQuery.trim(msg) == "Thanks for signing-up"){
					
					  $("#signup_email").animate({ 
						backgroundColor: "#fff58b"
					  }, 1500 );
					
				}else{
					
					  $("#signup_email").animate({ 
						backgroundColor: "#FFB2B2"
					  }, 1500 );
				  
				}
			   
			   
				$("input#signup_email").val(jQuery.trim(msg));
				
		   }
		 });

	});
	
	
	// checkout accordian
	$('#complete_container h3').click(function() {
		$('#complete_container .divacc').not($(this).next()).slideUp();				 
		$(this).next().slideToggle();
		
		//$(this).css('','');
		$('#complete_container h3').not(this).toggleClass('faq_on',false);
		$(this).toggleClass('faq_on');
		
		return false;
	}).next().hide();
	
	// fasttrack
	$('.fasttrack').click(function(){
	
		var dialog_id = 'fasttrack_dialog';
		
		GenericDialog(dialog_id, "<i>Fast Track Service</i>", 400, 220);
		
		fasttrack_txt = "<img src=\""+sitedir+"themes/theme1/images/fasttrack_mo.png\" style=\"float:left;\"/>";
		fasttrack_txt += "<p style=\"margin-left:110px\">FastTrack is currently available on this product. Your order would be eligible for a 3 working day turnaround if all items in your basket are eligible for the service.</p>";
		fasttrack_txt += "<p style=\"margin-left:110px\">The service is available to select on the checkout page and will add an express service charge onto your total.</p>";
		
		$('#'+dialog_id).html(fasttrack_txt);
		
		
		return false;
	
	});

});

/* Makes Columns Equal Heights */
function equalHeights(cssClass)
{	var tallestCol = 0;
	
	$('.'+cssClass).each(function(i) {
		if($(this).height() > tallestCol)
		{	tallestCol = $(this).height();
		}
	});
	
	$('.columns').height(tallestCol);
	$('.columns36').height(tallestCol+18);
}

function GenericDialog(str1, title, w, h){

	var dialog = '';
	dialog = dialog + '<div class="gen_dialog" id="'+str1+'">';
	dialog = dialog + '<div class="gen_dialog_inner" id="'+str1+'_inner">';
	dialog = dialog + '</div>';
	dialog = dialog + '</div>';
	
	$('body').append(dialog);
	
	$('#'+str1).dialog({
		modal: true,				
		autoOpen: false,
		dialogClass: "gen_dialog",
		width: w,
		height :h,
		draggable:false,
		resizable:false,
		title:title,
		close: function(event, ui){
			$('.gen_dialog').remove();
		},
		closeOnEscape: true,
			buttons: {
				'Close': function() {
					$( this ).dialog( "close" );
				}
			}
	});
		
	$('#'+str1).dialog('open');

}

