// JavaScript Document

function webEstimator(){

/*--------------------------------------------------*/
/*----------DON'T EDIT HERE--------------------*/
/*--------------------------------------------------*/
//all i had to do was hide the days values and change the default days to 10. 
$('.days').hide();
//total
var $total = $("#W_E-total");


//sliders
var $daySlider = $("#W_E-daysSlider");
var $datepicker = $('#W_E-datepicker');
var $days = $("#W_E-days");
var $slideCalc = $('#W_E-sliderCalc');
var $pageSlider = $("#W_E-pagesSlider");
var $pages = $("#W_E-pages");
var $minusDays = $("#W_E-minusDays");
var $amount = $("#W_E-amount");
var $pages2 = $("#W_E-pages2");
var $plusDays = $("#W_E-plusDays");
var $minusPages = $("#W_E-minusPages");
var $plusPages = $("#W_E-plusPages");

//CMS
var $CMSAmount = $("#W_E-CMS_AMOUNT");

//design
var $designPrice = $("#W_E-designPrice");
var $designPrice2 = $("#W_E-designPrice2");
var $deisgnYes = $("#W_E-designYes");
var $designHidden = $('#W_E-designHidden');
var $designOptions =  $("#W_E-siteOptions");
var $designNo = $("#W_E-designNo");

//widgets
var $widgetsPrice = $("#W_E-widgets");

//dates
var baseDate = new Date();
var newDate = new Date();
var days = parseInt($days.val());


/*--------------------------------------------------*/
/*----------BEGIN EDITING HERE----------------------*/
/*--------------------------------------------------*/

//Change the currency symbol
var currency = '$';

//PAYPAL variables....please adjust these variables in order to use paypal:

	//NEED YOUR EMAIL HERE
	var yourPayPalEmail = "baskets@halifaxbaskets.ca";
	//NAME YOUR ITEM HERE
	var itemName = "ITEM NAME";
	//CURRENCY
	var currencyCode = "USD";
	//TITLE OF BUTTON
	var payPalButtonName = "Proceed to PayPal"
	
	//HIDE TOP MESSAGE UNTIL SUCCESS REALLY ONLY NEEDED FOR PAYPAL
	$('#W_E_TopMessage').hide();
	
	$('#paypalBusiness').val(yourPayPalEmail);
	$('#itemName').val(itemName);
	$('#currencyCode').val(currencyCode);
	$('#paymentPayPal').html(payPalButtonName);

/*use these variables to configure your estimator. Please read through the documentation. I have commented the code to help you understand the flow. Variables are named to help you understand their purpose.*/

//Phone Number. There are some alerts that say please call for a bulk estimate if the user requests more that 16 pages. And/or if the user wants to have the user would like the project faster than one day. You can of course change these variables in the code. 
var phoneNumber = "902-719-3171";


var designPrice = 250;  //determines the amount that you will charge to come up with the design. 

//This is the amount that you would charge per page of development. IMPORTANT: THEN multiply that by 10!!!!! 
var pageAmount = 1000; //I used $100 for this demo.

//If the user chooses to use a CMS this is how much you charge to configure and instll that. 
var cmsNone = 0; //do not adjust this amount. 
var cms1Amount = 300;
var cms2Amount = 200;
var cms3Amount = 300;
var cms4Amount = 150;


//Widgets ---the widgets section includes a lot of common widgets. You can add to this please see me video on how. 
var imgGalleryPrice = 50;
var slideShowPrice = 50;
var lightBoxPrice = 50;
var shareThisPrice = 50;
var carouselPrice = 50;
var accordionPrice = 50;
var customFormsPrice = 50;
var flyOutMenuPrice = 50;


//Uncomment if you would like to hide the extras section
//$('#W_E-extrasSection').hide();

//Create mobile site---this could also be used to be used for responsive design.
var mobileSitetxt = 'Mobile Site (cost $350)';
var mobileSiteAmount = 350;


//Extras
var extra1Amount = 350;
var extra2Amount = 600;
var extra3Amount = 400;
$('#W_E-extra4, #W_E-extra4txt, #W_E-extra5, #W_E-extra5txt, #W_E-extra6, #W_E-extra6txt, #W_E-extra7, #W_E-extra7txt, #W_E-extra8, #W_E-extra8txt, #W_E-extra9, #W_E-extra9txt, #W_E-extra10, #W_E-extra10txt').hide();
//var extra4Amount=1200;
//var extra5Amount=1200;
//var extra6Amount=1200;
//var extra7Amount=1200;
//var extra8Amount=1200;
//var extra9Amount=1200;
//var extra10Amount=1200;

//Text for extras

//!IMPORTANT ---you must uncomment the code that matches starting on line: 705 of this page

var extra1txt = 'Search Engine Optimization - (cost $350)';
var extra2txt = 'Facebook Mini-Site - (cost $600)';
var extra3txt = 'Email Newsletter Template - (cost $400)';
//var extra4txt='stuff';
//var extra5txt='stuff';
//var extra6txt='stuff';
//var extra7txt='stuff';
//var extra8txt='stuff';
//var extra9txt='stuff';
//var extra10txt='stuff';

//This variable is slightly hard to describe but here it goes. The program is setup to reduce/increase the per page amount based on the amount of days selected. This obviously will make it so that if less days are selected they higher the per page cost. The more pages selected the less each page will cost. This could be an issue if someone wants to get a VERY cheap site and moves the day indicator to the most (15 days). This variable makes it possible to stop reducing the per page price after a set amount of days. So if you want to give NO reduction based on days...change this to 1. This will then disable this feature. If you do change it to 1 then you must also change your per page price to be a standard price. In the default example you would change $1000 to $100. IMPORTANT: if you do set this to 1 then most clients will see that the day indicator does not change the price and will probably request all sites done in 1 day.  
var maxDaysToReduceAmount = 11;  //DO NOT CHANGE THIS TO 0----that will cause the program to error out. 

//Change all currency markers. 
$(".currency").text(currency);


//PAYMENT AREA

//Hide payment button until form is submitted. 
$('.payment').hide(); //--DO NOT EDIT

//WHILE form is being submitted loader
$('.W_E_loader').hide();
	
	 //INITITIAL VALUES	
		$CMSAmount.val(0);
		$designOptions.val(0);
		$widgetsPrice.val(0);
        $amount.val(pageAmount / 10);
		$total.val($amount.val());
        $pages.val(1);
        $pages2.val(1);
        $days.val(10);
		
		var date = new Date(baseDate.getTime()); // Calculate the new date
		date.setDate(date.getDate() + $days.val());
		$datepicker.datepicker('setDate', date); // And set into the datepicker
        $datepicker.datepicker({
                buttonImageOnly: true
        });

/*--------------------------------------------------*/
/*-------------------SLIDERS --------------------*/
/*-------------------------------------------------*/
       
        $daySlider.slider({
                animate: true,
                value: 10,
                min: 1,
                max: 16,
                step: 1,
                slide: function (event, ui) {
                        var date = new Date(baseDate.getTime()); // Calculate the new date
                        date.setDate(date.getDate() + ui.value);
                        $datepicker.datepicker('setDate', date); // And set into the datepicker	
                        $days.val(ui.value);
                        $slideCalc.click();
                }
        });
        $pageSlider.slider({
                animate: true,
                value: 0,
                min: 1,
                max: 16,
                step: 1,
                slide: function (event, ui) {
                        $pages.val(ui.value);
                        $slideCalc.click();
                }
        });
        $minusDays.click(function () {
                if ($days.val() == 1) {
					alert('Please call for a speed estimate: ' + phoneNumber);
                        return false;
                } else {
                        var s = $daySlider,
                                val = s.slider("value"),
                                step = s.slider("option", "step");
                        s.slider("value", val - step);
						var date = new Date(baseDate.getTime()); // Calculate the new date
                        date.setDate(date.getDate() + val - step);
                        $datepicker.datepicker('setDate', date); // And set into the datepicker
						
                        $days.val(("value", val - step));
                        $amount.val([($pages.val()) * pageAmount] / [("value", val - step)]);
                        $slideCalc.click();
                }
        });
        $plusDays.click(function () {
			if ($days.val() == 16) {
                        return false;
                } else {
                var s = $daySlider,
                        val = s.slider("value"),
                        step = s.slider("option", "step");
                s.slider("value", val + step);
				var date = new Date(baseDate.getTime()); // Calculate the new date
				date.setDate(date.getDate() + val  + step);
				$datepicker.datepicker('setDate', date); // And set into the datepicker
				

                $days.val(("value", val + step));
                $amount.val([($pages.val()) * pageAmount] / [("value", val + step)]);
                $slideCalc.click();
				}
        });
        $minusPages.click(function () {
                //Create logic to ignore click if #W_E-pages=0
                if ($pages.val() == 1) {
                        return false;
                } else {
                        var s = $pageSlider,
                                val = s.slider("value"),
                                step = s.slider("option", "step");
                        s.slider("value", val - step);
                        $pages.val(("value", val - step));
                        $amount.val([
                                [("value", val - step) * pageAmount] / [$daySlider.slider("value")]
                        ]);
                        $slideCalc.click();
                }
        });
        $plusPages.click(function () {
			 if ($pages.val() == 16) {
				 alert('Please call for a larger estimate: ' + phoneNumber);
                        return false;
                } else {
                var s = $pageSlider,
                        val = s.slider("value"),
                        step = s.slider("option", "step");
                s.slider("value", val + step);
                $pages.val(("value", val + step));
                $amount.val([("value", val + step) * pageAmount] / [$daySlider.slider("value")]);
                $slideCalc.click();
				}
        });
		
		$slideCalc.click(function () {
				$pages2 .val(parseInt($pages.val()));
                if ($days.val() >= maxDaysToReduceAmount) {
                        $amount.val([($pages.val()) * pageAmount] / [maxDaysToReduceAmount]);
                        var total = parseInt($amount.val());
                        $amount.val(total);
                } else {
                        $amount.val([($pages.val()) * pageAmount] / [$days.val()]);
                        var total = parseInt($amount.val());
                        $amount.val(total);
                }
				
        });
		
	
        //Design
        $designPrice.val("(" + currency + designPrice + ")");
        $designPrice2.val(currency + 0);
        $deisgnYes.click(function () {
                $designHidden.animate({
                        'height': '380px'
                }, 1000);
                $designPrice2.val(currency + designPrice);
                var total = parseInt($designOptions.val());
                $designOptions.val(total + designPrice);
                $deisgnYes.attr('disabled', 'disabled');
                $("#W_E-designPrice2, #W_E-designPrice, #W_E-designAdded").addClass('W_E-added');
                $designNo.removeAttr('disabled');
				$("#designHidden").val('Yes');
        });
        $designNo.click(function () {
                $designHidden.animate({
                        'height': '0px'
                }, 1000);
                $designPrice2.val(currency + 0);
                var total = parseInt($designOptions.val());
                $designOptions.val(total - designPrice);
                $("#W_E-designPrice2, #W_E-designPrice, #W_E-designAdded").removeClass('W_E-added');
                $deisgnYes.removeAttr('disabled');
                $designNo.attr('disabled', 'disabled');
				$("#designHidden").val('No');
        });
		
		
/*-------------------------------------------------------*/
/*----------CMS AREA OF FORM---------------------*/
/*------------------------------------------------------*/
		
        $("#W_E-cmsNone").click(function () {
				$CMSAmount.val(cmsNone);
               
        });
        $("#W_E-cms1").click(function () {
				$CMSAmount.val(cms1Amount);
             
        });
		
        $("#W_E-cms2").click(function () {
                $CMSAmount.val(cms2Amount);
               
        });
        $("#W_E-cms3").click(function () {
                $CMSAmount.val(cms3Amount);
                
        });
        $("#W_E-cms4").click(function () {
                $CMSAmount.val(cms4Amount);
                
        });
		
		
/*------------------------------------------------------------*/
/*----------Extras AREA OF FORM-------------------------*/
/*-----------------------------------------------------------*/
		
var $W_E_mobile = $("#W_E-mobile");

        $W_E_mobile.click(function () {
                if ($W_E_mobile.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra1Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra1Amount]));
                }
        });

