
$(document).ready(function() {
    
	//---set  rightpanel height----
	var content_h = $('.pplcontent').height();
	$('.pplright').css('height', content_h +'px');
	
	$('.adpanel').css('bottom', '0px');
	
	$('input').keypress(function (e){
	    if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
			$('.searchbtn').click();
			return false;
		} 
		else {
			return true; 
		} 
	});	
	
    $('.searchbtn').mouseover(function(){
		$(this).css({'background-image': 'url(/portals/0/PEPL/ppl_images/go_ov.gif'});
	});
	$('.searchbtn').mouseout(function(){
		$(this).css({'background-image': 'url(/portals/0/PEPL/ppl_images/go.gif'});
	});
	
    $('.searchbtn').click(function() {
	    var code = $.trim($('.wscode').val()); 
		if (code.length == 0){
			alert('No search details were entered. Please try again.');
			return true;
		}
		else{
		    var path = window.location.toString();
			path = path.substr(0, path.lastIndexOf('.'));
			var gotoURL  = path +'/events_listing/cat/-1/vw/0/search/' + code +'/Default.aspx';				
		    window.location.href = gotoURL;
			return false;
		}		
    });				

var first = 0;
var speed = 100;
var pause = 5000;	

function removeFirst(){
  first = $('ul#listticker li:first').html();
  $('ul#listticker li:first')
  .animate({opacity: 0}, speed)
  .fadeOut('fast', function() {$(this).remove();});                        
  addLast(first);
}
		
function addLast(first){
  last = (first == null) ? '<li style="display:none">More conferences coming soon...</li>' : '<li style="display:none">'+first+'</li>';
  $('ul#listticker').append(last)
  $('ul#listticker li:last')			
  .show();
}

interval = setInterval(removeFirst, pause);

});

