if(!console){var console={};console.log=function(o){}}var vf_anim={img_src:[],cache:[],autoplay_handle:null,autoplay_timer:6000,autoplay_do:true,cur_pos:0,img_total:0,img_loaded:0,preloading:false,img_list:["../images/img_0_0.jpg","../images/img_0_1.jpg","../images/img_1_0.jpg","../images/img_1_1.jpg","../images/img_2_0.jpg","../images/img_2_1.jpg","../images/menu_0_0.png","../images/menu_0_1.png","../images/menu_1_0.png","../images/menu_1_1.png","../images/menu_2_0.png","../images/menu_2_1.png","../images/slogan_0_0.png","../images/slogan_0_1.png","../images/slogan_1_0.png","../images/slogan_1_1.png","../images/slogan_2_0.png","../images/slogan_2_1.png","../images/claim.png","../images/arrow.png","../images/menu_selected.png"],preload:function(){var that=this;this.img_total=this.img_list.length;this.preloading=true;var i=0;for(i=0;i<this.img_total;i++){this.cache[i]=$("<img />").load(function(){that.img_loaded++}).attr("src",that.img_list[i])}},init:function(){if($.browser.msie&&parseInt($.browser.version)<7){DD_belatedPNG.fix("#menu");DD_belatedPNG.fix("#menu img");DD_belatedPNG.fix("#menu .menu_item a");DD_belatedPNG.fix("#menu_selector div");DD_belatedPNG.fix("#header .slogan_item div")}this.play()},play:function(){var that=this;if(!this.preloading){this.preload();setTimeout(function(){that.play()},100);return }else{if(this.img_loaded<this.img_total){setTimeout(function(){that.play()},100);return }}$("#menu .menu_item").each(function(i,node){$(node).click(function(e){if(i==that.cur_pos){return }$(this).blur();that.change2(i);return false})});$("#menu").animate({right:"0px"},500,"easeOutBack");$("#header .slogan_item").animate({left:"102px"},500,"easeOutBack");$("#header_bg").css({opacity:0,display:"block"});$("#header_bg_swap").css({opacity:0,display:"block"});this.bg_in("0");this.move_selector(false);this.autoplay_handle=setTimeout(function(){that.autoplay()},this.autoplay_timer)},autoplay:function(){var that=this;var next_pos=0;if(that.autoplay_do){next_pos=(that.cur_pos+1==3)?0:that.cur_pos+1;$("#menu_dyn_"+next_pos).click();that.cur_pos=next_pos}delete that,next_pos},move_selector:function(moveIt){$("#menu_selector").css({display:"block"});var coords=$("#menu .menu_item.selected").position();var styles={top:coords.top+"px",left:coords.left+"px"};if(moveIt){$("#menu_selector").animate(styles,360,"easeOutBack")}else{$("#menu_selector").css(styles)}},bg_in:function(bg){$("#header_bg img").attr({src:"../images/img_"+bg+"_1.jpg"}).parent().animate({opacity:1},200,"swing",function(){$("#header_bg_swap img").attr({src:"../images/img_"+bg+"_0.jpg"}).parent().animate({opacity:1},250,"swing")})},change_slogan:function(slogan){$("#header .slogan_item").removeClass("selected");$("#header #slogan_"+slogan).addClass("selected")},change2:function(bg){var that=this;window.clearTimeout(this.autoplay_handle);this.change_slogan(bg);$("#menu .menu_item").removeClass("selected");$("#menu_dyn_"+bg).addClass("selected");this.move_selector(true);$("#header_bg_swap").css({opacity:0});$("#header_bg").animate({opacity:0},150,"swing",function(){that.bg_in(bg)});this.cur_pos=bg;this.autoplay_handle=setTimeout(function(){that.autoplay()},this.autoplay_timer);delete that;return false}};$(function(){vf_anim.init()});
