function mainmenu(){
$(" #nav a").removeAttr("title");
$(" #nav ul ").css({display: "none"});
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(300);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

$(document).ready(function(){
	mainmenu();
});

Cufon.replace('.cufon');

$(document).ready(function(){
	var width = 0;
	$('#nav li').each(function() {
    	width += $(this).outerWidth( false );
		});
	var pad = Math.floor((940-width)/(2*8));
	var pad2 = (((940-width)/(2*8))-pad)*8 + pad;
	var pad3 = pad2-pad;
	$('#nav li').css({padding: "0px "+ pad +"px"});
	$('#nav li:last-child').css({padding: "0px "+ pad2 + "px"});
	$('#nav li ul li ').css({padding: "0 0",margin:"0px 0px 0px -" + pad + "px"});
	$('#nav li:last-child ul li ').css({margin:"0px 0px 0px -" + pad2 + "px"});
	$('#nav li ul li ul li ').css({padding: "0 0",margin: "0px 0px 0px 22px"});
});

$(document).ready(
	function(){
		$("#ticker01").innerfade({
			animationtype: 'fade',
			speed: 'slow',
			timeout: 4000,
			containerheight: '1em'
		});	
		$("#partnerslist").innerfade({
			animationtype: 'fade',
			speed: 'slow',
			timeout: 4000,
			containerheight: '200px'
		});
	}
);

$(document).ready(function() {			
        $("a.maplink").fancybox({
            'zoomSpeedIn'		:	500,
            'zoomSpeedOut'		:	500,
            'overlayShow'		:	false,
            'frameHeight':		450,
			'frameWidth':		500
        });
    });

$(function () {
  $('.bubbleInfo').each(function () {
    // options
    var distance = 10;
    var time = 250;
    var hideDelay = 500;

    var hideDelayTimer = null;

    // tracker
    var beingShown = false;
    var shown = false;
    
    var trigger = $('.trigger', this);
    var popup = $('.popup', this).css('opacity', 0);

    // set the mouseover and mouseout on both element
    $([trigger.get(0), popup.get(0)]).mouseover(function () {
      // stops the hide event if we move from the trigger to the popup element
      if (hideDelayTimer) clearTimeout(hideDelayTimer);

      // don't trigger the animation again if we're being shown, or already visible
      if (beingShown || shown) {
        return;
      } else {
        beingShown = true;

        // reset position of popup box
        popup.css({
          top: -20,
          left: 150,
          display: 'block' // brings the popup back in to view
        })

        // (we're using chaining on the popup) now animate it's opacity and position
        .animate({
          top: '-=' + distance + 'px',
          opacity: 0.9
        }, time, 'swing', function() {
          // once the animation is complete, set the tracker variables
          beingShown = false;
          shown = true;
        });
      }
    }).mouseout(function () {
      // reset the timer if we get fired again - avoids double animations
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      
      // store the timer so that it can be cleared in the mouseover if required
      hideDelayTimer = setTimeout(function () {
        hideDelayTimer = null;
        popup.animate({
          top: '-=' + distance + 'px',
          opacity: 0
        }, time, 'swing', function () {
          // once the animate is complete, set the tracker variables
          shown = false;
          // hide the popup entirely after the effect (opacity alone doesn't do the job)
          popup.css('display', 'none');
        });
      }, hideDelay);
    });
  });
});

$(document).ready(function(){
	function isInteger(s) {
  		return (s.toString().search(/^-?[0-9]+$/) == 0);
	}
    $('#1').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub1').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub1').removeAttr("disabled");
        }
	});
	$('#2').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub2').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub2').removeAttr("disabled");
        }
	});
	$('#3').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub3').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub3').removeAttr("disabled");
        }
	});
	$('#4').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub4').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub4').removeAttr("disabled");
        }
	});
	$('#5').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub5').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub5').removeAttr("disabled");
        }
	});
	$('#6').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub6').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub6').removeAttr("disabled");
        }
	});
	$('#7').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub7').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub7').removeAttr("disabled");
        }
	});
	$('#8').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub8').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub8').removeAttr("disabled");
        }
	});
	$('#9').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub9').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub9').removeAttr("disabled");
        }
	});
	$('#10').keyup(function(){
    	var $int = $(this).val();
        if ( !isInteger($int)){
        	alert("Please enter an integer");
        	$('#sub10').attr("disabled","disabled");
        	$(this).select();
        } else if ( isInteger($int)) {
        	$('#sub10').removeAttr("disabled");
        }
	});
});

