var imgInt = 0;
var imgCount = 0;
var imgCur = 0;
//Timer scripts
dropImgTimers = function(){
	clearTimeout(imgInt);
}
initateImgTimer = function(){
	if(imgCount != 0) {
		imgInt = setTimeout(imgSwitch,4000);
	}
}

imgSwitch = function(){
	dropImgTimers();
	$('#ir-'+imgCur).animate({
		opacity: 'toggle'
	}, 500, function() {
	});
	imgCur++;
	if(imgCur > imgCount){
		imgCur =1;
	}
	$('#ir-'+imgCur).animate({
		opacity: 'toggle'
	}, 500, function() {
		initateImgTimer();
	});
}

dropme = function(){
	$('#searchtextbox').hide();
	$('#searchimage').show();
}
$(document).ready(function() {
	$('#searchtextbox').hide();
	$('#searchimage').click(function() {
		$('#searchtextbox').show();
		$('#searchimage').hide();
		$('#s').focus();
	});
	
	//masthead for pages
	if($('#imgrotatepanel').size() > 0){
		$('.imgrotate').hide();
		$('#ir-1').show();
		imgCur = 1;
		imgCount = $('.imgrotate').size();
		if(imgCount > 1) {
			initateImgTimer();
		}
	}
});
