//jQuery(document).ready(function(){
// What is $(document).ready ? See: http://flowplayer.org/tools/using.html#document_ready
$(document).ready(function() {


// main vertical scroll
$("#main").scrollable({

	// basic settings
	vertical: true,
	size: 1,
	clickable: false,

	// up/down keys will always control this scrollable
	keyboard: 'static',

	// assign left/right keys to the actively viewed scrollable
	onSeek: function(event, i) {
		horizontal.scrollable(i).focus();
	}

// main navigator (thumbnail images)
}).navigator("#main_navi");

// horizontal scrollables. each one is circular and has its own navigator instance
var horizontal = $(".scrollable").scrollable({size: 1}).circular().navigator(".navi");


// when page loads setup keyboard focus on the first horzontal scrollable
horizontal.eq(0).scrollable().focus();


// shortfinder
$('#shortref input:text').val('Shortlink...').focus(function(){
	if($('#shortref input:text').val()=='Shortlink...')
		$('#shortref input:text').val('');
}).blur(function(){
	if($('#shortref input:text').val()=='')
		$('#shortref input:text').val('Shortlink...');
});

$('#shortref button').click(function(){
		var sid = $('#shortref input:text').val();
		if(parseInt(sid)>0) {
			$('#shortref').html('Sie werden weitergeleitet');
			document.location = 'index.php?id='+sid;
		}
	}
).html('<img src="fileadmin/layout/images/shortref.gif" />');

});


