if(!window.console){window.console={log:function(){}};}function NFAL_slideScroll(obj){$(obj["id"]).each(function(){var id=this;var now=obj["now"];var marginAdjust=obj["marginAdjust"];var heightAdjust=obj["heightAdjust"];var loop=obj["loop"];var null_tag=obj["null_tag"];var debug=obj["debug"];if(loop !=false){loop=true;}var open_target_id=obj["open_target_id"];var open_target_first_id=obj["open_target_first_id"];var open_target_txt_id=obj["open_target_txt_id"];if(marginAdjust=="auto"){marginAdjust=$('.scroll_Show .scroll_Wrap>*',id).css("margin-right");marginAdjust=marginAdjust.replace("px","");marginAdjust *=1;}else if(!isFinite(marginAdjust)){marginAdjust=0;}$('.scroll_Show .scroll_Wrap>*',id).css('display','block');$('.scroll_Show .scroll_Wrap',id).css('position','absolute');heightCHK();function heightCHK(){var _height=new Array();var _i=0;$('.scroll_Show .scroll_Wrap>*',id).each(function(){_height[_i]=$(this).outerHeight();_i++;});_height.sort(function(a,b){return a - b;});_height.reverse();$('.scroll_Show',id).css('height',_height[0]+'px');}if(heightAdjust !=null){setInterval(heightCHK,5000);}$('.scroll_Show',id).css('overflow','hidden');var w1=$('.scroll_Show',id).width()+marginAdjust;var w2=0;var ele_num=0;$('.scroll_Show .scroll_Wrap>*',id).each(function(){w2+=$(this).outerWidth({margin:true});ele_num++;});var w3=w2/ele_num;var pages=Math.ceil(w2/w1);if(now<1){now=1;}else if(now>pages){now=pages;}var FLG_btn=true;var once_num=Math.floor(w1/w3);if(ele_num<=once_num){loop=false;}if(ele_num<pages*once_num){var append=pages*once_num - ele_num;for(var i=0;i<append;i++){$('.scroll_Show .scroll_Wrap>*:last',id).after(null_tag);ele_num++;}}$('.scroll_Show .scroll_Wrap',id).css("width",w1*pages+"px");$('.arrow_r img',id).click(function(){if(FLG_btn){if(now<pages||loop==true){FLG_btn=false;now++;_move();}}});$('.arrow_l img',id).click(function(){if(FLG_btn){if(now>1||loop==true){FLG_btn=false;now--;_move();}}});_btnCheck();function _btnCheck(){if(loop==false){if(now==1 ){$('.arrow_l img',id).fadeOut("slow");}else{$('.arrow_l img',id).fadeIn("slow");}if(now==pages){$('.arrow_r img',id).fadeOut("slow");}else{$('.arrow_r img',id).fadeIn("slow");}}else{$('.arrow_l img',id).fadeIn("slow");$('.arrow_r img',id).fadeIn("slow");}}_move('defo');function _move(sp){var ww=(now-1)*w1*-1;if(sp=='defo'){$('.scroll_Show .scroll_Wrap',id).css({"left":ww+"px"});}else{if(loop==false){$('.scroll_Show .scroll_Wrap',id).animate({"left":ww+"px"},"1000",function(){FLG_btn=true;});}else if(now<1){ww=(now)*w1*-1;var www=(now+1)*w1*-1;$target=$('.scroll_Show .scroll_Wrap>*:first',id);$('.scroll_Show .scroll_Wrap>*:gt('+(ele_num - once_num-1)+')',id).insertBefore($target);$('.scroll_Show .scroll_Wrap',id).css({"left":www+"px"});$('.scroll_Show .scroll_Wrap',id).animate({"left":ww+"px"},"1000",function(){FLG_btn=true;});now++;}else if(now==pages){var www=(now-2)*w1*-1;$('.scroll_Show .scroll_Wrap',id).animate({"left":ww+"px"},"1000",function(){$target=$('.scroll_Show .scroll_Wrap>*:last',id);$('.scroll_Show .scroll_Wrap>*:lt('+(once_num)+')',id).insertAfter($target);$('.scroll_Show .scroll_Wrap',id).css({"left":www+"px"});FLG_btn=true;});now--;}else if(now>pages){ww=(now-2)*w1*-1;var www=(now-3)*w1*-1;$target=$('.scroll_Show .scroll_Wrap>*:last',id);$('.scroll_Show .scroll_Wrap>*:lt('+(once_num)+')',id).insertAfter($target);$('.scroll_Show .scroll_Wrap',id).css({"left":www+"px"});$('.scroll_Show .scroll_Wrap',id).animate({"left":ww+"px"},"1000",function(){FLG_btn=true;});now--;}else{$('.scroll_Show .scroll_Wrap',id).animate({"left":ww+"px"},"1000",function(){FLG_btn=true;});}}if(debug !=""){$(debug).html("ID:"+id+"/w1:"+w1+"/w2:"+w2+"/now:"+now+"/pages:"+pages+"/ele_num:"+ele_num+"/once_num:"+once_num);}_btnCheck();}if(open_target_id !=null){var btn='.scroll_Show .scroll_Wrap>*. a';var sc=[];sc.now='';sc.max=$(btn,id).size();sc.left=sc.now;sc.right=$(btn,id).eq(sc.max-1).attr('href');sc.objct=[];sc.link='';sc.first=true;var _i=0;$(btn,id).each(function(){sc.objct[_i]=$(this).attr('href');_i++;});function _numRe(slcthref){for(var __i in sc.objct){if(slcthref==sc.objct[__i]){return __i;}}}function _arrowCHK(){if(sc.now==sc.left ){$('.arrow_l img',open_target_id).fadeOut("slow");}else{$('.arrow_l img',open_target_id).fadeIn("slow");}if(sc.now==sc.right){$('.arrow_r img',open_target_id).fadeOut("slow");}else{$('.arrow_r img',open_target_id).fadeIn("slow");}}_arrowCHK();$('.arrow_r',open_target_id).click(function(){if(sc.now !=sc.right){$(btn,id).eq(_numRe(sc.now)*1+1).click();}});$('.arrow_l',open_target_id).click(function(){if(sc.now !=sc.left){$(btn,id).eq(_numRe(sc.now)-1).click();}});$(btn,id).click(function(){sc.link=$(this).attr('href');sc.btn=$(this);if(sc.now !=sc.link||sc.first){sc.first=false;$('li a img',id).fadeTo(200,1);$('img',this).fadeTo(200,0.5);sc.now=sc.link;$('img',open_target_id).fadeOut(500,function(){$(this).attr('src',sc.link);sc.willp=Math.ceil((_numRe(sc.now)*1+1)/once_num);if(sc.willp !=now){now=sc.willp;_move();}_arrowCHK();$(this).fadeIn(500);});if(open_target_txt_id !=null){sc.text=$(this).parent().find('span').html();$(open_target_txt_id).fadeOut(500,function(){$(this).html(sc.text);$(this).fadeIn(500);});}}return false;});if(open_target_first_id !=null && sc.first){$('a',open_target_first_id).click();}else{$(btn,id).eq(0).click();}}});}
