// PRICE SWAPPING
	
	function sumitall_custom() {
		//LOGOS
	    var logoval = document.getElementById('Logo').checked; //IS LOGO BOX CHECKED?//
		if (logoval==0)//LOGO BOX IS NOT CHECKED//
		{
		document.getElementById('Logo_Addon').value="No";
		document.priceform.Logo_Comps.value="0";
		document.priceform.Logo_Comps.disabled=true; //disable comps and return to 0
		document.priceform.Logo_Revisions.value="0";
		document.priceform.Logo_Revisions.disabled=true; //disable revisions and return to 0
		document.getElementById('Logo_Price_Total').value="0";
		document.getElementById('Logo_Comps_Total').value="0";
		document.getElementById('Logo_Comps_Price').value="0";
		document.getElementById('Logo_Revisions_Total').value="0";
		document.getElementById('Logo_Revisions_Price').value="0";
		}
		else //LOGO BOX IS CHECKED//
		{
		document.getElementById('Logo_Addon').value="Yes";
		document.priceform.Logo_Comps.disabled=false; //reactivate comps//
		document.priceform.Logo_Revisions.disabled=false;//reactivate revisions//
		}
		if(logoval == 1)  //IF LOGO BOX IS CHECKED
		{document.getElementById('Logo').value=499} //ITS VALUE IS 149
		else (document.getElementById('Logo').value=0); //OTHERWISE ITS 0
		var cplogo = eval(document.priceform.Logo.value);
		
		//------------------------------------------------//
		//BUSINESS CARDS
		
	    var buscardval = document.getElementById('Business_Card').checked; //IS BOX CHECKED?//
		if (buscardval==0)//BOX IS NOT CHECKED//
		{
		document.getElementById('Business_Card_Addon').value="No";
		document.priceform.Business_Card_Comps.value="0";
		document.priceform.Business_Card_Comps.disabled=true; //disable comps and return to 0
		document.priceform.Business_Card_Revisions.value="0";
		document.priceform.Business_Card_Revisions.disabled=true; //disable revisions and return to 0
		document.getElementById('Business_Card_Price_Total').value="0";
		document.getElementById('Business_Card_Comps_Total').value="0";
		document.getElementById('Business_Card_Comps_Price').value="0";
		document.getElementById('Business_Card_Revisions_Total').value="0";
		document.getElementById('Business_Card_Revisions_Price').value="0";
		}
		else //BOX IS CHECKED//
		{
		document.getElementById('Business_Card_Addon').value="Yes";
		document.priceform.Business_Card_Comps.value="1";
		document.priceform.Business_Card_Comps.disabled=false; //reactivate comps//
		document.priceform.Business_Card_Revisions.disabled=false;//reactivate revisions//
		}
		if(buscardval == 1)  //IF BOX IS CHECKED
		{document.getElementById('Business_Card').value=99} //ITS VALUE IS 99
		else (document.getElementById('Business_Card').value=0); //OTHERWISE ITS 0
		var cpbc = eval(document.getElementById('Business_Card').value);
		
		
		//------------------------------------------------//
		//STATIONARY/FLYER
		
	    var sfval = document.getElementById('Stationary_Flyer').checked; //IS BOX CHECKED?//
		if (sfval==0)//BOX IS NOT CHECKED//
		{
		document.getElementById('Stationary_Addon').value="No";
		document.priceform.Stationary_Comps.value="0";
		document.priceform.Stationary_Comps.disabled=true; //disable comps and return to 0
		document.priceform.Stationary_Revisions.value="0";
		document.priceform.Stationary_Revisions.disabled=true; //disable revisions and return to 0
		document.getElementById('Stationary_Price_Total').value="0";
		document.getElementById('Stationary_Comps_Total').value="0";
		document.getElementById('Stationary_Comps_Price').value="0";
		document.getElementById('Stationary_Revisions_Total').value="0";
		document.getElementById('Stationary_Revisions_Price').value="0";
		}
		else //BOX IS CHECKED//
		{
		document.getElementById('Stationary_Addon').value="Yes";
		document.priceform.Stationary_Comps.disabled=false; //reactivate comps//
		document.priceform.Stationary_Revisions.disabled=false;//reactivate revisions//
		}
		if(sfval == 1)  //IF BOX IS CHECKED
		{document.getElementById('Stationary_Flyer').value=129} //ITS VALUE IS 129
		else (document.getElementById('Stationary_Flyer').value=0); //OTHERWISE ITS 0
		var cpsf = eval(document.getElementById('Stationary_Flyer').value);
		
		
		//------------------------------------------------//
		//BASIC WEBSITE
		
	    var bwval = document.getElementById('Basic_Website').checked; //IS BOX CHECKED?//
		if (bwval==0)//BOX IS NOT CHECKED//
		{
		document.getElementById('Basic_Website_Addon').value="No";
		document.priceform.Basic_Website_Comps.value="0";
		document.priceform.Basic_Website_Comps.disabled=true; //disable comps and return to 0
		document.priceform.Basic_Website_Revisions.value="0";
		document.priceform.Basic_Website_Revisions.disabled=true; //disable revisions and return to 0
		document.getElementById('Basic_Website_Price_Total').value="0";
		document.getElementById('Basic_Website_Comps_Total').value="0";
		document.getElementById('Basic_Website_Comps_Price').value="0";
		document.getElementById('Basic_Website_Revisions_Total').value="0";
		document.getElementById('Basic_Website_Revisions_Price').value="0";
		}
		else //BOX IS CHECKED//
		{
		document.getElementById('Basic_Website_Addon').value="Yes";
		document.priceform.Basic_Website_Comps.disabled=false; //reactivate comps//
		document.priceform.Basic_Website_Revisions.disabled=false;//reactivate revisions//
		}
		if(bwval == 1)  //IF BOX IS CHECKED
		{document.getElementById('Basic_Website').value=1250} //ITS VALUE
		else (document.getElementById('Basic_Website').value=0); //OTHERWISE ITS 0
		var bwsf = eval(document.getElementById('Basic_Website').value);
		
				
		//------------------------------------------------//
		//CMS WEBSITE
		
	    var cmsval = document.getElementById('CMS_Website').checked; //IS BOX CHECKED?//
		if (cmsval==0)//BOX IS NOT CHECKED//
		{
		document.getElementById('CMS_Addon').value="No";
		document.priceform.CMS_Comps.value="0";
		document.priceform.CMS_Comps.disabled=true; //disable comps and return to 0
		document.priceform.CMS_Revisions.value="0";
		document.priceform.CMS_Revisions.disabled=true; //disable revisions and return to 0
		document.getElementById('CMS_Price_Total').value="0";
		document.getElementById('CMS_Comps_Total').value="0";
		document.getElementById('CMS_Comps_Price').value="0";
		document.getElementById('CMS_Revisions_Total').value="0";
		document.getElementById('CMS_Revisions_Price').value="0";
		}
		else //BOX IS CHECKED//
		{
		document.getElementById('CMS_Addon').value="Yes";
		document.priceform.CMS_Comps.disabled=false; //reactivate comps//
		document.priceform.CMS_Revisions.disabled=false;//reactivate revisions//
		}
		if(cmsval == 1)  //IF BOX IS CHECKED
		{document.getElementById('CMS_Website').value=2500} //ITS VALUE
		else (document.getElementById('CMS_Website').value=0); //OTHERWISE ITS 0
		var cmssf = eval(document.getElementById('CMS_Website').value);

		var cp1 = eval(document.priceform.Logo_Comps.value);
		var cp2 = eval(document.priceform.Logo_Revisions.value);
		var cp3 = eval(document.priceform.Business_Card_Comps.value);
		var cp4 = eval(document.priceform.Business_Card_Revisions.value);
		var cp5 = eval(document.priceform.Basic_Website_Comps.value);
		var cp6 = eval(document.priceform.Basic_Website_Revisions.value);
		var cp7 = eval(document.priceform.CMS_Comps.value);
		var cp8 = eval(document.priceform.CMS_Revisions.value);
		var cp9 = eval(document.priceform.Stationary_Comps.value);
		var cp10 = eval(document.priceform.Stationary_Revisions.value);
		var cp11 = eval(document.priceform.Hosting.value);
		var cp12 = eval(document.priceform.Maintenance_Package.value);
		var over15pages = eval(document.priceform.Over_15.value);
		var flashanimation = eval(document.priceform.Flash_Animation.value);
				
			document.priceform.Full_Price.value=cp1+cp2+cp3+cp4+cp5+cp6+cp7+cp8+cp9+cp10+cplogo+cpbc+cpsf+bwsf+cmssf+over15pages+flashanimation+".00";
			document.priceform.Annual_Price.value=cp11+cp12+".00";
	}

