function ajaxicator(el,action){
    var obj = null;
      if(typeof el=='function')
          {
              obj = el;
          }
      else
          {
              obj = $(el);
          }
    
    if(action==null){


    obj.bt({
                               fill: 'rgba(255, 255, 102,0)',
                              strokeWidth:'0',
                              strokeStyle: '#740d0d',
                              shadow: false,
                            shadowOffsetX: 1,
                            shadowOffsetY: 1,
                            shadowBlur: 3,
                            shadowColor: 'rgba(0,0,0,.9)',
                            shadowOverlap: false,
                            noShadowOpts: {strokeStyle: '#B7B7B7', strokeWidth: 2},
                            positions: ['bottom', 'right'],
                              spikeLength: 0,
                              spikeGirth: 0,
                              padding: 2,
                              cornerRadius: 2,
                              cssStyles: {
                                fontFamily: '"lucida grande",tahoma,verdana,arial,sans-serif',
                                fontSize: '11px'},
                              trigger: 'none',
                              preShow: function(box){

                                  $(box).attr('id','errortip_'+$(el).attr('id'));
                              },
                              contentSelector: function(){

                                  return '<div class="ajaxicatorLoading"></div>';
                              },
                               hideTip: function(box, callback) {
                                $(box).fadeOut(500,function(){$(this).remove();});

                        },
                              width: 25
                            });

                            obj.btOn();
    } else {
       obj.btOff();
    }
}