var $W_E_extra1 = $("#W_E-extra1");

        $W_E_extra1.click(function () {
                if ($W_E_extra1.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra1Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra1Amount]));
                }
        });
		
var $W_E_extra2 = $("#W_E-extra2");
        $W_E_extra2.click(function () {
                if ($W_E_extra2.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra2Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra2Amount]));
                }
        });
var $W_E_extra3 = $("#W_E-extra3");
        $W_E_extra3.click(function () {
                if ($W_E_extra3.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra3Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra3Amount]));
                }
        });
var $W_E_extra4 = $("#W_E-extra4");		
		$W_E_extra4.click(function () {
                if ($W_E_extra4.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra4Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra4Amount]));
                }
        });
var $W_E_extra5 = $("#W_E-extra5");			
		$W_E_extra5.click(function () {
                if ($W_E_extra5.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra5Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra5Amount]));
                }
        });
var $W_E_extra6 = $("#W_E-extra6");			
		$W_E_extra6.click(function () {
                if ($W_E_extra6.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra6Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra6Amount]));
                }
        });
var $W_E_extra7 = $("#W_E-extra7");			
		$W_E_extra7.click(function () {
                if ($W_E_extra7.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra7Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra7Amount]));
                }
        });
var $W_E_extra8 = $("#W_E-extra8");			
		$W_E_extra8.click(function () {
                if ($W_E_extra8.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra8Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra8Amount]));
                }
        });
