		$(document).ready(function() {
					
			$("a#single_image").fancybox();
						
			$("a#inline").fancybox({
				'hideOnContentClick':	false,
				'overlayOpacity':		0.4,
				'overlayColor':			'#000',
				'easingOut':			300
			});			
			
			$("a.inline").fancybox({
				'hideOnContentClick': false,
				'overlayOpacity':		0.4,
				'overlayColor':			'#000',
				'easingOut':			300
			});
			
			$("a.support").fancybox({
				'overlayOpacity':		0.4,
				'overlayColor':			'#000',
				'zoomSpeedIn':			200,
				'zoomSpeedOut':			200,
				'padding':				'40',
				'imageScale':			true
			});	
			
			$("img#close").bind("click", function(e){
				$(this).parent().hide("fast");
			});
			
			$("input#privat").bind("click", function(e){
				$("#business_info").hide();
			});
			
			$("input#firma").bind("click", function(e){
				$("#business_info").show();
			});

			$("a.group").fancybox({
				'zoomSpeedIn':		10, 
				'zoomSpeedOut':		300, 
				'overlayShow':		false
			});
			
			$('.editable').editable({
				editClass:'small'
				});
				
				
			$("#uploader").fileUpload({
				'uploader': '/uploadify/uploader.swf',
				'cancelImg': '/uploadify/cancel.png',
				'script': '/uploadify/upload.php',
				'queueID' : 'psds',
				'folder': '/uploads',
				'fileDesc': 'PSD, RAR og ZIP',
				'fileExt': '*.psd;*.rar;*.zip',
				'buttonText': 'upload',
				'buttonImg' : '/templates/images/upload.gif',
				'width' : 77,
				'height' : 24,
				'multi': false,
				'auto': true,							
				onComplete : function (evt, queueID, fileObj, response, data){
					$("#psds").html('<div class="successMessage">Din fil er uploadet. Fortsæt venligst med at udfylde detaljerne.</div>');								
					$("#acceptbutton").attr("onclick", "");
					return true;
				}
			});	
				
			tooltip();
			
			$('#menu ul').hide();
			$('#menu ul.selected').show();
			$('#menu > li').bind('mouseover', menu_open);
			//$('#menu > li').bind('mouseout',  menu_timer)
			
			
			$('#questions a').bind('click', slider_open);			
			
			$('ul#filter a').click(function() {
				$(this).css('outline','none');
				$('ul#filter .current').removeClass('current');
				$(this).parent().addClass('current');
				
				var filterVal = $(this).text().toLowerCase().replace(' ','-');
						
				if(filterVal == 'alle') {
					$('ul#portfolio li.hidden').fadeIn('slow').removeClass('hidden');
				} else {
					
					$('ul#portfolio li').each(function() {
						if(!$(this).hasClass(filterVal)) {
							$(this).fadeOut('normal').addClass('hidden');
						} else {
							$(this).fadeIn('slow').removeClass('hidden');
						}
					});
				}
				
				return false;
			});
			
			$("input.payment_radio").change(calculatepayfee);
					
			$("input#paginas").change(bereken);
			$("input#module").change(bereken);
			$("input.checkbox").change(bereken);
			$("input.radio").change(bereken);
					
			calculateform();
			
			
			$("input[name=os]").change(calculateform);	
			$("input[name=type]").change(calculateform);
			$("input[name=all-in-one-type]").change(calculateform);
			$("input[name=linux_os]").change(calculateform);
			$("input[name=controlpanel]").change(calculateform);
			$("input[name=windows_vps_model]").change(calculateform);
			$("input[name=linux_vps_model]").change(calculateform);
			$("div.plugins").find("input").change(calculateform);
			$("select[name=extra-ip]").change(calculateform);
			$("input[name=ekstra_backup_type]").change(calculateform);
			$("input[name=windows_os]").change(calculateform);
			$("input[name=mssql_server]").change(calculateform);
			$("input.sla-input").change(calculateform);
			
			
			
			$("a.next#step1").bind("click", function(e){
				$("div.vpsStep_1").hide();
				$("div.vpsStep_2").show();
			});
			
			$("a.prev#step2").bind("click", function(e){
				$("div.vpsStep_1").show();
				$("div.vpsStep_2").hide();
			});
			
			$("a.next#step2").bind("click", function(e){
				$("div.vpsStep_2").hide();
				$("div.vpsStep_3").show();
			});
			
			$("a.prev#step3").bind("click", function(e){
				$("div.vpsStep_2").show();
				$("div.vpsStep_3").hide();
			});
			
			$("a.next#step3").bind("click", function(e){
				$("div.vpsStep_3").hide();
				$("div.vpsStep_4").show();
				$("div.vpsStep_send").show();
			});
			
			$("a.prev#step4").bind("click", function(e){
				$("div.vpsStep_3").show();
				$("div.vpsStep_4").hide();
				$("div.vpsStep_send").hide();
			});
	
	
			var valMapRam = [0, 128, 256, 512, 768, 1024, 2048, 3072];
			
			$("#slider").slider({
				value:0,
				min: 0,
				max: valMapRam.length - 1,
				step: 1,
				slide: function(event, ui) {
					$("#amount").html('' + valMapRam[ui.value] + ' MB');
					$("#amount-input").val(valMapRam[ui.value]);
					calculateform();
				}
			});
			$("#amount").html('0 MB');
			
			var valMap = [0, 10, 20, 50, 100, 200, 500, 1024];
			
			$("#backup-slider").slider({
				value:0,
				min: 0,
				max: valMap.length - 1,
				step: 1,
				slide: function(event, ui) {
					$("#backup-amount").html('' + valMap[ui.value] + ' GB');
					$("#backup-input").val(valMap[ui.value]);
					calculateform();
				}
			});
			$("#backup-amount").html('0 GB');
			
			
			var valMaphdd = [0, 10, 20, 30, 40, 50, 80, 100, 150, 200, 300, 400, 500, 700, 1000, 1500, 2000];
			
			$("#hdd-slider").slider({
				value:0,
				min: 0,
				max: valMaphdd.length - 1,
				step: 1,
				slide: function(event, ui) {
					$("#hdd-amount").html('' + valMaphdd[ui.value] + ' GB');
					$("#hdd-input").val(valMaphdd[ui.value]);
					calculateform();
				}
			});
			$("#hdd-amount").html('0 GB');
			
			
			var valMaptraffic = [0, 10, 20, 30, 40, 50, 80, 100, 150, 200, 300, 400, 500, 700, 1000, 1500, 2000];
			
			$("#traffic-slider").slider({
				value:0,
				min: 0,
				max: valMaptraffic.length - 1,
				step: 1,
				slide: function(event, ui) {
					$("#traffic-amount").html('' + valMaptraffic[ui.value] + ' GB');
					$("#traffic-input").val(valMaptraffic[ui.value]);
					calculateform();
				}
			});
			$("#traffic-amount").html('0 GB');
			
			var valMapterminal = [0, 1, 2, 3, 4, 5, 7, 10, 15, 20];
			
			$("#terminal-slider").slider({
				value:0,
				min: 0,
				max: valMapterminal.length - 1,
				step: 1,
				slide: function(event, ui) {
					$("#terminal-amount").html('' + valMapterminal[ui.value] + ' stk');
					$("#terminal-input").val(valMapterminal[ui.value]);
					calculateform();
				}
			});
			$("#terminal-amount").html('0 stk');	
			
			
			// dropdown menu, select list styling
			
            createDropDown();
            
            $(".dropdown dt a").click(function() {
                $(".dropdown dd ul").toggle();
            });

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown"))
                    $(".dropdown dd ul").hide();
            });
                        
            $(".dropdown dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown dt a").html(text);
                $(".dropdown dd ul").hide();
                
                var source = $("#source");
                source.val($(this).find("span.value").html())
				
				var totalwebhotelprice = source.val()*webh_price;
				var totalwebhotelprice_other = (12-source.val())*webh_price;
				
                $("#webhotelprice").html(to2DecWithComma(totalwebhotelprice));
				webh_order_total = webh_order_total_f-(totalwebhotelprice_other*1.25);
				webh_order_vat = webh_order_total*0.2;
				
				var creditcardfee = webh_order_total*0.015;
				creditcard_fee = creditcardfee*1.25;
				
                $("#creditcard_fee").html(to2DecWithComma(creditcard_fee*0.8));
                $("#creditcard_fee_vat").html(to2DecWithComma(creditcard_fee));
				
				calculatepayfee();
				
            });

				
		});