//POPULATE HIDDEN VALUES

function hiddenVal_whole (x)
{
	var thepriceval = x+"_Price_Total";  							//declare total price field
	var revisions = x+"_Revisions_Price"; 							//declare final cost of revisions
	var comps = x+"_Comps_Price"; 									//declare final cost of comps
	var totalrevprice = document.getElementById(revisions).value;	//declare final price of revisions
	var totalcompprice = document.getElementById(comps).value;		//declare final price of comps
	var totalprices = eval(totalrevprice)+eval(totalcompprice);		//calculate SUB TOTAL of comps and revisions
	document.getElementById(thepriceval).value=totalprices;			//set value of total price field
}

function hiddenVal_parts (x)
{
	var Current = document.getElementById(x).selectedIndex;
	var theVal = x+"_Total";
	var thePrice = x+"_Price";
	var theIndexval = document.getElementById(x).options[Current].text;
	var thePriceval = document.getElementById(x).value;
	document.getElementById(theVal).value=theIndexval;  			//set hidden number of revisions/comps
	document.getElementById(thePrice).value=thePriceval;  			//set hidden price of revisions/comps
}

function updateContactVal(x){
	var updatedVal = document.getElementById(x).value;					//find what the current value is - "updatedVal"
	var hiddenContactVal = x+"_Total";									//declare hidden field to be populated "hiddenContactVal"
	document.getElementById(hiddenContactVal).value=updatedVal;			//set value of hidden field with "udatedVal"
}

