/*===========uzzal===============*/
var intervalId, curBnr=0;

$(document).ready(function(){
	playBnr();
	
	$("ul.bannerTab li").click(
		function(){
			var index=$("ul.bannerTab li").index(this);
			if(curBnr!=index){
				curBnr=index;
				pauseBnr();
				changeBnr();
				playBnr();
			}
		}
	);
	
	if($('.userTab').length > 0){
		$('.userTab li a').click(
			function(){
				var index=$('.userTab li a').index(this);
				$('.userqueryMenu li').hide();
				$('.userqueryMenu li').eq(index).fadeIn();
				$('.userTab li').removeClass('selectedUserTab');
				$(this).parent().addClass('selectedUserTab');
			}
		);
	}
	
 });
 
	
function pauseBnr(){clearInterval(intervalId)}
function playBnr(){intervalId=setInterval('startBnrPlay()',4000)}
function startBnrPlay(){
	var allButnsLen=$('ul.bannerMenu li').length;
	if(curBnr==(allButnsLen-1))
		curBnr=0;
	else
		curBnr++;
	changeBnr();
}

function changeBnr(){
	$('.bannerMenu li').removeClass('curentTab').eq(curBnr).addClass('curentTab');
	if($.browser.msie && $.browser.version <=8)
		$('ul.bannerMenu li').hide().eq(curBnr).show();
	else
		$('ul.bannerMenu li').hide().eq(curBnr).fadeIn('slow');
}

$(document).ready(function(){
	
	$(".sidebox_00_in h5").click(
	
	function(){
			var index=$(".sidebox_00_in h5").index(this);
			$('ul.sideMenu').eq(index).slideToggle();
			
			}
	);

 });


var scrollOverflowHideChild, scrollID, overFlowWidth, curPos=0, eachBoxWidth;

$(document).ready(function(){
	//SCROLLING:
	eachBoxWidth = $('#scrollOverflowHide ul li:first').outerWidth()+15; // 17=="margin-right"
	scrollOverflowHideChild = eachBoxWidth * $('#scrollOverflowHide ul li').length;
	overFlowWidth = scrollOverflowHideChild - $('#scrollOverflowHide').width(); //alert(overFlowWidth);
	$('#scrollOverflowHide ul').css('width',scrollOverflowHideChild+'px');
	
	
	if(overFlowWidth > 0){
		//HOVER SCROLL:
		/*$('.left, .right').hover(
			function(){
				if($(this).is('.left')){
					scrollID=setInterval('scrollFeature(-1)',5);}
				else
					scrollID=setInterval('scrollFeature(+1)',5);
			},
			function(){clearInterval(scrollID)}
		);*/
		
		
		//CLICK SCROLL:
		var direction,tempCurPos;
		$('.leftscroller, .rightscroller').click(function(){
			//direction set:
			direction = $(this).is('.leftscroller')? -1 : +1;
			
			if(!( (curPos==0 && direction==1) || (curPos == -overFlowWidth && direction == -1) ))
				curPos+=(eachBoxWidth*direction);
			
			if(0 < curPos || curPos < -overFlowWidth)
				curPos = (0 < curPos)? 0 : -overFlowWidth+17;
			
			if(tempCurPos!=curPos)
				$('#scrollOverflowHide ul').animate({left: curPos},600);
			tempCurPos=curPos;
		});
	}
	
	
 });
/*if(0 < curPos || curPos < -diffBetwnScrollDivs){
		clearInterval(featureScrollID);
		curPos = (0 < curPos)? 0 : -diffBetwnScrollDivs;
	}
	else if(!( (curPos==0 && scrDirection==1) || (curPos == -diffBetwnScrollDivs && scrDirection == -1) )){
		curPos+=(scrollSpeed * scrDirection);
		jQuery('.scrollX').css('left', curPos+'px');
	}*/

/*function scrollFeature(direction){
	if(0 < curPos || curPos < -overFlowWidth){
		clearInterval(scrollID);
		if(0 < curPos) curPos=0; else curPos = -overFlowWidth;
	}
	else{
		curPos+=(4*direction);
		$('#scrollOverflowHide ul').css('left', curPos+'px');
	}
}*/




