jQuery(document).ready(function($){
	//cufon fonts
	Cufon.replace('#header-top-links a', { fontFamily: 'Gotham Book' });
	Cufon.replace('.gotham-book', { fontFamily: 'Gotham Book' });
	Cufon.replace('.gotham-black', { fontFamily: 'Gotham Black' });
	Cufon.replace('.gotham-medium', { fontFamily: 'Gotham Medium' });
	Cufon.replace('#header-top-links ul li.first a', { fontFamily: 'Gotham Medium' });
	Cufon.replace('#nav a', { fontFamily: 'Gotham Book', hover:true });
	Cufon.replace('.side-nav a', { fontFamily: 'Gotham Book', hover:true });
	Cufon.replace('#quicklinks h6', { fontFamily: 'Gotham Black'});
	Cufon.replace('#quicklinks a', { fontFamily: 'Gotham Book', hover:true });
	Cufon.replace('#footer', { fontFamily: 'Gotham Book' });
	
	
	//clears textbox on focus. but returns the initial value if it loses focus, only when textbox is blank
	$('input[name=s]').focus(function(){
		if(!$(this).data('cleared')){
			$(this).data('value', 'Search');
			$(this).data('cleared', true).val('');
		}
	}).blur(function(){
		if($.trim($(this).val())==''){//treat spaces only as blanks too
			$(this).data('cleared', false).val($(this).data('value'));
		}
	});
	
	//map velocity 
	$('.neighborhood-map li').eq(0).show();
	$('.neighborhood-links li').click(function(){
		var index = $(this).index();
		$('.neighborhood-map li').hide();
		$('.neighborhood-map li').eq(index+1).show();
		return false;
	})
	//list are floated right. so they appear in reverse. we fix it with jquery by reversing the order of list.
	$('.sub-menu').each(function(a){
		var subs = new Array();
		var subnav = $(this);
		var list;
		if(subnav.children('li').eq(0).css('float')=='right'){//apply only to floated right elements
			subnav.children('li').each(function(b){
				list = $(this);
				
				subs.push(list.detach());
				
			});
			subs.reverse();
			for(x=0; x< subs.length; x++){
				subnav.append(subs[x]);
			}
	
		}
	});
	
	if($('.page-about-us').length > 0){
		$('#header-top-links ul li .sub-menu').detach().appendTo('#menu-main-menu li.first').show();
	}
	
	//simple slide show
	var timer = null;
	
	var photos = $(".slideshow li");
	var slideNav = $('#slideshow-nav');
	var counter = 0;
	var currentPhoto = null;
	var nextPhoto = null;
	var total = photos.length;//number of li elements
	var dontMove = false;
	var idleTime = 0;
	var opts = {
		speed:5000, //speed in milliseconds
		animationSpeed: 500,//speed of slide animation in milliseconds
		autoNextAfter: 8 //after x seconds of user not clicking slide buttons, resume auto slideshow. units in seconds
	};
	
	photos.css({opacity: 0.0});
	photos.hide();
	photos.eq(0).show();
	photos.eq(0).css({opacity: 1.0});
	
	function next(){
		n = counter;
		n++;
		if(n>total-1){
			n=0;
		}	

		move(n);
	}
	
	function move(n){
		if(n!=counter){
			currentPhoto = photos.eq(counter);
			counter = n;
			slideNav.find('li a').attr('class','');
			slideNav.find('li').eq(n).find('a').attr('class','active');
			//hide & show
			currentPhoto.animate({opacity: 0.0}, opts.animationSpeed, function () {
				//Hide the content
				currentPhoto.hide();
			});	
			nextPhoto = photos.eq(n);
			nextPhoto.show();
			nextPhoto.animate({opacity: 1.0}, opts.animationSpeed);	
		}
	}
	function autoNext(){
		if(!dontMove){
			next();	
		}
	}
	timer = setInterval(autoNext, opts.speed);
	
	//get idle time with slideshow
	function monitor(){
		idleTime++;
		if(idleTime>=opts.autoNextAfter){
			if(dontMove==true){
				dontMove=false;
			}
		}
	}				
	idle = setInterval(monitor, 1000);
	
	//stop slideshow when hovering over images
	photos.mouseenter(function(){
		dontMove = true;
		idleTime = -9999;
	}).mouseleave(function(){
		dontMove = false;
		idleTime = opts.autoNextAfter;
	});
	
	//navi clicks
	slideNav.find('a').click(function(){
		move(parseInt($(this).parent().index()) );
		
		dontMove = true;
		idleTime = 0;
		return false;
	});
	
	//end slide show code
	
	//telephone page location select dropdown
	$('#telephone-location').change(function(){
		if($(this).val()=='1'){
			window.location = '/moncks-cornerharleyville';
		} else if($(this).val()=='2'){
			window.location = '/charleston';
		} else if($(this).val()=='3'){
			window.location = '/bonneaust-stephennew-hope';
		}
	});
	
	//terms pop up
	$('a.bb_popup_link').click(function(){
		$('div.bb_popup div.bb_content').html($(this).next('.bb_popup_content').html());
		$('div.bb_popup').css("top", ($(this).offset().top + $(this).height()) + "px").show();
		return false;
	});
	//close popup on bundle builder and bundle start
	$('a.bb_close').click(function(){
		$('div.bb_popup').hide();		
		return false;
	});

	/*Landing pages security*/
	
	$('#btn-security-landing').click(function(){
		var errors = new Array();
		
		if($.trim($('input[name=Name]').val())==''){
			errors.push('Name should not be blank');
		}
		if($.trim($('input[name=Street Address]').val())==''){
			errors.push('Address should not be blank');
		}
		
		if($.trim($('input[name=Phone]').val())==''){
			errors.push('Phone should not be blank');
		}
		if($.trim($('input[name=Email]').val())==''){
			errors.push('Email should not be blank');
		} else {
			if(!isValidEmail($.trim($('input[name=Email]').val()))){
				errors.push('Email is invalid');
			}
		}

		var obj1 =$("input[name=Monitoring]");
		if(!obj1.is(":checked")){
			errors.push('Please select your monitoring');
		}

		var obj2 =$("input[name=Equipment]");
		if(!obj2.is(":checked")){
			errors.push('Please select your Equipment');
		}


		if(errors.length>0){
			alert(errors.join("\n"));
			return false;
		}

		return true;

	});


		/*Landing pages security*/
	
	$('#btn-cable-landing').click(function(){
		var errors = new Array();
		
		if($.trim($('input[name=Name]').val())==''){
			errors.push('Name should not be blank');
		}
		if($.trim($('input[name=Street Address]').val())==''){
			errors.push('Address should not be blank');
		}
		
		if($.trim($('input[name=Phone]').val())==''){
			errors.push('Phone should not be blank');
		}
		if($.trim($('input[name=Email]').val())==''){
			errors.push('Email should not be blank');
		} else {
			if(!isValidEmail($.trim($('input[name=Email]').val()))){
				errors.push('Email is invalid');
			}
		}
    
		var obj1 =$("input[name==Current Customer]");
		var obj2 =$("input[name=Digital Cable Service]");
		var obj3 =$("input[name=HD/DVR]");
		var obj4 =$("input[name=Starz/Encore]");
		
		if((!obj1.is(":checked")) && (!obj2.is(":checked")) && (!obj3.is(":checked")) && (!obj4.is(":checked"))){
			errors.push('Please select your order type');
		}
	
		if(errors.length>0){
			alert(errors.join("\n"));
			return false;
		}

		return true;

	});


	
	$('#form-pick-3 input[type=checkbox]').click(function(){
		var bol = $('#form-pick-3 input[type=checkbox]:checked').not('#add_ons').length >= 3;	
		$('#form-pick-3 input[type=checkbox]').not(':checked').not('#add_ons').attr('disabled',bol);
	});
	
	
	/* Bundle Start */
	var loc = 'clec';
	var promo = 'pick_3';
	//$('#loc').val(loc);
	//$('#promo').val(promo);
	if($('#choose_area').length>0){
		$('#choose_area').change(function(){
										  
			loc = 'clec';
			
			if($.inArray(parseInt($(this).val()), [1,8,9,11,13,14,16,17,18,20,21,25,27,29,32,35,38,40,41] ) > -1){
				loc = 'ilec';
			}
			
			if($.inArray(parseInt($(this).val()), [3,28,37] )> -1){
				promo = 'key_connections_eligible';
				$('.build-your-bundle-form form').attr('action','');
			} else if($.inArray(parseInt($(this).val()), [8,14,16,17,18,20,23,27,29] )> -1){
				promo = 'simple_bundle';
				$('.build-your-bundle-form form').attr('action','/formprocess.aspx?id=49017');
			} else {
				promo = 'pick_3';
				$('.build-your-bundle-form form').attr('action','/formprocess.aspx?id=46244');
			}
			
			//$('#loc').val(loc);
			//$('#promo').val(promo);

		});
	}
	
	function isValidEmail(str) {
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		 if(reg.test(str) == false) {
			  return false;
		}
		return true;
	}

	$('.build-your-bundle-form form').submit(function(){
		var errors = new Array();
		
		if($.trim($('#choose_area').val())==''){
			errors.push('Please choose your area');
		}
		if($.trim($('input[name=Name]').val())==''){
			errors.push('Name should not be blank');
		}
		if($.trim($('input[name=Address]').val())==''){
			errors.push('Address should not be blank');
		}
		if($.trim($('input[name=City]').val())==''){
			errors.push('City should not be blank');
		}
		if($.trim($('input[name=Phone]').val())==''){
			errors.push('Phone should not be blank');
		}
		if($.trim($('input[name=Email]').val())==''){
			errors.push('Email should not be blank');
		} else {
			if(!isValidEmail($.trim($('input[name=Email]').val()))){
				errors.push('Email is invalid');
			}
		}
		
		if(errors.length>0){
			alert(errors.join("\n"));
			return false;
		}
		if(promo=='key_connections_eligible'){
			$('.bb_popup .bb_content').html('<h2>Your area is eligible for a special exclusive price!</h2>  <p>Contact customer service at 843-749-1101 or <a href="mailto:CustServ.htc400@hometelco.com">email us</a></p>');							 
			$('.bb_popup').show();
			return false;
		}
		
		return true;
	})

	/* Bundle builder */
	
	if($('.bundle-builder').length>0){
		
		var total_tabs = $('.bundle-builder-tabs li').length;
		var total_contents = $('.contents .tab-content').length;
		var cur_tab_index = 0;
		$('.bundle-builder-tabs li').click(function(){
			var index = $(this).index();
			
			//check
			tel_service_selected = Number($("input[type='checkbox'][name='Telephone Option']:checked").length > 0);
			net_service_selected = Number($("input[type='checkbox'][name='Internet Option']:checked").length > 0);
			cable_service_selected = Number($("input[type='checkbox'][name='Cable Option']:checked").length > 0);
			
			if($(".sub-option input[type='checkbox']:checked").length <= 0 && $('#telephone-option-1:checked').length>0){
				alert('Please select 3 calling features.');
				return false;
			}
				
			if(cur_tab_index==0 && tel_service_selected==0 && cur_tab_index < index){
				return false;
			}
			if(cur_tab_index==1 && net_service_selected==0 && cur_tab_index < index){
				return false;
			}
			if(cur_tab_index==2 && cable_service_selected==0 && cur_tab_index < index){
				return false;
			}
			cur_tab_index = index;
			//end check
			show_content(index);

			return false;
		});
		
		function show_content(i){
			$('.bundle-builder').data('current',i);
			//hide popups
			$('div.bb_popup').hide();	
			//tabs
			$('.bundle-builder-tabs li').attr('class','');
			if(i>=0 && i <= total_tabs-1){
				$('.bundle-builder-tabs li').eq(i).attr('class','current');
			}
			//contents
			$('.tab-content').hide();
			$('.tab-content').eq(i).show();
			
			//btns
			if(i==0){
				$('.btn-bundle-back').hide();
			}else{
				$('.btn-bundle-back').show();
			}
			//btns
			if(i >= total_contents-1){
				$('.btn-bundle-next').hide();
				$('.btn-bundle-submit').show();
			}else{
				$('.btn-bundle-next').show();
				$('.btn-bundle-submit').hide();
			}
		}
		
		$('.btn-bundle-back').click(function(){
			var index = $('.bundle-builder').data('current');
			index--;
			if(index < 0){
				index = 0;	
			}
			show_content(index);
			return false;
		});
		$('.btn-bundle-next').click(function(){
			var index = $('.bundle-builder').data('current');
			
			//check
			tel_service_selected = Number($("input['type=checkbox'][name='Telephone Option']:checked").length > 0);
			net_service_selected = Number($("input[type='checkbox'][name='Internet Option']:checked").length > 0);
			cable_service_selected = Number($("input[type='checkbox'][name='Cable Option']:checked").length > 0);
			
			if($(".sub-option input[type=checkbox]:checked").length <= 0 && $('#telephone-option-1:checked').length>0){
				alert('Please select 3 calling features.');
				return false;
			}
			if(index==0 && tel_service_selected==0){
				
				return false;
			}
			if(index==1 && net_service_selected==0){
				return false;
			}
			if(index==2 && cable_service_selected==0){
				return false;
			}
			//end check
			
			index++;
			if(index > total_contents-1){
				index = total_contents-1;	
			}
			show_content(index);
			return false;
		});
		
		//default
		show_content(0);
		
		var bundleprice = 0;
		var savings = 0;
		
		function strip(html)
		{
		   var tmp = document.createElement("DIV");
		   tmp.innerHTML = html;
		   return tmp.textContent||tmp.innerText;
		}
		function update_price(val){
			bundleprice = val;
			val = val.toFixed(2);
			var bundle_price = new String(val);
			$('.bundle-price .price').html("<sup>$</sup>"+bundle_price.substr(0,bundle_price.indexOf('.')+1)+"<span>"+bundle_price.substr(bundle_price.indexOf('.')+1)+"</span>");
		}
		function update_savings(val){
			savings = val;
			val = val.toFixed(2);
			var bundle_price = new String(val);
			$('.bundle-savings .price').html("<sup>$</sup>"+bundle_price.substr(0,bundle_price.indexOf('.')+1)+"<span>"+bundle_price.substr(bundle_price.indexOf('.')+1)+"</span>");
		}
		//checkboxes
		$('#telephone-option-1,#telephone-option-2').click(function(){
			$('#telephone-option-none').removeAttr("checked");
		});
		$("input[name='Internet Option']").click(function(){
			$("input[name='Internet Option']").not($(this)).removeAttr("checked");
		});
		$("input[name='Cable Option']").click(function(){
			$("input[name='Cable Option']").not($(this)).removeAttr("checked");
		});
		$("input[name='Cable Upgrade']").click(function(){
			$("input[name='Cable Upgrade']").not($(this)).removeAttr("checked");
		});
		
		$('#telephone-option-none').click(function(){
			$("input[name='Telephone Option']").not($(this)).removeAttr("checked");
			$(".sub-option input[type='checkbox']").removeAttr("checked").attr("disabled",false);
		});
		$('#internet-option-none').click(function(){
			$("input[name='Internet Option']").not($(this)).removeAttr("checked");
		});
		$('#cable-option-none').click(function(){
			$("input[name='Cable Option']").not($(this)).removeAttr("checked");
			$("input[name='Cable Upgrade']").removeAttr("checked");
		});
		$('#addon-option-none').click(function(){
			$("input[name='Wireless Discount'],input[name='Security Discount']").not($(this)).removeAttr("checked");
		});
		
		$("input[type='checkbox']").click(function(){
			//enable disable addons depending on services selected
			tel_service_selected = Number($("input[type='checkbox'][name='Telephone Option']:checked").not('#telephone-option-none').length > 0);
			net_service_selected = Number($("input[type='checkbox'][name='Internet Option']:checked").not('#internet-option-none').length > 0);
			cable_service_selected = Number($("input[type='checkbox'][name='Cable Option']:checked").not('#cable-option-none').length > 0);
			total_services_selected = tel_service_selected + net_service_selected + cable_service_selected;
			if(total_services_selected >= 3){
				$('#addon_option-3').attr("disabled", false);
			} else if(total_services_selected >= 2){
				$('#addon_option-1').attr("disabled", false);
				$('#addon_option-2').attr("disabled", false);
			} else {
				$('#addon_option-1').attr("disabled", true);
				$('#addon_option-2').attr("disabled", true);
				$('#addon_option-3').attr("disabled", true);
				$('#addon_option-1').removeAttr("checked");
				$('#addon_option-2').removeAttr("checked");
				$('#addon_option-3').removeAttr("checked");
			}
			
			bundlelize();
			
		});
		
		function bundlelize(){
			update_price(0.00);
			update_savings(0.00);
				
			if($('#telephone-option-1').attr("checked") ){
				update_price(50.85);
				update_savings(0.00);
			}
			
			if($('#telephone-option-1').attr("checked") && $(".sub-option input[type='checkbox']:checked").length >= 3){
				update_price(46.49);
				update_savings(4.36);
			}
			
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked")){
				update_price(60.85);
				update_savings(0.00);
			}
			
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $(".sub-option input[type=checkbox]:checked").length >= 3){
				update_price(56.49);
				update_savings(4.36);
			}
			
			//net
			if($('#internet-option-1').attr("checked")){
				update_price(44.95);
				update_savings(0.00);
			}
			if($('#internet-option-2').attr("checked")){
				update_price(54.95);
				update_savings(0.00);
			}
			if($('#internet-option-3').attr("checked")){
				update_price(64.95);
				update_savings(0.00);
			}
			if($('#internet-option-4').attr("checked")){
				update_price(74.95);
				update_savings(0.00);
			}
			if($('#internet-option-5').attr("checked")){
				update_price(119.95);
				update_savings(0.00);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-1').attr("checked")){
				update_price(76.49);
				update_savings(19.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-1').attr("checked")){
				update_price(81.49);
				update_savings(24.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-2').attr("checked")){
				update_price(81.49);
				update_savings(24.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-2').attr("checked")){
				update_price(86.49);
				update_savings(29.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-3').attr("checked")){
				update_price(86.49);
				update_savings(29.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-3').attr("checked")){
				update_price(91.49);
				update_savings(34.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-4').attr("checked")){
				update_price(96.49);
				update_savings(29.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-4').attr("checked")){
				update_price(101.49);
				update_savings(34.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-5').attr("checked")){
				update_price(136.49);
				update_savings(34.31);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-5').attr("checked")){
				update_price(141.49);
				update_savings(39.31);
			}
			
			//telephone and cable bundles
			if( $('#cable_option-1').attr("checked")){
				update_price(74.95);
				update_savings(0.00);
			}
			if( $('#cable_option-2').attr("checked")){
				update_price(107.95);
				update_savings(0.00);
			}
			if($('#telephone-option-1').attr("checked") && $('#cable_option-1').attr("checked")){
				update_price(109.99);
				update_savings(15.81);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#cable_option-1').attr("checked")){
				update_price(114.99);
				update_savings(20.81);
			}
			if($('#telephone-option-1').attr("checked") && $('#cable_option-2').attr("checked")){
				update_price(143.99);
				update_savings(14.81);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#cable_option-2').attr("checked")){
				update_price(148.99);
				update_savings(19.81);
			}
			
			
			//internet and cable bundles
			if($('#internet-option-1').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(104.90);
				update_savings(15.00);
			}
			if($('#internet-option-2').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(109.90);
				update_savings(20.00);
			}
			if($('#internet-option-3').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(114.90);
				update_savings(25.00);
			}
			if($('#internet-option-1').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(138.90);
				update_savings(14.00);
			}
			if($('#internet-option-2').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(143.90);
				update_savings(19.00);
			}
			if($('#internet-option-3').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(148.90);
				update_savings(24.00);
			}
			if($('#internet-option-4').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(124.90);
				update_savings(25.00);
			}
			if($('#internet-option-4').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(158.90);
				update_savings(24.00);
			}
			if($('#internet-option-5').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(164.90);
				update_savings(30.00);
			}
			if($('#internet-option-5').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(198.90);
				update_savings(29.00);
			}
			
			//tel, net, cable
			if($('#telephone-option-1').attr("checked") && $('#internet-option-1').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(139.99);
				update_savings(30.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-1').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(144.99);
				update_savings(35.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-2').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(144.99);
				update_savings(35.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-2').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(149.99);
				update_savings(40.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-3').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(149.99);
				update_savings(40.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-3').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(154.99);
				update_savings(45.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-4').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(159.99);
				update_savings(40.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-4').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(164.99);
				update_savings(45.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-5').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(199.99);
				update_savings(45.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-5').attr("checked") && $('#cable_option-1').attr("checked") ){
				update_price(204.99);
				update_savings(50.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-1').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(173.99);
				update_savings(29.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-1').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(178.99);
				update_savings(34.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-2').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(178.99);
				update_savings(34.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-2').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(183.99);
				update_savings(39.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-3').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(183.99);
				update_savings(39.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-3').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(188.99);
				update_savings(44.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-4').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(193.99);
				update_savings(39.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-4').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(198.99);
				update_savings(44.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#internet-option-5').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(233.99);
				update_savings(44.76);
			}
			if($('#telephone-option-1').attr("checked") && $('#telephone-option-2').attr("checked") && $('#internet-option-5').attr("checked") && $('#cable_option-2').attr("checked") ){
				update_price(238.99);
				update_savings(49.76);
			}
			
			//upgrade cables
			if( ($('#cable_option-1').attr("checked") || $('#cable_option-2').attr("checked")) && $('#cable_option-3').attr("checked")){
				update_price(bundleprice+9.95);
			}
			if( ($('#cable_option-1').attr("checked") || $('#cable_option-2').attr("checked")) && $('#cable_option-4').attr("checked")){
				update_price(bundleprice+9.95);
			}
			if( ($('#cable_option-1').attr("checked") || $('#cable_option-2').attr("checked")) && $('#cable_option-5').attr("checked")){
				update_price(bundleprice+14.95);
			}
			
			//security addon
			if($('#addon_option-1').attr("checked")){
				update_price(bundleprice+25.00);
			}
		}

		
		//default
		$('input[type=checkbox]').removeAttr("checked");
		//weborders@hometelco.com.
	}
});

