function LoadControls(){
	var options = {};
	$("#ARLogo") .fadeOut(ShowControls()) .addClass("removed");
}

function ButtonMovement(buttonid){
	var options = {};
	$(buttonid).hide('explode', options, 500);
	$(buttonid).show('scale', options, 200);
}

function ShowControls(){
	var options = {};
	$("#LoginControls") .fadeIn()
}

$('script[src*=none.js]').remove();
$('link[src*=1500.css]').remove();

/*jQuery.noConflict();
	$(document).ready(function(){
	$("h2 span").each(function(){
	var me = jQuery(this);
	me.html( me.text().replace(/(^\w+)/,'<span class="firstword">$1</span>') );
	});
});
*/
/* CSS Browser Selector v0.3.5 (Feb 05, 2010) Rafael Lima (http://rafael.adm.br) http://rafael.adm.br/css_browser_selector License: http://creativecommons.org/licenses/by/2.5/Contributors: http://rafael.adm.br/css_browser_selector#contributors*/
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);

/* Quote Forms Begin */

$(document).ready(function() {

  if ($(".quotrr")[0]){ /* Quote Forms */
      $(".surveyor").hide();
      $(".locator .trigger a").click(function() {
        nextPage();
      });
      $('.locator input').keydown(function(event) {
        if (event.keyCode == 13){
			nextPage();
            var BNm = navigator.appName;
            if (BNm == "Netscape") {
                // prevent the default action of the Enter key
                if (event.which == 13) {
                    //e.preventDefault();
                    nextPage();
                    return false;
                }
            }
            else {
                if (event.keyCode == 13) {
                    //e.preventDefault();
                    nextPage();
                    return false;
                }
            }
			}
      });

    function nextPage(){
      if ($(".locator input").val().length == 0) {
          alert("Please type in your Zip Code now!");
        } else {
          $(".locator").fadeOut();
          $(".surveyor").fadeIn().css("position", "relative");
		  $(".quotrr .firstName input").focus();
      }
      if ($.trim($(".locator input").val()).length == 5) {
        $.getJSON('http://gomashup.com/json.php?fds=geo/usa/zipcode/' + $(".locator input").val() + '&jsoncallback=?', function(data) {
          $(".state select").val(data.result[0].State);
          $(".city input").val(data.result[0].City);
        })
      }
    }
  }


(function($) {
	/**
	* Resizes an inner element's font so that the inner element completely fills the outer element.
	* @author Russ Painter WebDesign@GeekyMonkey.com
	* @version 0.1
	* @param {Object} Options which are maxFontPixels (default=40), innerTag (default='span')
	* @return All outer elements processed
	* @example <div class='mybigdiv filltext'><span>My Text To Resize</span></div>
	*/
	$.fn.textfill = function(options) {
		var defaults = {
			maxFontPixels: 31,
			innerTag: 'h1'
		};
		var Opts = jQuery.extend(defaults, options);
		return this.each(function() {
			var fontSize = Opts.maxFontPixels;
			var ourText = $(Opts.innerTag + ':visible:first', this);
			var maxHeight = $(this).height();
			var maxWidth = $(this).width();
			var textHeight;
			var textWidth;
			do {
				ourText.css('font-size', fontSize);
				textHeight = ourText.height();
				textWidth = ourText.width();
				fontSize = fontSize - 1;
			} while ((textHeight > maxHeight || textWidth > maxWidth) && fontSize > 3);
		});
	};
})(jQuery);
});

$(document).ready(function() {
	$(".designation").textfill({ maxFontPixels: 31, innerTag: 'h1' });/* Works with above resize function*/
	$("body").addClass("bravo");
  });

/* Quote Forms End */