function updateOptionVal(x){
	var hiddenOptionVal = x+"_Total_Cost";
	var hiddenOptionOpt = x+"_Addon";
	var Current = document.getElementById(x).selectedIndex;
	var theIndexval = document.getElementById(x).options[Current].text;
	var updatedVal = document.getElementById(x).value;
	document.getElementById(hiddenOptionVal).value=updatedVal;
	document.getElementById(hiddenOptionOpt).value=theIndexval;
}

function updateTotalPrices (){
	var totalQuote = document.getElementById('Full_Price').value;
	var annualQuote = document.getElementById('Annual_Price').value;
	document.getElementById('Full_Price_Total').value=totalQuote;
	document.getElementById('Annual_Price_Total').value=annualQuote;
	
	//get date/time from client browser
	var currentTime = new Date();
	var currentmon = currentTime.getMonth();
	currentmon++;
	var currentday = currentTime.getDate();
	var currentyear = currentTime.getFullYear();
	document.getElementById('date').value=(currentyear+"-"+currentmon+"-"+currentday);
	
	//get timezone from client computer
   var date1 = new Date(currentTime.getFullYear(), 0, 1, 0, 0, 0, 0);
   var temp = date1.toGMTString();
   var date3 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
   var hoursDiffStdTime = (date1 - date3) / (1000 * 60 * 60);
   document.getElementById('time_zone').value=hoursDiffStdTime;
   //alert(hoursDiffStdTime);
}

function sumCustomPrices (){
			//logo total price
		var logoRevPrice = document.getElementById('Logo_Revisions_Price').value;
		var logoCompsPrice = document.getElementById('Logo_Comps_Price').value;
		var logoThePrice = document.getElementById('Logo').value;
		var logoTotal = eval(logoRevPrice)+eval(logoCompsPrice)+eval(logoThePrice);//+eval(149);
		document.getElementById('Logo_Price_Total').value = logoTotal;
		
			//business cards total price
		var Business_CardRevPrice = document.getElementById('Business_Card_Revisions_Price').value;
		var Business_CardCompsPrice = document.getElementById('Business_Card_Comps_Price').value;
		var Business_CardThePrice = document.getElementById('Business_Card').value;
		var Business_CardTotal = eval(Business_CardRevPrice)+eval(Business_CardCompsPrice)+eval(Business_CardThePrice);//+eval(99);
		document.getElementById('Business_Card_Price_Total').value = Business_CardTotal;
		
			//stationary/flyer total price
		var StationaryRevPrice = document.getElementById('Stationary_Revisions_Price').value;
		var StationaryCompsPrice = document.getElementById('Stationary_Comps_Price').value;
		var StationaryThePrice = document.getElementById('Stationary_Flyer').value;
		var StationaryTotal = eval(StationaryRevPrice)+eval(StationaryCompsPrice)+eval(StationaryThePrice);//+eval(129);
		document.getElementById('Stationary_Price_Total').value = StationaryTotal;
		
			//basic website total price
		var Basic_WebsiteRevPrice = document.getElementById('Basic_Website_Revisions_Price').value;
		var Basic_WebsiteCompsPrice = document.getElementById('Basic_Website_Comps_Price').value;
		var Basic_WebsiteThePrice = document.getElementById('Basic_Website').value;
		var Basic_WebsiteTotal = eval(Basic_WebsiteRevPrice)+eval(Basic_WebsiteCompsPrice)+eval(Basic_WebsiteThePrice);//+eval(650);
		document.getElementById('Basic_Website_Price_Total').value = Basic_WebsiteTotal;
		
			//cms total price
		var CMSRevPrice = document.getElementById('CMS_Revisions_Price').value;
		var CMSCompsPrice = document.getElementById('CMS_Comps_Price').value;
		var CMSThePrice = document.getElementById('CMS_Website').value;
		var CMSTotal = eval(CMSRevPrice)+eval(CMSCompsPrice)+eval(CMSThePrice);
		document.getElementById('CMS_Price_Total').value = CMSTotal;
}