var $W_E_extra9 = $("#W_E-extra9");			
		$W_E_extra9.click(function () {
                if ($W_E_extra9.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra9Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra9Amount]));
                }
        });
var $W_E_extra10 = $("#W_E-extra10");	
		$W_E_extra10.click(function () {
                if ($W_E_extra10.is(':checked')) {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total + extra10Amount]));
                } else {
                        var total = parseInt($designOptions.val());
                        $designOptions.val(Math.round([total - extra10Amount]));
                }
        });
		
		
/*--------------------------------------------------*/
/*-------------------WIDGETS--------------------*/
/*-------------------------------------------------*/
        //IMAGE GALLERY
var $W_E_imgGalleryPrice = $("#W_E-imgGalleryPrice");
var $W_E_imgGalleryPrice2 =  $("#W_E-imgGalleryPrice2");
var $W_E_imgGalleryYes =  $("#W_E-imgGalleryYes");
var $W_E_imgGalleryNo =  $("#W_E-imgGalleryNo");

        $W_E_imgGalleryPrice.val("(" + currency + imgGalleryPrice + ")");
        $W_E_imgGalleryPrice2.val(currency + 0);
        $W_E_imgGalleryYes.click(function () {
                $W_E_imgGalleryPrice2.val(currency + imgGalleryPrice);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total + imgGalleryPrice);
                $W_E_imgGalleryYes.attr('disabled', 'disabled');
                $("#W_E-imgGalleryPrice2, #W_E-imgGalleryPrice, #W_E-imgGalleryAdded").addClass('W_E-added');
                $W_E_imgGalleryNo.removeAttr('disabled');
				$("#imgGalleryHidden").val('Yes');
        });
        $W_E_imgGalleryNo.click(function () {
                $W_E_imgGalleryPrice2.val(currency + 0);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total - imgGalleryPrice);
                $("#W_E-imgGalleryPrice2, #W_E-imgGalleryPrice, #W_E-imgGalleryAdded").removeClass('W_E-added');
                $W_E_imgGalleryYes.removeAttr('disabled');
                $W_E_imgGalleryNo.attr('disabled', 'disabled');
				$("#imgGalleryHidden").val('No');
        });
		
		
        //SLIDESHOW