function fireItUp(loggedIn)
{
         var page = getPage();

         if(page.match(/atomic/i)!=null) goAtomic();


         //get breadcrumb for product detail pages
         if($.cookie("crumb")!=undefined && $.cookie("crumb")!=null)
             {
                 var crumb = $.cookie("crumb");
                 $(".cookieText").html(crumb);
             }


         $('.label_over :input').bind('click focus',function(){
             
            $(this).parent('li').find('label').hide();
         }).bind('blur',function(){
              if($(this).val()=='') $(this).parent('li').find('label').show();
         });

         $(".label_over label").click(function(){
            $(this).hide();
            var id = $(this).parent('li').find('input').attr('id');
            document.getElementById(id).focus();
         });

           prepDialog(); //prepares the main dialog box for use if needed

           if ($.browser.msie) //fixes render error on review page...
               {
                   $("#btn_apply").html('<img src="/resources/images/2009/btn_apply.gif" />');
               }

               
          
          if(page.match(/clubSelection\.do/)==null && page.match(/viewAddressBook\.do/)==null && page.match(/viewCreditCards\.do/)==null) runValidate();
          resetCatalog();
          if(page.match(/checkout/i) ==null) {viewCartModal();}
        
          startSeasonal(); //loads overlay for seasonal products if needed

          if($("#bd").attr('class').match(/checkout_creditcard/)!=null) L_add_payment();
          if($("#bd").attr('class').match(/myaccount_creditcard/)!=null){
              $(".disabled").removeClass('disabled');
          }
          if(page.match(/guestCheckout\.do/)!=null || $("#bd").attr('class').match(/guest_checkout/i)!=null) guestCheckout();
          if(page.match(/clubSelection\.do/)!=null) clubReady();
          if(page.match(/addedtocart/i)!=null) checkAddedtoCart();
          if(page.match(/catalog/)!=null) startCatalog();
          if(page.match(/updatepassword/i)!=null) L_update_password();
          if(page.match(/buycertificate/i)!=null){
              L_ecert();
                $("form").submit(function(){
                   return orderProcessing();
                });
          }

          if(page.match(/finalConfirmPaypa/i)!=null || $("#bd").attr('class').match(/review_order/)!=null){
            handle_gifts();
            $("form").submit(function(){
               return orderProcessing();
            });

          }

          if($(".product_upsell").html()!=null)
              {

                  if(ischecked)
                      {
                          $(this).after(upsellData);
                            $("#upsell_name").text(product.productName);
                            $("#upsell_price").text('$'+product.price);

                            var newTotal = parseFloat(product.price) + parseFloat($("#orderTotal").text());
                            var olt = $(".orderLineTotal").text();
                            olt = olt.substr(1,olt.length-1);

                            var newOrderline = parseFloat(product.price) + parseFloat(olt);

                            $("#d_upsell").show();
                            $("#orderTotal").text(formatCurrency(newTotal));
                            $(".orderLineTotal").text('$'+formatCurrency(newOrderline));
                      }

                  $("#c_upsell").click(function(){


                        if($(this).is(':checked'))
                        {
                                $(this).after(upsellData);
                                $("#upsell_name").text(product.productName);
                                $("#upsell_price").text('$'+product.price);

                                var newTotal = parseFloat(product.price) + parseFloat($("#orderTotal").text());
                                var olt = $(".orderLineTotal").text();
                                olt = olt.substr(1,olt.length-1);
                               
                                var newOrderline = parseFloat(product.price) + parseFloat(olt);

                                $("#d_upsell").show();
                                $("#orderTotal").text(formatCurrency(newTotal));
                                $(".orderLineTotal").text('$'+formatCurrency(newOrderline));
                                ischecked = true;

                        }
                        else if(ischecked)
                        {
                                $("#c_upsell_data").remove();
                                $("#d_upsell").hide();
                                var newTotal = parseFloat($("#orderTotal").text()) - parseFloat(product.price);
                                var olt = $(".orderLineTotal").text();
                                olt = olt.substr(1,olt.length-1);

                                 var newOrderline = parseFloat(olt) - parseFloat(product.price);
                                $("#orderTotal").text(formatCurrency(newTotal));
                                $(".orderLineTotal").text('$'+formatCurrency(newOrderline));
                        }
                 });

              }

          if($("#bd").attr('class').match(/checkout_thank_you/)!=null)delete_gift_cookies();
/*
          if(page.match(/processconnclub/i)!=null || $("#form_onepage").html()!=null)
          {
              var ischecked= false;
             $("#c_upsell").click(function(){


                    if($(this).is(':checked'))
                    {
                            $(this).after(upsellData);
                            $("#upsell_name").text(product.productName);
                            $("#upsell_price").text(product.price);

                            var newTotal = parseFloat(product.price) + parseFloat($("#orderTotal").text());

                            $("#d_upsell").show();
                            $("#orderTotal").text(formatCurrency(newTotal));

                            ischecked = true;

                    }
                    else if(ischecked)
                    {
                            $("#c_upsell_data").remove();
                            $("#d_upsell").hide();
                            var newTotal = parseFloat($("#orderTotal").text()) - parseFloat(product.price);
                            $("#orderTotal").text(formatCurrency(newTotal));
                    }
             });

          }
*/
          if(page.match(/account_management/)!=null){
               $('.col-cf a').flyout({loadingSrc:'/resources/images/2009/loading_small.gif',
                outEase:'easeOutCirc',
 		inEase:'easeInCirc'});
          }

          if(page.match(/homedelivery/)!=null && $("#default").html()!=null){
              $("#default").click(function(){
                        for(i=1;i<=4;i++)
                        {
                                $("#CoffeeSelection"+i).val(d[i]);
                                var nextRow = $("#CoffeeSelection"+i).parents('tr').next();
                                if(nextRow.attr('class') == 'altName') nextRow.remove();
                                $("input.altSelection").val("");
                        }
                        return false;
                });

          }

          if(page.match(/localnews/)!=null){
               var alt = 0;


          

           runLabelOver();

           $("#spot_right .btn").click(function(){
              var p = {};
              var error = 0;
              var $this = this;
              $(this).parents('div.spot').find("input").removeClass('invalid');

              $(this).parents('div.spot').find("input").each(function(){

                  var valid = $.fn.validateHelper(this,{rules:$(this).attr('req')});
                  var key = $(this).attr('name');
                  var value = $(this).val();
                  p[key] = value;
                  if(!valid)
                  {
                      error++;
                     var err = $(this).attr('err');
                      $(this).parents('li').append('<div class="omnierror" err="'+err+'">x</div>')
                       makeErrorOmnitip($(this).parents('li').find('div.omnierror'), 'err');
                      $(this).addClass('invalid');

                  }
              });

              if(error==0)
              {
                      //submit the form
                      var url = getDomain();
                       $("#spot_right .alert").remove();

                   $.ajax({
                        url: url+'enterContestAjaxAction.do',
                        data:p,
                        type:'GET',
                        dataType: 'jsonp',
                        success: function (data, textStatus) {
                            if(data.success == false)
                            {
                                jQuery.noticeAdd({text:'Your entry has not been submitted:<br /><b>' + data.error+'</b>'});

			       	 	 $("#spot_right")
                                        .css("background-color", "#000")
                                        .animate({height:300+"px", width: 0+"px", marginLeft: 159+"px"},140,function(){
                                            $("#spot_right").addClass('banner').html('<a href="http://www.bocajava.com/showProductDetail.do?productId=7473&catalogId=1"></a>')
                                        .animate({height:300+"px", width: 317+"px", marginLeft: 0+"px"},240)
                                        });

                             //   $("#spot_right").prepend('<div class="alert">'+data.error+'</div>');
                            }
                            else
                            {
                                jQuery.noticeAdd({text:'<b>Your contest entry has been submitted successfully!</b>'});

			       	 	 $("#spot_right")
                                        .css("background-color", "#000")
                                        .animate({height:300+"px", width: 0+"px", marginLeft: 159+"px"},140,function(){
                                            $("#spot_right").addClass('banner').html('<a href="http://www.bocajava.com/showProductDetail.do?productId=7473&catalogId=1"></a>')
                                        .animate({height:300+"px", width: 317+"px", marginLeft: 0+"px"},240)
                                        });


                            }
                        },
                        error: function(XMLHttpRequest, textStatus, errorThrown){
                           // debug(errorThrown);

                            $("#spot_right").prepend('<div class="alert">Your submission was unsuccessful. Please try again.</div>');
                        },
                        beforeSend: function (XMLHttpRequest) {
                             $("#spot_right").append('<div class="loading" style="position:absolute;z-index:5;top:230px;left:210px;color:#fff;">Sending...</div>');
                        },
                        complete: function (XMLHttpRequest) {
                             $("#spot_right .loading").remove();
                        }
                    });
              }
              return false;
           }); 
          }

          if(page.match(/viewCreditCards/i)!=null)   runInPlace('wallet');
          if(page.match(/viewAddressBook/i)!=null)   runInPlace('shipto');

          if(js_insider) addNotice('Welcome Boca Java Insider - <a href="http://catalog.bocajava.com/coffee/coffee/" class="color2">start shopping now</a>!');
          if(page.match(/insider/i)!=null){
              $("#f_referredBy").change(function(){
                  var value = $(this).val();
                  if(value.match(/bj/)==null) $(this).parents('li').next().show();
                  else $(this).parents('li').next().hide();
               });

          }

          if(page.match(/referralhistory/i)!=null){
              $("#raf_history table")
                .tablesorter({widthFixed: true, widgets: ['zebra']})
                .tablesorterPager({container: $("#pager")});
          }


          if(page.match(/viewcart/i)!=null)
          {
              $("a.save").inputUpdater({
               errorMessage:'',
               submitPath:'addCartToClubAjaxAction.do',
               loadingImagePath:'/bocajava/images/2009/loading_small.gif',
               errorImagePath:'/bocajava/images/2009/indicator_error.gif',
               successImagePath:'/bocajava/images/2009/indicator_success.gif',
               actionType:'insert_update',
               parent: 'tr',
               submitCallback: function(el,parent,options){

                    var pName = parent.children('td.td_item').children('span.c_productName').children('a').html();
                    addNotice('You have moved '+pName+' to your club selections.');

                    var q = parent.children('input.checkIn').val();
                    var price = parent.children('td.td_price').children('span').html();
                    price = price.substring(1);
                    price = parseFloat(price);


                    var ot = $('#cs_ot').html();
                    ot = ot.substring(1);
                    ot = parseFloat(ot);

                    var nt = '$' + formatCurrency(ot-price);
                    $('#cs_ot').html(nt).effect("highlight",{},2000);
                    $(parent).fadeOut(500,function(){$(this).remove();});

               }
           });
          }

          if(page.match(/writereview/i)!=null){
              $("#submitReviewIframe").load(function(){
              $('html').animate({scrollTop:0}, 'medium');
                });

          }

          if(page.match(/checkoutViewAddressBook/i)!=null){
              /* new datepicker */
             var jDateA = new Array();
                for(bo=0;bo< javaDates.length;bo++)
                {
                    var jDate = Date.parseIso8601(javaDates[bo]) + '';
                    jDateA.push(jDate);
                }


                 $("#shipDate_0").datepicker({blackoutDates:jDateA,minDate: '+3d', maxDate: '+24w', altField: '#dp_alt', altFormat: 'DD, MM d, yy',onSelect:function(){
                   // setAlternateDate();
                 }});


                 $("#shipDate_0").mask('99/99/9999').keyup(function(){
                            //need to put functionality in here for customer service
                            if($(this).val().match(/^(((((((0?[13578])|(1[02]))[\.\-/]?((0?[1-9])|([12]\d)|(3[01])))|(((0?[469])|(11))[\.\-/]?((0?[1-9])|([12]\d)|(30)))|((0?2)[\.\-/]?((0?[1-9])|(1\d)|(2[0-8]))))[\.\-/]?(((19)|(20))?([\d][\d]))))|((0?2)[\.\-/]?(29)[\.\-/]?(((19)|(20))?(([02468][048])|([13579][26])))))$/)!=null)  {
                             //  var Date = new Date();

                               var altText = Date.parse($(this).val()).toString("dddd, MMMM dd, yyyy");

                               $("#dp_alt").val(altText);
                               setAlternateDate();
                            }
                 });
          }

          if(page.match(/worldtours_billing/)!=null) {
              L_tour();
              
              if(loggedIn) login.ajaxShippingBilling();
              else{
                  $("f_emailconfirm").removeClass('disabled');
                  runValidate();
              }

          }

          if(page.match(/ProcessConnClubOnePageOfferV1/)!=null || $("#form_onepage").html()!=null)
              {
                  var loggedIn = $("#bd").attr('rel');
                  if($("#form_onepage").html()==null) var loggedIn = false;
                  login.set('club',true);
                  L_promo();
                  if(loggedIn == 'true' || loggedIn == true) login.ajaxShippingBilling();
                  else{
                      $("f_emailconfirm").removeClass('disabled');
                      runValidate();
                  }
              }

          if(page.match(/homedelivery/)){
              
              var cf = new bj_coffeefinder({
		    tag: '#needhelp',
                    linked: false
				});
                                cf.run();
          }

          if($("#print_label").html()!=null) labelWriter();  //writes preview of label

          if($.cookie('sli_breadcrumb')!=null) $(".cookieText").html($.cookie('sli_breadcrumb'));


             if($.cookie('sli_breadcrumb')!=null)
           {
            var c = $.cookie('sli_breadcrumb');
            c_s = c.split('</a> ');
            var c_l = c_s[c_s.length - 1];
            var continueshopping = c_l.replace(/>.*</gi,'class="gbtn sm mr1"><span><span>continue shopping</span></span><');

           }
           else var continueshopping = '<a href="http://catalog.bocajava.com/coffee/coffee"class="gbtn sm left mr1"><span><span>continue shopping</span></span></a>';

           if($("#checkoutButtons").html()!=null) $("#checkoutButtons").prepend(continueshopping);



            $('.error').each(function(){
               if($(this).html()==null) $(this).hide();
            });

             $("#form_search").submit(function(){
                     var selected = $("#f_searchtype").val();
                     var term = $("#f_searchword").val();
                     term = term.replace(/'/,'--')
                     term =  urlencode(term);

                     var d = getDomain();
                     if(selected == 'products')
                     {
                        if(d.match(/localhost/)!=null) d='http://catalog:8888/';
                        else if(d.match(/qa/)!=null) d = 'http://qa-catalog.bocajava.com/';
                        else d='http://catalog.bocajava.com/';
                        $(this).attr('action',d+'catalog/search/'+term);

                     }
                     else
                     {
                        $("#f_searchword").attr('name','s');
                        $(this).attr('method','get');
                        $(this).attr('action','/about-us/?');
                     }
                     return true;
                });

         

           // doOverlays();

	
		analyticsTrackEvents();

                if (!($.browser.msie && parseInt($.browser.version)<=6))
                {
    
                    topnavLogin();
                }


		
		 $("div.sale").pngfix();
		 $("div.new_product").pngfix();
         $(".pngfix").pngfix();



        makeBasicOmnitip('.help','alt');
        makeBasicOmnitip('a.cataloglink','title');
         makeBasicOmnitip("span.c_active",'title');
		 makeBasicOmnitip(".tip_link",'title');
		 makeBasicOmnitip(".show_cvv",'title');
		makeBasicOmnitip(".indicator_arrow",'title');
		 makeBasicOmnitip("a.gift_message",'title');
        makeTooltipSecondary(".tip_s");


       $('.ttNotify').bt({
                               fill: '#efefef',
                              strokeStyle: '#666666',
                              shadow: true,
                            shadowOffsetX: 1,
                            shadowOffsetY: 1,
                            shadowBlur: 3,
                            shadowColor: 'rgba(0,0,0,.9)',
                            shadowOverlap: false,
                            noShadowOpts: {strokeStyle: '#666666', strokeWidth: 1},
                            positions: ['top', 'left'],
                            width:300,
                              spikeLength: 10,
                              spikeGirth: 10,
                              padding: 8,
                              cornerRadius: 2,
                              cssStyles: {
                                fontFamily: '"lucida grande",tahoma,verdana,arial,sans-serif',
                                fontSize: '11px'},
                              trigger: 'hover'
       });








    $("#upsellAdd").click(function(){
       var label = $("#c_upsell").val();
       var id = $("#c_productID").val();
       pageTracker._trackEvent('Buttons', 'Discretionary Upsell', label);
       return true;
    });




	enable_faq();



	
	addressBookMayhem();


	//open a smart modal window
        /*
	$("a.modal").modal({resize:false});
        $("a.modal_login").modal(
        {resize:false,
            onOpen:function(el){
              login.run(el);
            }
        });

        $("#stt_letters a").modal(
        {resize:false,
            onOpen:function(el){
              $("#modal_content iframe").attr('src',$(el).attr('href'));
              return false;
            }
        });
*/
	//capture anchor clicks
	$("a").click(function(){
		var c = $(this).attr('class');

		if($(this).attr('title').match(/Homepage\//)!=null)
		{
			//omnitureCaptureEvent(this, '',$(this).attr('title'));
			pageTracker._trackPageview($(this).attr('title'));
		}




	});


	if($("div.error").html()!='')
	{
		$("div.error").addClass('error_active');
	}


        /* validate email submit */

        runValidate('#ff_email', true);
        if(page.match(/viewContacts/)!=null) runValidate('#f_email', true);
}

function getPage() //gets the current page url in order to determine which functions to run
{
    var href = document.location.href;
    return href;
}



function runValidate(fields, massValidate)
{
   

  if(massValidate==null || massValidate==undefined) massValidate = false;
  var ttFunction = true;
  var eDisplay = 'tooltip';
  var p = getPage();
 // if(p.match(/checkout/i)!=null && jQuery.support.leadingWhitespace==false) eDisplay = 'inline';
  //else ttFunction = true;

  if(fields==null || fields == '') fields = ':input';




       $(fields).autoValidate({
           massValidate: massValidate,
           errorDisplay: eDisplay,
           successMessage: '<img src="/resources/images/2009/indicator_success.gif" />',
           tooltipFunction: function(el,parent,msg){

               if(ttFunction){
               
                $(el).bt({
                               fill: '#ffe2e2',
                              strokeStyle: '#740d0d',
                              shadow: true,
                            shadowOffsetX: 1,
                            shadowOffsetY: 1,
                            shadowBlur: 3,
                            shadowColor: 'rgba(0,0,0,.9)',
                            shadowOverlap: false,
                            noShadowOpts: {strokeStyle: '#B7B7B7', strokeWidth: 2},
                            positions: ['right', 'top'],
                              spikeLength: 10,
                              spikeGirth: 10,
                              padding: 8,
                              cornerRadius: 2,
                              cssStyles: {
                                fontFamily: '"lucida grande",tahoma,verdana,arial,sans-serif',
                                fontSize: '11px'},
                              trigger: 'click',
                              preShow: function(box){
                                 
                                  $(box).attr('id','errortip_'+$(el).attr('id'));
                              },
                              contentSelector: function(){
                                 
                                  return '<div class="tooltip-error-content">'+msg+'</div>';
                              },
                               hideTip: function(box, callback) {
                        $(box).remove();

                        },
                              width: 200
                            });
                           
                            $(el).btOn();
               }
           },
           onClear: function(el){
             if(ttFunction) {
                 if($(el).attr('class').match(/bt-active/)) {
                     $(el).btOff();
                 }
             }
           },
           onSubmit: function(el,errors)
           {
               if(errors == 0)
               {
                 if($("#bd").attr('class').match(/submit/)!=null) orderProcessing();
                 return true;
               }
               else return false;
           }
       });


      // $("#login_div").autoValidate({successMessage: '<img src="/resources/images/2009/indicator_success.gif" />'});

}




function getParameters()
{
    var urlparams = {};
    var page = getPage();
    var pageS = page.split('?');
    var keyVals = pageS[1].split('&')
    for(i=0;i<keyVals.length;i++)
    {
        var keyVal = keyVals[i].split('=');
        var key = keyVal[0];
        var value= keyVal[1];
       
        if(value!=null) urlparams[key] = value;
       
    }
   
    return urlparams;
}

function checkAddedtoCart()
{

      var params = getParameters();
      var productName='';
      if(params['addedToCartProduct']!=null) {
            productName = $('.id_'+params['addedToCartProduct']).html();
             

            if($.cookie('sli_breadcrumb')!=null)
           {
            var c = $.cookie('sli_breadcrumb');
            c_s = c.split('</a> ');
            var c_l = c_s[c_s.length - 1];
            var continueshopping = c_l.replace(/>\w*</gi,' class="color3">continue shopping<');

           }
           else var continueshopping = '<a style="color: #ffffff; text-decoration: none;" class="color3" href="checkout.do">CHECKOUT</a>';


         var d = getDomain()+'viewCart.do';
         addNotice('YOU HAVE ADDED<BR> <b>'+productName+'</b><BR><BR>'+continueshopping+' &nbsp | &nbsp <a style="color: #ffffff; text-decoration: none;" href="'+d+'" class="color3">VIEW CART</a>');
      }
}

 function popUp(url) {
		popupWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,width=570,height=450');
		self.name = "mainWin";
	}


 function urlencode (str) {
    // http://kevin.vanzonneveld.net
    // +   original by: Philip Peterson
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: AJ
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: travc
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Lars Fischer
    // +      input by: Ratheous
    // +      reimplemented by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Joris
    // +      reimplemented by: Brett Zamir (http://brett-zamir.me)
    // %          note 1: This reflects PHP 5.3/6.0+ behavior
    // %        note 2: Please be aware that this function expects to encode into UTF-8 encoded strings, as found on
    // %        note 2: pages served as UTF-8
    // *     example 1: urlencode('Kevin van Zonneveld!');
    // *     returns 1: 'Kevin+van+Zonneveld%21'
    // *     example 2: urlencode('http://kevin.vanzonneveld.net/');
    // *     returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F'
    // *     example 3: urlencode('http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a');
    // *     returns 3: 'http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a'

    str = (str+'').toString();

    // Tilde should be allowed unescaped in future versions of PHP (as reflected below), but if you want to reflect current
    // PHP behavior, you would need to add ".replace(/~/g, '%7E');" to the following.
    return encodeURIComponent(str).replace(/\'/,'%27').replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').
                                                                    replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
}

function goAtomic(){
    $("#tabs").tabs({ fx: { opacity: 'toggle'},
        show:function(event,ui){
            var name = $(ui.panel).attr('id');

            var mask = document.getElementById(name+'-mask');
            var content = document.getElementById(name+'-content');
            var scroll = name+"-bar";
            
            

            new Dragdealer(scroll,
            {
                    horizontal: true,
                    vertical: false,
                    xPrecision: content.offsetWidth,
                    animationCallback: function(x, y)
                    {
                        
                            var margin = x * (parseInt($(content).css('width')) - parseInt($(mask).css('width')));
                           
                            $(content).css('marginLeft',-margin+'px');
                           // content.style.marginLeft = String(-margin) + 'px';
                    }
            });
        
    }
});



}


window['fireItUp'] = fireItUp;
