/* ================================================================ 
This copyright notice must be untouched at all times.
Copyright (c) 2008 Stu Nicholls - stunicholls.com - all rights reserved.
=================================================================== */
/* <![CDATA[ */
roller = function() {

jQuery.extend(jQuery.expr[':'], {
    Contains :
"jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
  }); 

total = $('#innerContainer li').length;
$totalImgs = $('#innerContainer li');
$totalPlaces = $('#innerContainer li a');

thumbHeight = 0;
for (x=0; x<total; x++) {
thumbHeight = thumbHeight + 27;
}

$('#innerContainer')	.css({height: thumbHeight + 'px'});



$('#slideUp')			.hover(function(e){
$('#innerContainer')	.stop();
posTop = -parseInt($('#innerContainer').css("top"))
speed = (posTop) * 4;
slideTop = thumbHeight - 185;
$('#innerContainer')	.animate({"top": "0px"}, speed)
},function(){
$('#innerContainer')	.stop();
});


$('#slideDown')			.hover(function(e){
posTop = parseInt($('#innerContainer').css("top"))
speed = (thumbHeight + posTop) * 4;
slideTop = thumbHeight - 185;
$('#innerContainer')		.stop();
$('#innerContainer')		.animate({"top": -slideTop + "px"}, speed)
},function(){
$('#innerContainer')		.stop();
});



var c = "";

$("#code").keypress(function (e) {
	if (e.which > 31 && e.which <123) {
		c = c + String.fromCharCode(e.which);
		c = c.toUpperCase();
		len=c.length;
		if (len == 1 && e.which > 96) {c = String.fromCharCode(e.which-32);}
$('#innerContainer')	.css("top", "0px")
$('#innerContainer li').hide();

$("#innerContainer li a").each(function(i) {
if ($(this).text().substring (0,len).toUpperCase() == c) {$(this).parent().show();}
});

}
});

$("input#code").keydown(function (e) {
if (e.which == 8) {
len = c.length-1;
c = c.substring(0,len);
$('#innerContainer')	.css("top", "0px")

$('#innerContainer li').hide();
$("#innerContainer li a").each(function(i) {
if ($(this).text().substring (0,len) == c) {$(this).parent().show();}
});
}
});

}



/* ]]> */



