/*===========Mostafizur Rahman===============*/
//set the animation speed default values:
var intervalId, intervalIdTV=0, curBnr_2=curBnr_tv=0;
var curBnr=3;
var featureScrollID, diffBetwnScrollDivs, featureDlWidth, scrollReverse=false, scrollSpeed=3;
var curPos=0, contactInt;

$(window).load(function(){
	
	if( $('.selectBox').length > 0 ) $('.selectBox').selectbox();
	$('.accrodaine h5').click(function() {
		
	  	$(this).next('.accrodaineInner').toggle();
		
		if($(this).next('.accrodaineInner').is(':hidden')){
			$(this).children().removeClass("activ");
		}
		else{$(this).children().addClass("activ");
		}
		
	});
	
	
	//client scroller
	 
	    //featureDlWidth=(parseInt(jQuery('.scrollX li:first').outerWidth())) *jQuery('.scrollX li').length;
		featureDlWidth=0;
		
		jQuery('.scrollX li').each(
			function(){
				featureDlWidth= featureDlWidth + jQuery(this).outerWidth();	
			}
		);
		
		
		diffBetwnScrollDivs=featureDlWidth-jQuery('.scrollInner').width();
		jQuery('.scrollX').css('width',featureDlWidth);
		if(diffBetwnScrollDivs > 0){
			diffBetwnScrollDivs -= diffBetwnScrollDivs % scrollSpeed;
			jQuery('a.controlBtnLeft, a.controlBtnRight').hover(
				function(){
					
					if(jQuery(this).is('a.controlBtnLeft')){
						var sign = scrollReverse? '-' : '+';
						featureScrollID=setInterval('scrollFeature('+sign+'1)', 5);
					}
					else{
						var sign = scrollReverse? '+' : '-';
						featureScrollID=setInterval('scrollFeature('+sign+'1)', 5);
					}
				},
				function(){clearInterval(featureScrollID)}
			);
		}
		
 });
 
 
	function scrollFeature(scrDirection){
	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');
	}
}

