



	
	hs.graphicsDir = '/js/highslide/graphics/';
	hs.wrapperClassName = 'highslide-no-border';
	hs.preserveContent = false;
	hs.align = "center";
	hs.dimmingOpacity = 0.85;
    hs.maxHeight = 605;
    hs.maxWidth = 720;
    

	
		// Add the controlbar
	if (hs.addSlideshow) hs.addSlideshow({
		slideshowGroup: 'group1',
			interval: 5000,
			repeat: false,
			useControls: true,
			fixedControls: false,
			overlayOptions: {
				opacity: 1,
				position: 'bottom center',
				hideOnMouseOut: true
			}
		});


	/**
	* Function to submit a HTML form into a Highslide iframe popup.
	*/
	function submitToHighslide(form) {
	
		var anchor;
		for (var i = 0; i < form.elements.length; i++) {
			if (form.elements[i].type == 'submit') {
				anchor = form.elements[i];
				break;
			}
		}
	
		hs.overrides.push('onAfterExpand');
		hs.wrapperClassName = 'draggable-header';
		hs.htmlExpand(anchor, {
			objectType: 'iframe',
			src: 'about:blank',
			width: 640,
			height: 430,
			objectHeight: 430,
			onAfterExpand: function(expander) {
				form.target = expander.iframe.name;
				form.submit();
			}
		});
	
		return false;
	}



	jQuery(document).ready(function() {
									
									
							jQuery(	'#carousel li a').live('mouseover',function()
																		  {
																			  
																			  $(this).find('.is_book').css('color','red');
																			  
																			 Cufon.refresh('.is_book');
																			 
																			// alert($(this).find('.logoImg').attr('mouseover'));
																			 $(this).find('.logoImg').attr("src", $(this).find('.logoImg').attr('mouseover'));

																			 // $(this).find('.logoImg').attr('mouseover');
																			//alert( $(this).find('.logoImg').scr);
																			 
																		  }).live('mouseout',function()
																		  {
																			 
																			 $(this).find('.is_book').css('color','#ccc');
																			  
																			  
																			   Cufon.refresh('.is_book');
																			   
																			   
																			    $(this).find('.logoImg').attr("src", $(this).find('.logoImg').attr('mouseout'));
																			 
																			 
																		  });
							
							
						
		
									
		
		
		
	Cufon.replace('.is_title', {
		fontFamily: 'CMedium'
	});
	Cufon.replace('.is_book', {
		fontFamily: 'Book',hover:{color:'#ff0000'}
	});
	Cufon.replace('.is_medium', {
		fontFamily: 'Medium'
	});
	Cufon.replace('.is_bold', {
		fontFamily: 'Bold'
	});
	Cufon.replace('.is_light', {
		fontFamily: 'Light'
	});
	
	
		
		
		function mycarousel_initCallback(carousel) {

		carousel.buttonNext.bind('click', function() {
			carousel.startAuto(0);
		});
	
		carousel.buttonPrev.bind('click', function() {
			carousel.startAuto(0);
		});
		
		
		carousel.clip.mouseover(function() {
			
			carousel.stopAuto();
	
			
		});
		
		carousel.clip.mouseout(function() {
			carousel.startAuto();
		});
				
									
								

		jQuery('#next-logo').bind('click', function() {
			carousel.next();
			return false;
		});
	
		jQuery('#prev-logo').bind('click', function() {
			carousel.prev();
			return false;
		});
		

	};
	
	

	
	function carousel_1_beforeAnimation(carousel,element,i,status){
    	var idx = carousel.index(i, carousel.options.size);
		carousel.add(i,carousel.get(idx).html());
		var isIE6 = (navigator.userAgent.toLowerCase().substr(25,6)=="msie 6") ? true : false;
		if(isIE6 == false){
		Cufon.refresh('.is_book');
		}
  	}
        	
	function carousel_1_afterAnimation(carousel,element,index,status){
	    var idx = carousel.index(index, carousel.options.size);
			carousel.selected=idx
			}
	
	function carousel_1_itemVisibleOutCallback(carousel, item, i, state, evt){
   	if (i>carousel.options.size || i<0){
    	carousel.remove(i);
    	}
  	carousel.startAuto();
	};
		
		
	    $("#carousel").jcarousel({
			scroll: 1,
			auto: 1,
			wrap: 'circular',
			initCallback: mycarousel_initCallback,
			// This tells jCarousel NOT to autobuild prev/next buttons
			buttonNextHTML: null,
			buttonPrevHTML: null,
        	itemVisibleInCallback: {
  					onBeforeAnimation: carousel_1_beforeAnimation,
  					onAfterAnimation: carousel_1_afterAnimation
						},
			itemVisibleOutCallback:carousel_1_itemVisibleOutCallback

			
		});

		

		
		//Jump To
		(function($){
		 $.fn.extend({
		 
			customStyle : function(options) {
			  if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
			  return this.each(function() {
			  
					var currentSelected = $(this).find(':selected');
					$(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">'+currentSelected.text()+'</span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
					var selectBoxSpan = $(this).next();
					var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right'));			
					var selectBoxSpanInner = selectBoxSpan.find(':first-child');
					selectBoxSpan.css({display:'inline-block'});
					selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'});
					var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'));
					$(this).height(selectBoxHeight).change(function(){
						selectBoxSpanInner.text($(this).val()).parent().addClass('changed');
					});
					
			  });
			  }
			}
		 });
		})(jQuery);
				
		//Auto Expand Footer
		function footerFiller() {							
			var pos = $("#footer").offset();
			var height = $("#footer").height();
			var windowheight = $(window).height();
			var filler = windowheight - pos.top ;
			if(windowheight>750){
				$("#footer").css( { "height":(filler) +"px" } );
			}
			
			if ($('#sub-navigation-container').length) {
				var container = $('#sub-navigation-container').offset();
				var sn_h = container.top + $('#sub-navigation-container').height() - $("#sub-navigation").height()-20;
				$("#sub-navigation").css( { "left": (container.left) + "px", "top":(sn_h) +"px" } );
			}
			
			if ($('#homepage-image-4').length) {
				var imagePos = $("#homepage-image-4 img").offset();
				var panelH = $("#homepage-panel").height();
				var topPos = imagePos.top + 331 - 53 - panelH;
				$("#homepage-panel").css( { "left": (imagePos.left +211 ) + "px", "top":(topPos) +"px" } );
				$("#homepage-arr").css( { "left": ($("#homepage-panel").width()-30) + "px", "top":($("#homepage-panel").height()-30) +"px" } );	
			}
			
		}
		
		
		
		footerFiller();
		
		$(window).bind('resize', function() {
		  footerFiller();							  
		});
		
		$("select").uniform();
		$(document).pngFix(); 
		
	});