//SLIDING BOXES SCRIPT
			$(document).ready(function(){
				//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
				//Vertical Sliding
				$('.boxgrid.slidedown').hover(function(){
					$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
				});
				//Horizontal Sliding
				$('.boxgrid.slideright').hover(function(){
					$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
				});
				//Diagnal Sliding
				$('.boxgrid.thecombo').hover(function(){
					$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
				});
				//Partial Sliding (Only show some of background)
				$('.boxgrid.peek').hover(function(){
					$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
				});
				//Full Caption Sliding (Hidden to Visible)
				$('.boxgrid.captionfull').hover(function(){
					$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:160});
				});
				//Caption Sliding (Partially Hidden to Visible)
				$('.boxgrid.caption').hover(function(){
					$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
				});
			});


// STICKY

function moveScroller() {
  var a = function() {
    var b = $(window).scrollTop();
    var d = $("#sticky-anchor").offset().top;
    var c=$("#title-holder");
    if (b>d) {
      c.css({position:"fixed",top:"50px"})
    } else {
      if (b<=d) {
        c.css({position:"relative",top:""})
      }
    }
  };
  $(window).scroll(a);a()
}


//ROTATING IMAGES
		function slideSwitch() {
			var $active = $('#slideshow DIV.active');
		
			if ( $active.length == 0 ) $active = $('#slideshow DIV:last');
		
			var $next =  $active.next().length ? $active.next()
				: $('#slideshow DIV:first');
		
			$active.addClass('last-active');
		
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 3000, function() {
					$active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch()", 9000 );
		});


//FADING OPACITY

		$(function() {
		$(".fadeFull").css("opacity","0.0");
				
		$(".fadeFull").hover(function () {
												  
		// SET OPACITY TO 100%
		$(this).stop().animate({
		opacity: 1.0
		}, "slow");
		},
				
		// ON MOUSE OUT
		function () {
					
		// SET OPACITY BACK TO 50%
		$(this).stop().animate({
		opacity: 0.0
		}, "slow");
		});
		});
		
		$(function() {
		// OPACITY OF BUTTON SET TO 50%
		$(".fadeOpac").css("opacity","0.9");
				
		// ON MOUSE OVER
		$(".fadeOpac").hover(function () {
												  
		// SET OPACITY TO 100%
		$(this).stop().animate({
		opacity: 1.0
		}, "slow");
		},
				
		// ON MOUSE OUT
		function () {
					
		// SET OPACITY BACK TO 50%
		$(this).stop().animate({
		opacity: 0.9
		}, "slow");
		});
		});
		
		
		$(function() {
		// OPACITY OF BUTTON SET TO 50%
		$(".fadeHalf").css("opacity","0.5");
				
		// ON MOUSE OVER
		$(".fadeHalf").hover(function () {
												  
		// SET OPACITY TO 100%
		$(this).stop().animate({
		opacity: .9
		}, "slow");
		},
				
		// ON MOUSE OUT
		function () {
					
		// SET OPACITY BACK TO 50%
		$(this).stop().animate({
		opacity: 0.5
		}, "slow");
		});
		});
		
/* 
Simple JQuery menu.
HTML structure to use:

Notes: 

1: each menu MUST have an ID set. It doesn't matter what this ID is as long as it's there.
2: each menu MUST have a class 'menu' set. If the menu doesn't have this, the JS won't make it dynamic

Optional extra classnames:

noaccordion : no accordion functionality
collapsible : menu works like an accordion but can be fully collapsed
expandfirst : first menu item expanded at page load


Copyright 2008 by Marco van Hylckama Vlieg

web: http://www.i-marco.nl/weblog/
email: marco@i-marco.nl

Free for non-commercial use
*/

function initMenus() {
	$('ul.menu ul').hide();
	$.each($('ul.menu'), function(){
		$('#' + this.id + '.expandfirst ul:first').show();
	});
	$('ul.menu li a').click(
		function() {
			var checkElement = $(this).next();
			var parent = this.parentNode.parentNode.id;

			if($('#' + parent).hasClass('noaccordion')) {
				$(this).next().slideToggle('normal');
				return false;
			}
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				if($('#' + parent).hasClass('collapsible')) {
					$('#' + parent + ' ul:visible').slideUp('normal');
				}
				return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#' + parent + ' ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
		}
	);
}
$(document).ready(function() {initMenus();});


		