var $W_E_slideShowPrice =  $("#W_E-slideShowPrice");
var $W_E_slideShowPrice2 =  $("#W_E-slideShowPrice2");
var $W_E_slideShowYes =  $("#W_E-slideShowYes");
var $W_E_slideShowNo =  $("#W_E-slideShowNo");

        $W_E_slideShowPrice.val("(" + currency + slideShowPrice + ")");
        $W_E_slideShowPrice2.val(currency + 0);
        $W_E_slideShowYes.click(function () {
                $W_E_slideShowPrice2.val(currency + slideShowPrice);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total + slideShowPrice);
                $("#W_E-slideShowPrice2, #W_E-slideShowPrice, #W_E-slideShowAdded").addClass('W_E-added');
                $W_E_slideShowYes.attr('disabled', 'disabled');
                $W_E_slideShowNo.removeAttr('disabled');
				$("#slideShowHidden").val('Yes');
        });
        $W_E_slideShowNo.click(function () {
                $W_E_slideShowPrice2.val(currency + 0);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total - slideShowPrice);
                $("#W_E-slideShowPrice2, #W_E-slideShowPrice, #W_E-slideShowAdded").removeClass('W_E-added');
                $W_E_slideShowYes.removeAttr('disabled');
                $W_E_slideShowNo.attr('disabled', 'disabled');
				$("#slideShowHidden").val('No');
        });
		
		
        //LIGHTBOX