$(document).ready(function(){
	$('#sub1').click(function(){
		if ( $('#item1').hasClass('row') ) {
			var $sku1 = $('#sku1').val();
			var $quantity1 = $('#1').val();
			var $price1 = $('#price1').val();
			var $total1 = $quantity1 *  $price1;
			$('#item1').removeClass("row");
			$('#sku_item_1').text($sku1);
			$('#price_item_1').text('$' + $price1);
			$('#qty_item_1').val($quantity1);
			$('#total_item_1').text('$' + $total1);
			$('#formsku1').val($sku1);
			$('#formprice1').val($price1);
			$('#formquantity1').val($quantity1);
		} else {
			var $sku1 = $('#sku1').val();
			var $quantity1 = $('#1').val();
			var $price1 = $('#price1').val();
			var $total1 = $quantity1 *  $price1;
			$('#sku_item_1').text($sku1);
			$('#price_item_1').text('$' + $price1);
			$('#qty_item_1').val($quantity1);
			$('#total_item_1').text('$' + $total1);
			$('#formsku1').val($sku1);
			$('#formprice1').val($price1);
			$('#formquantity1').val($quantity1);
		}
	});	
	$('#sub2').click(function(){
		if ( $('#item2').hasClass('row') ) {
			var $sku2 = $('#sku2').val();
			var $quantity2 = $('#2').val();
			var $price2 = $('#price2').val();
			var $total2 = $quantity2 *  $price2;
			$('#item2').removeClass("row");
			$('#sku_item_2').text($sku2);
			$('#price_item_2').text('$' + $price2);
			$('#qty_item_2').val($quantity2);
			$('#total_item_2').text('$' + $total2);
			$('#formsku2').val($sku2);
			$('#formprice2').val($price2);
			$('#formquantity2').val($quantity2);
		} else {
			var $sku2 = $('#sku2').val();
			var $quantity2 = $('#2').val();
			var $price2 = $('#price2').val();
			var $total2 = $quantity2 *  $price2;
			$('#sku_item_2').text($sku2);
			$('#price_item_2').text('$' + $price2);
			$('#qty_item_2').val($quantity2);
			$('#total_item_2').text('$' + $total2);
			$('#formsku2').val($sku2);
			$('#formprice2').val($price2);
			$('#formquantity2').val($quantity2);
		}
	});	
	$('#sub3').click(function(){
		if ( $('#item3').hasClass('row') ) {
			var $sku3 = $('#sku3').val();
			var $quantity3 = $('#3').val();
			var $price3 = $('#price3').val();
			var $total3 = $quantity3 *  $price3;
			$('#item3').removeClass("row");
			$('#sku_item_3').text($sku3);
			$('#price_item_3').text('$' + $price3);
			$('#qty_item_3').val($quantity3);
			$('#total_item_3').text('$' + $total3);
			$('#formsku3').val($sku3);
			$('#formprice3').val($price3);
			$('#formquantity3').val($quantity3);
		} else {
			var $sku3 = $('#sku3').val();
			var $quantity3 = $('#3').val();
			var $price3 = $('#price3').val();
			var $total3 = $quantity3 *  $price3;
			$('#sku_item_3').text($sku3);
			$('#price_item_3').text('$' + $price3);
			$('#qty_item_3').val($quantity3);
			$('#total_item_3').text('$' + $total3);
			$('#formsku3').val($sku3);
			$('#formprice3').val($price3);
			$('#formquantity3').val($quantity3);
		}
	});	
	$('#sub4').click(function(){
		if ( $('#item4').hasClass('row') ) {
			var $sku4 = $('#sku4').val();
			var $quantity4 = $('#4').val();
			var $price4 = $('#price4').val();
			var $total4 = $quantity4 *  $price4;
			$('#item4').removeClass("row");
			$('#sku_item_4').text($sku4);
			$('#price_item_4').text('$' + $price4);
			$('#qty_item_4').val($quantity4);
			$('#total_item_4').text('$' + $total4);
			$('#formsku4').val($sku4);
			$('#formprice4').val($price4);
			$('#formquantity4').val($quantity4);
		} else {
			var $sku4 = $('#sku4').val();
			var $quantity4 = $('#4').val();
			var $price4 = $('#price4').val();
			var $total4 = $quantity4 *  $price4;
			$('#sku_item_4').text($sku4);
			$('#price_item_4').text('$' + $price4);
			$('#qty_item_4').val($quantity4);
			$('#total_item_4').text('$' + $total4);
			$('#formsku4').val($sku4);
			$('#formprice4').val($price4);
			$('#formquantity4').val($quantity4);		}
	});	

	$('#sub5').click(function(){
		if ( $('#item5').hasClass('row') ) {
			var $sku5 = $('#sku5').val();
			var $quantity5 = $('#5').val();
			var $price5 = $('#price5').val();
			var $total5 = $quantity5 *  $price5;
			$('#item5').removeClass("row");
			$('#sku_item_5').text($sku5);
			$('#price_item_5').text('$' + $price5);
			$('#qty_item_5').val($quantity5);
			$('#total_item_5').text('$' + $total5);
			$('#formsku5').val($sku5);
			$('#formprice5').val($price5);
			$('#formquantity5').val($quantity5);
		} else {
			var $sku5 = $('#sku5').val();
			var $quantity5 = $('#5').val();
			var $price5 = $('#price5').val();
			var $total5 = $quantity5 *  $price5;
			$('#sku_item_5').text($sku5);
			$('#price_item_5').text('$' + $price5);
			$('#qty_item_5').val($quantity5);
			$('#total_item_5').text('$' + $total5);
			$('#formsku5').val($sku5);
			$('#formprice5').val($price5);
			$('#formquantity5').val($quantity5);
		}
	});	

	$('#sub6').click(function(){
		if ( $('#item6').hasClass('row') ) {
			var $sku6 = $('#sku6').val();
			var $quantity6 = $('#6').val();
			var $price6 = $('#price6').val();
			var $total6 = $quantity6 *  $price6;
			$('#item6').removeClass("row");
			$('#sku_item_6').text($sku6);
			$('#price_item_6').text('$' + $price6);
			$('#qty_item_6').val($quantity6);
			$('#total_item_6').text('$' + $total6);
			$('#formsku6').val($sku6);
			$('#formprice6').val($price6);
			$('#formquantity6').val($quantity6);
		} else {
			var $sku6 = $('#sku6').val();
			var $quantity6 = $('#6').val();
			var $price6 = $('#price6').val();
			var $total6 = $quantity6 *  $price6;
			$('#sku_item_6').text($sku6);
			$('#price_item_6').text('$' + $price6);
			$('#qty_item_6').val($quantity6);
			$('#total_item_6').text('$' + $total6);
			$('#formsku6').val($sku6);
			$('#formprice6').val($price6);
			$('#formquantity6').val($quantity6);
		}
	});	

	$('#sub7').click(function(){
		if ( $('#item7').hasClass('row') ) {
			var $sku7 = $('#sku7').val();
			var $quantity7 = $('#7').val();
			var $price7 = $('#price7').val();
			var $total7 = $quantity7 *  $price7;
			$('#item7').removeClass("row");
			$('#sku_item_7').text($sku7);
			$('#price_item_7').text('$' + $price7);
			$('#qty_item_7').val($quantity7);
			$('#total_item_7').text('$' + $total7);
			$('#formsku7').val($sku7);
			$('#formprice7').val($price7);
			$('#formquantity7').val($quantity7);
		} else {
			var $sku7 = $('#sku7').val();
			var $quantity7 = $('#7').val();
			var $price7 = $('#price7').val();
			var $total7 = $quantity7 *  $price7;
			$('#sku_item_7').text($sku7);
			$('#price_item_7').text('$' + $price7);
			$('#qty_item_7').val($quantity7);
			$('#total_item_7').text('$' + $total7);
			$('#formsku7').val($sku7);
			$('#formprice7').val($price7);
			$('#formquantity7').val($quantity7);
		}
	});	

	$('#sub8').click(function(){
		if ( $('#item8').hasClass('row') ) {
			var $sku8 = $('#sku8').val();
			var $quantity8 = $('#8').val();
			var $price8 = $('#price8').val();
			var $total8 = $quantity8 *  $price8;
			$('#item8').removeClass("row");
			$('#sku_item_8').text($sku8);
			$('#price_item_8').text('$' + $price8);
			$('#qty_item_8').val($quantity8);
			$('#total_item_8').text('$' + $total8);
			$('#formsku8').val($sku8);
			$('#formprice8').val($price8);
			$('#formquantity8').val($quantity8);
		} else {
			var $sku8 = $('#sku8').val();
			var $quantity8 = $('#8').val();
			var $price8 = $('#price8').val();
			var $total8 = $quantity8 *  $price8;
			$('#sku_item_8').text($sku8);
			$('#price_item_8').text('$' + $price8);
			$('#qty_item_8').val($quantity8);
			$('#total_item_8').text('$' + $total8);
			$('#formsku8').val($sku8);
			$('#formprice8').val($price8);
			$('#formquantity8').val($quantity8);
		}
	});	

	$('#sub9').click(function(){
		if ( $('#item3').hasClass('row') ) {
			var $sku9 = $('#sku9').val();
			var $quantity9 = $('#9').val();
			var $price9 = $('#price9').val();
			var $total9 = $quantity9 *  $price9;
			$('#item9').removeClass("row");
			$('#sku_item_9').text($sku9);
			$('#price_item_9').text('$' + $price9);
			$('#qty_item_9').val($quantity9);
			$('#total_item_9').text('$' + $total9);
			$('#formsku9').val($sku9);
			$('#formprice9').val($price9);
			$('#formquantity9').val($quantity9);
		} else {
			var $sku9 = $('#sku9').val();
			var $quantity9 = $('#9').val();
			var $price9 = $('#price9').val();
			var $total9 = $quantity9 *  $price9;
			$('#sku_item_9').text($sku9);
			$('#price_item_9').text('$' + $price9);
			$('#qty_item_9').val($quantity9);
			$('#total_item_9').text('$' + $total9);
			$('#formsku9').val($sku9);
			$('#formprice9').val($price9);
			$('#formquantity9').val($quantity9);
		}
	});
	$('#sub10').click(function(){
		if ( $('#item10').hasClass('row') ) {
			var $sku10 = $('#sku10').val();
			var $quantity10 = $('#10').val();
			var $price10 = $('#price10').val();
			var $total10 = $quantity10 *  $price10;
			$('#item10').removeClass("row");
			$('#sku_item_10').text($sku10);
			$('#price_item_10').text('$' + $price10);
			$('#qty_item_10').val($quantity10);
			$('#total_item_10').text('$' + $total10);
			$('#formsku10').val($sku10);
			$('#formprice10').val($price10);
			$('#formquantity10').val($quantity10);
		} else {
			var $sku10 = $('#sku10').val();
			var $quantity10 = $('#10').val();
			var $price10 = $('#price10').val();
			var $total10 = $quantity10 *  $price10;
			$('#sku_item_10').text($sku10);
			$('#price_item_10').text('$' + $price10);
			$('#qty_item_10').val($quantity10);
			$('#total_item_10').text('$' + $total10);
			$('#formsku10').val($sku10);
			$('#formprice10').val($price10);
			$('#formquantity10').val($quantity10);
		}
	});	

	

	$('.up-input').focus(function(){
		this.select();
	});
	$('#update').click(function(){
		var $nqty1 = $('#qty_item_1').val();
		var $price1 = $('#price1').val();
		var $tot1 = $price1 * $nqty1;
		$('#item1 .tot').text('$' + $tot1);
		$('#formquantity1').val($nqty1);
		
		var $nqty2 = $('#qty_item_2').val();
		var $price2 = $('#price2').val();
		var $tot2 = $price2 * $nqty2;
		$('#item2 .tot').text('$' + $tot2);
		$('#formquantity2').val($nqty2);
		
		var $nqty3 = $('#qty_item_3').val();
		var $price3 = $('#price3').val();
		var $tot3 = $price5 * $nqty3;
		$('#item3 .tot').text('$' + $tot3);
		$('#formquantity3').val($nqty3);
		
		var $nqty4 = $('#qty_item_4').val();
		var $price4 = $('#price4').val();
		var $tot4 = $price4 * $nqty4;
		$('#item4 .tot').text('$' + $tot4);
		$('#formquantity4').val($nqty4);
		
		var $nqty5 = $('#qty_item_5').val();
		var $price5 = $('#price5').val();
		var $tot5 = $price5 * $nqty5;
		$('#item5 .tot').text('$' + $tot5);
		$('#formquantity5').val($nqty5);
		
		var $nqty6 = $('#qty_item_6').val();
		var $price6 = $('#price6').val();
		var $tot6 = $price6 * $nqty6;
		$('#item6 .tot').text('$' + $tot6);
		$('#formquantity6').val($nqty6);
				
		var $nqty7 = $('#qty_item_7').val();
		var $price7 = $('#price7').val();
		var $tot7 = $price7 * $nqty7;
		$('#item7 .tot').text('$' + $tot7);
		$('#formquantity7').val($nqty7);
				
		var $nqty8 = $('#qty_item_8').val();
		var $price8 = $('#price8').val();
		var $tot8 = $price8 * $nqty8;
		$('#item8 .tot').text('$' + $tot8);
		$('#formquantity8').val($nqty8);
		
		var $nqty9 = $('#qty_item_9').val();
		var $price9 = $('#price9').val();
		var $tot9 = $price9 * $nqty9;
		$('#item9 .tot').text('$' + $tot9);
		$('#formquantity9').val($nqty9);
		
		var $nqty10 = $('#qty_item_10').val();
		var $price10 = $('#price10').val();
		var $tot10 = $price10 * $nqty10;
		$('#item10 .tot').text('$' + $tot10);
		$('#formquantity10').val($nqty10);
		
	});
});
