//GOOGLE MAP
function initGmap(longitude, latitude, zoomLevel) {    
	   
	var latlng = new google.maps.LatLng(longitude, latitude);    

	var myOptions = {      zoom: zoomLevel,      
						   center: latlng,      
						   mapTypeId: google.maps.MapTypeId.ROADMAP 
					};    
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	

	var marker = new google.maps.Marker({      
		position: latlng,      
		map: map     
	});
	
	google.maps.event.addListener(marker, 'click', function() {  
		infowindow.open(map,marker);
	});
}


$(document).ready(function() {
//homepage flash carousel
	$("#homepage_imageRotator #homepage_slider").jCarouselLite({
		btnNext: "#homepage_imageRotator .next",
		btnPrev: "#homepage_imageRotator .prev",
		visible: 1,
		auto: 3000,
	    speed: 400,
		scroll: 1
    });			   
//End homepage flash carousel
	

//product slider on brand page;
	$(".default .jCarouselLite").jCarouselLite({
		btnNext: ".default .next",
		btnPrev: ".default .prev",
		visible: 1,
		scroll: 1
	});
//End product slider on brand page;


    $(".site_search input").live("blur", function(){
            var default_value = $(this).attr("rel");
            if ($(this).val() == ""){
                    $(this).val(default_value);
            }

	
    }).live("focus", function(){
            var default_value = $(this).attr("rel");
            if ($(this).val() == default_value){
                    $(this).val("");
            }
    });
	
	
/* $(".Instructions input").live("blur", function(){
            var default_value = $(this).attr("rel");
            if ($(this).val() == ""){
                    $(this).val(default_value);
            }
    }).live("focus", function(){
            var default_value = $(this).attr("rel");
            if ($(this).val() == default_value){
                    $(this).val("");
            }
    });*/


    $(".blockcontent input").live("blur", function(){
            var default_value = $(this).attr("rel");
            if ($(this).val() == ""){
                    $(this).val(default_value);
            }

	
    }).live("focus", function(){
            var default_value = $(this).attr("rel");
            if ($(this).val() == default_value){
                    $(this).val("");
            }
    });
	
	
	
// Site Mailing List Input 	
	$('.sf_newsletterSubscriptionForm input[type="text"]').addClass("idle");
		$('.sf_newsletterSubscriptionForm input[type="text"]').focus(function() {
			$(this).removeClass("idle").addClass("active");
			if (this.value == this.defaultValue){ 
				this.value = '';
			}
			if(this.value != this.defaultValue){
				this.select();
			}
   });
			
	$('.sf_newsletterSubscriptionForm input[type="text"]').blur(function() {
		$(this).removeClass("active").addClass("idle");
		if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
// End Mailing List
	
	
	
// Start Show All Button for Site Sub Nav
 	$('.sidebar #sub-nav').each(function() {
    var ul = $('ul', this);
    if(ul.children('li').size() <= 17) return;

    var hiddenElements = ul.children('li:gt(17)', this).hide();

    var showCaption = ' Show All';
    ul.append(
        $('<div class="toggler">' + showCaption + '</div>')
            .toggle(
                function() { 
                    hiddenElements.show();
                    $(this).text('Show less ');
                }, 
                function() { 
                    hiddenElements.hide();
                    $(this).text(showCaption);
                }
            )
    );
});
// End Show All 
	
	
});




	