var $W_E_lightBoxPrice =  $("#W_E-lightBoxPrice");
var $W_E_lightBoxPrice2 = $("#W_E-lightBoxPrice2");
var $W_E_lightBoxYes =  $("#W_E-lightBoxYes");
var $W_E_lightBoxNo =  $("#W_E-lightBoxNo");		

		
        $W_E_lightBoxPrice.val("(" + currency + lightBoxPrice + ")");
        $W_E_lightBoxPrice2.val(currency + 0);
        $W_E_lightBoxYes.click(function () {
                $W_E_lightBoxPrice2.val(currency + lightBoxPrice);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total + lightBoxPrice);
                $("#W_E-lightBoxPrice2, #W_E-lightBoxPrice, #W_E-lightBoxAdded").addClass('W_E-added');
                $W_E_lightBoxYes.attr('disabled', 'disabled');
                $W_E_lightBoxNo.removeAttr('disabled');
				$("#lightboxHidden").val('Yes');
        });
        $W_E_lightBoxNo.click(function () {
                $W_E_lightBoxPrice2.val(currency + 0);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total - lightBoxPrice);
                $("#W_E-lightBoxPrice2, #W_E-lightBoxPrice, #W_E-lightBoxAdded").removeClass('W_E-added');
                $W_E_lightBoxYes.removeAttr('disabled');
                $W_E_lightBoxNo.attr('disabled', 'disabled');
				$("#lightboxHidden").val('No');
        });
		
		
        //SHARETHIS
		
var $W_E_shareThisPrice =  $("#W_E-shareThisPrice");
var $W_E_shareThisPrice2 = $("#W_E-shareThisPrice2");
var $W_E_shareThisYes =  $("#W_E-shareThisYes");
var $W_E_shareThisNo =  $("#W_E-shareThisNo");	
		
        $W_E_shareThisPrice.val("(" + currency + shareThisPrice + ")");
        $W_E_shareThisPrice2.val(currency + 0);
        $W_E_shareThisYes.click(function () {
                $W_E_shareThisPrice2.val(currency + shareThisPrice);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total + shareThisPrice);
                $("#W_E-shareThisPrice2, #W_E-shareThisPrice, #W_E-shareThisAdded").addClass('W_E-added');
                $W_E_shareThisYes.attr('disabled', 'disabled');
                $W_E_shareThisNo.removeAttr('disabled');
				$("#shareThisHidden").val('Yes');
        });
        $W_E_shareThisNo.click(function () {
                $W_E_shareThisPrice2.val(currency + 0);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total - shareThisPrice);
                $("#W_E-shareThisPrice2, #W_E-shareThisPrice, #W_E-shareThisAdded").removeClass('W_E-added');
                $W_E_shareThisYes.removeAttr('disabled');
                $W_E_shareThisNo.attr('disabled', 'disabled');
				$("#shareThisHidden").val('No');
        });
		
		 //Carousel
		 
