
$(document).ready(function(){
	 $totalLength= $('.gall').length;
	$boxWidth = $('.gall').outerWidth();
	$gwidth = $totalLength*$boxWidth ;
	$('#gall_total').css({'width':$gwidth+'px'});

});
function clickShowSlide(slideNum){
	
	if(jQuery.browser.msie){
	tb_show("","#TB_inline?total_width=669&amp;total_height=580&amp;inlineId=scientist_lightbox&modal=true",null);
	}
	else{
		tb_show("","#TB_inline?height=560&amp;width=669&amp;&amp;total_width=669&amp;total_height=580&amp;inlineId=scientist_lightbox&modal=true",null);
		}
	if(slideNum==2){
		$('#next img').attr({'src':'triawebstore2/images/korea/global/next_arrow.gif'});
		$('#prev img').attr({'src':'triawebstore2/images/korea/global/prev_arrow.gif'});
	}
	if(slideNum==3){
		$('#next img').attr({'src':'triawebstore2/images/korea/global/next_arrow.gif'});
		$('#prev img').attr({'src':'triawebstore2/images/korea/global/prev_arrow.gif'});
	}
	if(slideNum==4){
		$('#next img').attr({'src':'triawebstore2/images/korea/global/next_arrow.gif'});
		$('#prev img').attr({'src':'triawebstore2/images/korea/global/prev_arrow.gif'});
	}
	if(slideNum==5){
		$('#next img').attr({'src':'triawebstore2/images/korea/global/next_arrow.gif'});
		$('#prev img').attr({'src':'triawebstore2/images/korea/global/prev_arrow.gif'});
	}
	if(slideNum==6){
		$('#next img').attr({'src':'triawebstore2/images/korea/global/next_arrow.gif'});
		$('#prev img').attr({'src':'triawebstore2/images/korea/global/prev_arrow.gif'});
	}
	if(slideNum==7){
		$('#next img').attr({'src':'triawebstore2/images/global/spacer.gif'});
		$('#prev img').attr({'src':'triawebstore2/images/korea/global/prev_arrow.gif'});
	}
	if(slideNum==1){
		$('#prev img').attr({'src':'triawebstore2/images/global/spacer.gif'});
		$('#next img').attr({'src':'triawebstore2/images/korea/global/next_arrow.gif'});
	}
	$totalLength= $('.gall').length;
	$boxWidth = $('.gall').outerWidth();
	$gwidth = $totalLength*$boxWidth ;
	$('#gall_total').css({'width':$gwidth+'px'});
	$('#gall_total').css({'margin-left':'-'+$boxWidth*(slideNum-1)+'px'});
	for(i=1;i<=$totalLength;++i){
		if(i==slideNum){
			$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/'+slideNum+'.png'});
		}
	}
	
}
function animateSlideLeft(){
	gtotal_width=$('#gall_total').css('margin-left');
	if(gtotal_width!='0px'){
		$("#gall_total").animate({marginLeft:'+='+$boxWidth+'px'},400);
	}
	//alert(gtotal_width);
	if(gtotal_width=='0px' || gtotal_width=='-0px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/1.png'});
		
		}
	if(gtotal_width=='-'+$boxWidth*1+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/1.png'});
		$('#prev img').attr({'src':'triawebstore2/images/global/spacer.gif'});
		
		}
	if(gtotal_width=='-'+$boxWidth*2+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/2.png'});
		}
	if(gtotal_width=='-'+$boxWidth*3+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/3.png'});
		}	
	if(gtotal_width=='-'+$boxWidth*4+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/4.png'});
		}
	if(gtotal_width=='-'+$boxWidth*5+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/5.png'});
		}
	if(gtotal_width=='-'+$boxWidth*6+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/6.png'});
		$('#next img').attr({'src':'triawebstore2/images/korea/global/next_arrow.gif'});
		}
	
}
function animateSlideRight(){
	gtotal_width=$('#gall_total').css('margin-left');
	$boxWidth = $('.gall').outerWidth();
	if(gtotal_width!=-($gwidth-$boxWidth)+'px'){
		$("#gall_total").animate({marginLeft:'-='+$boxWidth+'px'},400);
	}
	if(gtotal_width=='0px' || gtotal_width=='-0px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/2.png'});
		$('#prev img').attr({'src':'triawebstore2/images/korea/global/prev_arrow.gif'});
		}
	if(gtotal_width=='-'+$boxWidth*1+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/3.png'});
		}
	if(gtotal_width=='-'+$boxWidth*2+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/4.png'});
		}
	if(gtotal_width=='-'+$boxWidth*3+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/5.png'});
		}	
	if(gtotal_width=='-'+$boxWidth*4+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/6.png'});
		}
	if(gtotal_width=='-'+$boxWidth*5+'px'){
		//alert('x');
		$('#scientist_img img').attr({'src':'triawebstore2/images/korea/about/scientists/hopup/7.png'});
		$('#next img').attr({'src':'triawebstore2/images/global/spacer.gif'});
		}
	
	//alert(gtotal_width);
}

