$(function() { teamfc.init(); }) var teamfc = { init: function() { this.tdfc(); this.tdnav(); }, tdfc: function() { for(var i=0; i<$("div[class='box'][id^='team_fc']").size(); i++){ new Figure('team_fc'+ i); } //var lb0 = new Figure('team_fc0'); //var lb1 = new Figure('team_fc1'); //var lb2 = new Figure('team_fc2'); }, tdnav: function(){ var itms = $(".team_fc .box_nav .box_nav_item"); for(var i = 0; i"); } }); }) } } }; window.Figure = function(id) { this.obj = $('#' + id + ''); this.left = this.obj.find('a.left'); this.right = this.obj.find('a.right'); this.parent = this.obj.find('[firbox ^= parent]'); this.children = this.obj.find('[firbox ^= children]'); this.len = this.children.length; this.index = 0; this.init(); }; Figure.prototype = { init: function() { this.reast(); this.addClick(); }, reast: function() { var w = this.children.eq(0).outerWidth(); if(w - 320 < 30 && w < 400 && w > 312) { var iw = (document.documentElement || document.body).offsetWidth; if(iw * 1 - 1032 < 0) { w = 312; } } try { if(window.location.href.toLowerCase().indexOf("guest.shtml") > 0 && this.obj.attr("id") == "home_indusy" && w < 1000) { w = 1060; } } catch(ex) {} try { var len = this.children.length; var len2 = len; var aid = this.parent.attr("id"); if(typeof(sptype) != "undefined"){ if(aid.indexOf("teamfcul")>-1){ if(window.tdfcliWidth == 0){ window.tdfcliWidth = w; } this.children.css('width', window.tdfcliWidth); if(len2<3) {len2 = 3} }else{ this.children.css('width', w); } }else{ this.children.css('width', w); } var html = this.parent[0].innerHTML; this.parent[0].innerHTML += html; this.parent.css('width', w * len2 * 2) } catch(e) {} }, addClick: function() { var _this = this; this.left.on('click', function() { _this.leftClick(); }) this.right.on('click', function() { _this.rightClick(); }) }, leftClick: function() { var _this = this; this.index--; var w = this.children.eq(0).outerWidth(); if(this.index == 0) { try { var aid = this.parent.attr("id"); if(aid.indexOf("teamfcul")>-1){ var idx = Number(aid.replace("teamfcul","")); var fcnum = $("div[class='box'][id^='team_fc']").size(); if(idx<=fcnum-1){ $(".team_fc .box_nav .box_nav_item").eq(idx-1).click(); }else{ $(".team_fc .box_nav .box_nav_item").eq(fcnum-1).click(); } } } catch (e) { } }; if(this.index < 0) { this.index = (this.len - 1); this.parent.css('left', -w * (_this.len)) }; this.aqiRender() }, rightClick: function() { this.index++; if(this.index == (this.len) || (this.index > (this.len) && (this.len) == 1)) { try { var aid = this.parent.attr("id"); if(aid.indexOf("teamfcul")>-1){ var idx = Number(aid.replace("teamfcul","")); var fcnum = $("div[class='box'][id^='team_fc']").size(); if(idx (this.len)) { this.index = 1; this.parent.css('left', 0) }; this.aqiRender(); }, aqiRender: function() { var w = this.children.eq(0).outerWidth(); var _this = this; this.parent.stop().animate({ left: -_this.index * w }); try{ var aid = this.parent.attr("id"); if(aid.indexOf("teamfcul")>-1 || aid.indexOf("recruit_tdfc")>-1){ $("#"+aid).find("div.recr_wns .text div").slice(this.index*6, this.index*6+6).each(function(){ var pichtml = $(this).html(); if(pichtml == ""){ if($(this).attr("pic")){ $(this).html(""); } } }); } }catch(e){} } };