var $W_E_carouselPrice =  $("#W_E-carouselPrice");
var $W_E_carouselPrice2 = $("#W_E-carouselPrice2");
var $W_E_carouselYes =  $("#W_E-carouselYes");
var $W_E_carouselNo =  $("#W_E-carouselNo");
		 
        $W_E_carouselPrice.val("(" + currency + carouselPrice + ")");
        $W_E_carouselPrice2.val(currency + 0);
        $W_E_carouselYes.click(function () {
                $W_E_carouselPrice2.val(currency + carouselPrice);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total + carouselPrice);
                $("#W_E-carouselPrice2, #W_E-carouselPrice, #W_E-carouselAdded").addClass('W_E-added');
                $W_E_carouselYes.attr('disabled', 'disabled');
                $W_E_carouselNo.removeAttr('disabled');
				$("#carouselHidden").val('Yes');
        });
        $W_E_carouselNo.click(function () {
                $W_E_carouselPrice2.val(currency + 0);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total - carouselPrice);
                $("#W_E-carouselPrice2, #W_E-carouselPrice, #W_E-carouselAdded").removeClass('W_E-added');
                $W_E_carouselYes.removeAttr('disabled');
                $W_E_carouselNo.attr('disabled', 'disabled');
				$("#carouselHidden").val('No');
        });
		
		 //Accordion
		 
var $W_E_accordionPrice =  $("#W_E-accordionPrice");
var $W_E_accordionPrice2 = $("#W_E-accordionPrice2");
var $W_E_accordionYes =  $("#W_E-accordionYes");
var $W_E_accordionNo =  $("#W_E-accordionNo");
		 
        $W_E_accordionPrice.val("(" + currency + accordionPrice + ")");
        $W_E_accordionPrice2.val(currency + 0);
        $W_E_accordionYes.click(function () {
                $W_E_accordionPrice2.val(currency + accordionPrice);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total + accordionPrice);
                $("#W_E-accordionPrice2, #W_E-accordionPrice, #W_E-accordionAdded").addClass('W_E-added');
                $W_E_accordionYes.attr('disabled', 'disabled');
                $W_E_accordionNo.removeAttr('disabled');
				$("#accordionHidden").val('Yes');
        });
        $("#W_E-accordionNo").click(function () {
                $W_E_accordionPrice2.val(currency + 0);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total - accordionPrice);
                $("#W_E-accordionPrice2, #W_E-accordionPrice, #W_E-accordionAdded").removeClass('W_E-added');
                $W_E_accordionYes.removeAttr('disabled');
                $W_E_accordionNo.attr('disabled', 'disabled');
				$("#accordionHidden").val('No');
        });
		
		 //Custom Forms
		 
var $W_E_customFormsPrice =  $("#W_E-customFormsPrice");
var $W_E_customFormsPrice2 = $("#W_E-customFormsPrice2");
var $W_E_customFormsYes =  $("#W_E-customFormsYes");
var $W_E_customFormsNo =  $("#W_E-customFormsNo");
		 
        $W_E_customFormsPrice.val("(" + currency + customFormsPrice + ")");
        $W_E_customFormsPrice2.val(currency + 0);
        $W_E_customFormsYes.click(function () {
                $W_E_customFormsPrice2.val(currency + customFormsPrice);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total + customFormsPrice);
                $("#W_E-customFormsPrice2, #W_E-customFormsPrice, #W_E-customFormsAdded").addClass('W_E-added');
                $W_E_customFormsYes.attr('disabled', 'disabled');
                $W_E_customFormsNo.removeAttr('disabled');
				$("#customFormsHidden").val('Yes');
        });
        $W_E_customFormsNo.click(function () {
                $W_E_customFormsPrice2.val(currency + 0);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total - customFormsPrice);
                $("#W_E-customFormsPrice2, #W_E-customFormsPrice, #W_E-customFormsAdded").removeClass('W_E-added');
                $W_E_customFormsYes.removeAttr('disabled');
                $W_E_customFormsNo.attr('disabled', 'disabled');
				$("#customFormsHidden").val('No');
        });
		
		 //Flyout Menu
