var $j = jQuery.noConflict();

	// set all input.text default value according to alt attribute
    $j("#commentform input.text, #commentform textarea").each(function(){
        $j(this).val($j(this).attr("alt"));
    });
    // clear input.text on focus, if still in default
     $j("#commentform input.text, #commentform textarea").focus(function() {
 
     	if($j(this).val()==$j(this).attr("alt")) {
      		$j(this).val("");
       	}
     });
        // if field is empty afterward, add text again
     $j("#commentform input.text, #commentform textarea").blur(function() {
     	if($j(this).val()=="") {
        	$j(this).val($j(this).attr("alt"));
       	}
     });


$j(document).ready(function() {
	
	$j('span.know-launch').click(function() {
		$j('div.know').show();
	},function(){
		$j('div.know').hide();
	});
	
	$j('h1.twcen, h2.twcen, h3.twcen, a.twcen, ul#menu-primary li a, span.twcen').css({'visibility' : 'visible'})

	$j ( function global_scroll()  {
				
		$j('div.scrollable img').css({'display' : 'block'})
		$j('#scroller').removeClass('loading')
		$j('[title]').removeAttr('title');
		
		var scroller = $j("div.scrollable");
	
		
		if ( $j('#scroller div.items').children().size() > 1 ) {
			scroller.scrollable({speed : 10, circular: true}).navigator().autoscroll({ autoplay: true, interval: 4000 });
			api=scroller.scrollable({api:true});
			api.onBeforeSeek(function(){ jQuery("div.scrollable img").hide()}).onSeek(function(){ jQuery("div.scrollable img").fadeIn(400); });
		} else {
			scroller.scrollable({speed : 10, circular: false})
		};
			
	});
	
	$j( function menu_slide() {
		
		var ulactive = $j('ul.active')
			ulactive.data('ulHeight', ulactive.eq(0).height());
		var ulheight = ulactive.data('ulHeight');
			ulactive.css({'height' : '0px'}).animate({height : ulheight},{duration: 1200, easing: 'swing'})
		
	});

	$j ( function items_hover()  {
	
		var items = $j('div.items')
		var item = $j('div.item')
		
		item.hover(function() {
		var thisitem = $j(this)
		
			thisitem.removeClass('inactive')
			thisitem.parent().find('div.inactive').stop().animate({opacity : '0.3'})
			thisitem.find('div.overlay').stop().animate({bottom : '0'},800);
			
		},function(){
		var thisitem = $j(this)
		
			thisitem.addClass('inactive')
			thisitem.parent().find('div.inactive').stop().animate({opacity : '1'})
			thisitem.find('div.overlay').stop().animate({bottom : '-250'},800);
			
		});
	
	});
	
	$j ( function client_icons_hover()  {
	
		var icons_wrap = $j('ul.client-icons li')
		
		icons_wrap.hover(function() {
		var thisitem = $j(this)
			
			thisitem.css({'background-position-y' : '-60px'})
			
		},function(){
		var thisitem = $j(this)
			
			thisitem.css({'background-position-y' : '0px'})
			
		});
	
	});

	
});