var $W_E_flyOutMenuPrice =  $("#W_E-flyOutMenuPrice");
var $W_E_flyOutMenuPrice2 = $("#W_E-flyOutMenuPrice2");
var $W_E_flyOutMenuYes =  $("#W_E-flyOutMenuYes");
var $W_E_flyOutMenuNo =  $("#W_E-flyOutMenuNo");
		 
        $W_E_flyOutMenuPrice.val("(" + currency + flyOutMenuPrice + ")");
        $W_E_flyOutMenuPrice2.val(currency + 0);
        $W_E_flyOutMenuYes.click(function () {
                $W_E_flyOutMenuPrice2.val(currency + flyOutMenuPrice);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total + flyOutMenuPrice);
                $("#W_E-flyOutMenuPrice2, #W_E-flyOutMenuPrice, #W_E-flyOutMenuAdded").addClass('W_E-added');
                $W_E_flyOutMenuYes.attr('disabled', 'disabled');
                $W_E_flyOutMenuNo.removeAttr('disabled');
				$("#flyoutMenuHidden").val('Yes');
        });
        $W_E_flyOutMenuNo.click(function () {
                $W_E_flyOutMenuPrice2.val(currency + 0);
                var total = parseInt($widgetsPrice.val());
                $widgetsPrice.val(total - flyOutMenuPrice);
                $("#W_E-flyOutMenuPrice2, #W_E-flyOutMenuPrice, #W_E-flyOutMenuAdded").removeClass('W_E-added');
                $W_E_flyOutMenuYes.removeAttr('disabled');
                $W_E_flyOutMenuNo.attr('disabled', 'disabled');
				$("#flyoutMenuHidden").val('No');
        });
		

		$(document).bind('click', function(){
			
		var amountForTotal = parseInt($amount.val());
		var cmsForTotal = parseInt($('#W_E-CMS_AMOUNT').val());
		var siteOptionsForTotal = parseInt($('#W_E-siteOptions').val());
		var widgetsForTotal = parseInt($('#W_E-widgets').val());
		
		$total.val(amountForTotal + cmsForTotal + siteOptionsForTotal + widgetsForTotal);
		$('#payPalAmount').val(amountForTotal + cmsForTotal + siteOptionsForTotal + widgetsForTotal);
			
			});
		
		
        //-------------------------------------
        //---------ACCORDION--------------
        //-------------------------------------
        $("#W_E-accordion").accordion({
                autoHeight: false,
                collapsible: true
        });
      
		$('#W_E-mobileSitetxt').html(mobileSitetxt + '<br />');
		$('#W_E-extra1txt').html(extra1txt + '<br />');
		$('#W_E-extra2txt').html(extra2txt + '<br />');
		$('#W_E-extra3txt').html(extra3txt + '<br />');
		//$('#W_E-extra4txt').html(extra4txt + '<br />');
		//$('#W_E-extra5txt').html(extra5txt + '<br />');
		//$('#W_E-extra6txt').html(extra6txt + '<br />');
		//$('#W_E-extra7txt').html(extra7txt + '<br />');
		//$('#W_E-extra8txt').html(extra8txt + '<br />');
		//$('#W_E-extra8txt').html(extra9txt + '<br />');
		//$('#W_E-extra10txt').html(extra10txt + '<br />');
}
