/* * common-select * css Àû¿ëµÈ , false: * @return {Number} n (0~) */ get_position_focus:function(isoption){ var n=0; if(isoption){ // find-select-option $(this._target).find('option').each(function(a){ if($(this).attr('selected')){ n=a; } }); }else{ // find-ul-li $(this._container).find('li a').each(function(b){ if($(this).hasClass('focus')){ n=b; } }); } return n; }, /** * Àû¿ë °´Ã¼¿¡ Æ÷Ä¿½º ¿©ºÎ ÆǺ° * document-keyup-event¿¡ ´ëÀÀÇϱâ À§ÇØ */ isfocus_listeners:function(){ var bool=false; for(var a in this._listeners){ if($(this._listeners[a]).is(':focus')){ bool=true; break; } } return bool; }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:BUILD ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ±¸¼º½ÃÀÛ */ build:function(){ this.buildScope(); this.buildContainer(); this.buildEvent(); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:SCOPE ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Ç¥½Ã°´Ã¼ ±¸¼º */ buildScope:function(){ var scope=document.createElement('div'); this._scope=scope; $(scope) .addClass('select-list') .css({ 'position':'absolute', 'left':'0px', 'top':'0px', 'z-index':'1000', 'background-color':'#fff' }) .appendTo(document.body); }, /** * Ç¥½Ã°´Ã¼ »çÀÌÁî º¯°æ */ resizeScope:function(){ var atotal=Math.min($(this._target).find('select option').length || 0, 5); var h=(24-3)*atotal+((atotal<=4)?3:1); $(this._scope).css({ 'height':h+'px' }); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:CONTAINER ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ÄÁÅ×ÀÌ³Ê °´Ã¼ ±¸¼º */ buildContainer:function(){ var container=document.createElement('ul'); this._container=container; $(container).css({ 'position':'relative' }).appendTo($(this._scope)); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:LIST ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ÄÁÅ×À̳ʳ» ¸®½ºÆ® ±¸¼º */ buildLists:function(){ var owner=this; $(this._target).find('select option').each(function(a){ var ali=document.createElement('li'); $(ali) .data('n', a) .data('value', $(this).val()) .html(''+$(this).text()+'') .css({'cursor':'pointer'}) .bind('click', function(e){ owner.select($(this).data('n')); owner.close(e); return false; }) .appendTo($(owner._container)); }); }, /** * ÄÁÅ×À̳ʳ» ¸®½ºÆ® »èÁ¦ */ removeLists:function(){ $(this._container).empty(); }, /** * ÄÁÅ×À̳ʳ» ¸®½ºÆ® Æ÷Ä¿½º * @param {Number} n - Ç׸ñ ¼ø¼­ (0~) * @param {Number, String} time - ¾Ö³ª¸ÞÀÌ¼Ç ½Ã°£ (0~, 'slow') */ focusLists:function(n, isfirst){//time){ $(this._container).find('li a').each(function(a){ if(n==a) {$(this).addClass('focus');} else {$(this).removeAttr('class');} }); var owner=this; var ty=21*n; $(this._scope).scrollTop(ty); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:EVENT ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * À̺¥Æ® ±¸¼º */ buildEvent:function(){ var owner=this; $(document).bind({ // 1. ¸¶¿ì½º Ŭ¸¯ ½Ã (¿µ¿ª ¹ÛÀÏ °æ¿ì È­¸é °¨Ãã) 'mousedown':function(e){ if(owner._isshow){ var pos=$(owner._scope).offset(); var w=$(owner._scope).width()+(7+1)*2; var h=$(owner._scope).height()+(4+1)*2; var x=e.pageX; var y=e.pageY; if((x>=pos.left && x<=pos.left+w) && (y>=pos.top-30 && y<=pos.top+h)){ // ¿µ¿ª³» Ŭ¸¯ °£ÁÖ $(owner).blur(); }else{ owner.close(); } } } }); $(this._scope).bind({ 'mousewheel':function(e){ // safari-bug·Î ÀÎÇÑ mouse-wheel Á¦ÇÑ if($.browser.safari){ return false; } } }) }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:TRANSFORM ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * À§Ä¡ º¯°æ */ position:function(){ var tx=$(this._target).offset().left; var ty=($(this._target).offset().top+$(this._target).height())-($(this._target).data('istable')?2:0); var tw=$(this._target).find('.select-box').width(); $(this._scope) .css({ 'left':tx+'px', 'top':ty+'px', 'width':tw+'px' }); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:OPERATION ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Ç׸ñ ¼±Åà * @param {Object} n - ¼±ÅÃµÈ Ç׸ñ ¼ø¼­ (0~) */ select:function(n){ $(this._target).find('select option').each(function(a){ if(n==a) {$(this).attr('selected', 'selected');} else {$(this).removeAttr('selected');} }); //$(this._target).find('select').focus().trigger('change').blur(); $(this._target).find('select').trigger('change'); }, focus:function(n){ this.focusLists(n, false);//0); }, /** * ¿­±â * @param {Object} target - css Àû¿ëµÈ select-container */ open:function(target){ if(this._target!=target){ this._target=target; this.removeLists(); this.show(true); this.buildLists(); this.focusLists(this.get_position_focus(true), true);//'slow'); this.resizeScope(); this.position(); } }, /** * ´Ý±â */ close:function(e){ if(e!=null && e.type=='click') $(this._target).blur(); // ¸¶¿ì½º Ŭ¸¯À϶§¸¸ Àû¿ë this._target=null; this.removeLists(); this.show(false); }, /** * ³ëÃâ * @param {Object} bool - true:³ëÃâ, false:°¨Ãã */ show:function(bool){ if(bool) $(this._scope).show(); else $(this._scope).hide(); this._isshow=bool; } }; /** * common-slider * * data-role : slider * data-func ; function(){} - callback ÇÔ¼öÁöÁ¤ * data-view : È­¸é¿¡ º¸ÀÌ´Â °¹¼ö(±âº»°ª 1) * data-step : ½½¶óÀ̵åµÇ´Â °¹¼ö(±âº»°ª 1) * * @param {Object} scope */ var CommonSlider=function(scope){ this._scope=scope; this._container=null; this._contents=null; this._view=null; this._step=null; // ÇÑ ¹ø¿¡ À̵¿ÇÒ °¹¼ö this._selects={'max':null, 'focus':null}; this._counts={'max':null, 'focus':null}; this._widths={'container':null, 'contents':null, 'step':null}; this._callback=null; this._cb_focus=null; this.init.apply(this, arguments); }; CommonSlider.prototype={ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // INITIALIZE ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ÃʱâÈ­ */ init:function(){ this._view=$(this._scope).attr('data-view') || 1; this._step=$(this._scope).attr('data-step') || 1; this._callback=$(this._scope).attr('data-func') || null; this._selects.max=$(this._scope).find('ul li').length || 0; this._selects.focus=-1; var cmax=Math.ceil((this._selects.max-this._view)/this._step); cmax=(cmax<=0)?0:cmax; cmax+=1; this._counts.max=cmax; this._counts.focus=0; this.build(); this.focus(0); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:PARAMS ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// get_width:function(scope){ var w=0; w+=Number($(scope).width()); w+=Number($(scope).css('margin-left').replace(/[^0-9]/g, '')); w+=Number($(scope).css('margin-right').replace(/[^0-9]/g, '')); w+=Number($(scope).css('border-width').replace(/[^0-9]/g, ''))*2; return w; }, get_width_step:function(){ var child=$(this._contents).find('li:eq(0)'); var w=this.get_width($(child)); return w; }, get_height:function(scope){ var h=0; h+=Number($(scope).height()); h+=Number($(scope).css('margin-top').replace(/[^0-9]/g, '')); h+=Number($(scope).css('margin-bottom').replace(/[^0-9]/g, '')); h+=Number($(scope).css('border-width').replace(/[^0-9]/g, ''))*2; return h; }, get_height_step:function(){ var child=$(this._contents).find('li:eq(0)'); var h=this.get_height($(child)); return w; }, get_distance:function(){ var d=(this._view-this._selects.max)*this._widths.step; return (d>0)?0:d; /* var w=0; w+=this._widths.container; w-=this._widths.contents; w-=Number($(this._contents).css('margin-left').replace(/[^0-9]/g, '')); w-=Number($(this._contents).css('margin-right').replace(/[^0-9]/g, '')); return w;*/ }, get_total_count:function(){ return 2; }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:BUILD ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ±¸¼º½ÃÀÛ */ build:function(){ this.buildContainer(); this.buildContent(); this.buildNavigation(); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:CONTAINER ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ½½¶óÀ̵带 À§ÇÑ ÄÁÅ×ÀÌ³Ê »ý¼º */ buildContainer:function(){ var container=document.createElement('div'); this._container=container; var contents=$(this._scope).find('ul'); this._contents=contents; var w=this.get_width($(contents)); this._widths.container=w; var h=this.get_height_step;//$(contents).height(); $(container).css({ 'position':'relative', 'float':'left', 'width':w+'px', 'height':h+'px', 'overflow':'hidden'/*, 'background-color':'#000099'*/ }) .insertBefore($(contents)); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:CONTENT ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ÄÁÅÙÃ÷ ¼³Á¤ º¯°æ */ buildContent:function(){ var owner=this; var container=this._container; var contents=this._contents; $(contents).appendTo($(container)); var child=$(contents).find('li:eq(0)'); //var sw=this.get_width($(child))+2; this._widths.step=sw; var sw=this.get_width_step(); this._widths.step=sw; var tw=(this._selects.max*(sw+2)); this._widths.contents=tw; if(this._selects.max>0){ $(contents).css({ 'position':'relative', 'width':tw+'px' }); $(contents).find('li').each(function(a){ $(this).removeClass('on').show(); if(!$(this).hasClass('blank') && $(this).children().length>0){ $(this) .data('n', a) .bind({ 'click':function(e){ owner.focus($(this).data('n')); }, 'focusin':function(e){ owner.transition(Math.floor($(this).data('n')/owner._step), 0); $(this).addClass('on'); }, 'focusout':function(e){ if(owner._selects.focus!=$(this).data('n')){ $(this).removeClass('on'); } } }); } }); } }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:NAVIGATION ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ³×ºñ°ÔÀÌ¼Ç ±¸¼º */ buildNavigation:function(){ var owner=this; $(this._scope).find('.prev').bind('click', function(e){ owner.navigate(-1); }); $(this._scope).find('.next').bind('click', function(e){ owner.navigate(1); }); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:TRANSFORM ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ½½¶óÀÌµå ¸ð¼Ç */ transition:function(n, time){ //if(this._counts.focus!=n){ this._counts.focus=n; var dw=this.get_distance(); var tx=this._widths.step*this._step*n*-1; tx=(tx<=dw)?dw:tx; // º¸Á¤ $(this._contents).stop().stop().animate({'left':tx+'px'}, time); //} }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:OPERATION ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * ³×ºñ°ÔÀÌÅÍ À̵¿ * @param {Object} dir - ¹æÇâ -1(left), 1(right) */ navigate:function(dir){ var c=this._counts.focus; c+=dir; var t=this._counts.max; if(c<0){ alert('óÀ½ÀÔ´Ï´Ù.'); }else if(c>t-1){ alert('¸¶Áö¸·ÀÔ´Ï´Ù.'); } c=(c<=0)?0:c; c=(c>=t-1)?t-1:c; this.transition(c, 'slow'); }, /** * Æ÷Ä¿½º * @param {Object} n - ¼±Åà ¼ø¼­ (0~) */ focus:function(n){ if(this._selects.focus!=n){ this._selects.focus=n; $(this._contents).find('li').each(function(a){ if(a==n) $(this).addClass('on'); else $(this).removeClass('on'); }); this._counts.focus=Math.floor(n/this._step); this.navigate(0); // this._count·Î À̵¿ÇϹǷΠ¹æÇâÀº '0' if(this._callback!=null) window[this._callback](n); if(this._cb_focus!=null) this._cb_focus(n); } } }; /** * common-block-slider * * @param {Object} scope */ var CommonBlockSlider=function(scope, n){ this._scope=scope; this._slider=null; this._navigation=null; this._step=null; this._focus=-1; this._total=null; this._n=n; this._delaysec=3000+100*n; this._interval=null; this._isauto=true; this._isover=false; this._istab=false; this.init.apply(this, arguments); }; CommonBlockSlider.prototype={ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // INITIALIZE ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// init:function(){ this._step=$(this._scope).width(); this.initScope(); this.initSlider(); this.initNavigation(); this.focus(0, 0); var isauto=($(this._scope).attr('data-autoplay')=='N')?false:true; if(isauto) this.buildAuto(); else this.toggleAuto(); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:SCOPE ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// initScope:function(){ var owner=this; $(this._scope).css({ 'overflow':'hidden', 'position':'relative' }) .bind({ 'mouseenter':function(){ owner._isover=true; owner.removeAuto(); }, 'mouseleave':function(){ owner._isover=false; owner.buildAuto(); } }); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:SLIDER ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// initSlider:function(){ var owner=this; var slider=$(this._scope).find('ul:eq(1)'); this._slider=slider; var atotal=$(slider).find('li').length; this._total=atotal; $(slider).css({ 'position':'relative', 'width':(atotal*this._step)+'px' }) .find('li').each(function(a){ $(this).css({ 'position':'relative', 'float':'left' }) .find('a') .data('n', a) .bind({ 'focusin':function(e){ owner._istab=true; owner.removeAuto(); owner.focus($(this).data('n'), 0); e.preventDefault(); }, 'keydown':function(e){ if(e.keyCode==9){ if(($(this).is(':first-child') && e.shiftKey) || $(this).is(':last-child')){ owner._istab=false; owner.buildAuto(); } } } }); }); }, focusSlider:function(n, time){ var owner=this; var tx=this._step*n*-1; var time=(time==undefined)?'slow':time; $(this._slider).stop().stop(); if(time===0){ $(this._slider).css({'left':tx+'px'}); }else{ $(this._slider).animate({'left':tx+'px'}, time, function(){ owner.buildAuto(); }); } }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:NAVIGATION ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// initNavigation:function(){ var owner=this; var navigation=$(this._scope).find('ul:eq(0)'); this._navigation=navigation; $(navigation).find('li').each(function(a){ if(!$(this).is(':last-child')){ $(this) .data('n', a) .find('a').bind({ 'click':function(e){ owner.focus($(this).parent().data('n')); } }); }else{ /* $(this).toggle( function(){ owner._isauto=false; owner.removeAuto(); $(this).attr('class', 'play'); }, function(){ owner._isauto=true; owner.buildAuto(); $(this).attr('class', 'pause'); } ); */ $(this).bind('click', function(e){ owner.toggleAuto(); }); } }); }, focusNavigation:function(n){ $(this._navigation).find('li').each(function(a){ if(!$(this).is(':last-child')){ if(a===n) $(this).attr('class', 'on'); else $(this).removeAttr('class'); } }); }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:AUTO ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// toggleAuto:function(){ var scope=$(this._navigation).find('li:last-child'); var bool=this._isauto; if(bool){ this._isauto=false; this.removeAuto(); $(scope).attr('class', 'play'); }else{ this._isauto=true; this.buildAuto(); $(scope).attr('class', 'pause'); } }, buildAuto:function(){ this.removeAuto(); if(this._isauto && !this._isover && !this._istab){ var owner=this; this._interval=setInterval(function(){ owner.count(); }, owner._delaysec); } }, removeAuto:function(){ if(this._interval!=null){ clearInterval(this._interval); this._interval=null; } }, ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // METHOD:OPERATION ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// count:function(){ if(this._isauto && !this._isover){ this.removeAuto(); var c=this._focus; c++; c=(c>=this._total)?0:c; this.focus(c); }else{ this.buildAuto(); } }, focus:function(n, time){ if(this._focus!=n){ this._focus=n; this.removeAuto(); this.focusNavigation(n); this.focusSlider(n, time); } } }; /********************************************************************************************************** * UTIL-DELEGATE **********************************************************************************************************/ var Delegate={}; Delegate.create=function(delegateInstance, pointingMethod){ return function(){ return pointingMethod.apply(delegateInstance, arguments); } }; /********************************************************************************************************** * initialize-document **********************************************************************************************************/ $(document).ready(function(e){ //initFavicon(); initBody(); setTimeout(function(){ initHeader(); initFooter(); if(typeof(initPage)!='undefined') initPage(); initElement(); }, 10); }); /** * dom-object-style */ function initElement(){ initAlink(); initTable(); initSelect(); resizeSelect(); initRadio(); initFaq(); initHelp(); initSlider(); } /********************************************************************************************************** * common-params **********************************************************************************************************/ /** * ÀͽºÇÃ·Î¾î ¹öÀü Á¤º¸ Ãëµæ */ function get_msie_version(){ var version=''; var trident=navigator.userAgent.match(/Trident\/(\d.\d)/i); if(trident!=null){ switch(trident[1]){ case '3.0': version='7'; break; case '4.0': version='8'; break; case '5.0': version='9'; break; case '6.0': version='10'; break; } }else{ version=String(parseInt($.browser.version, 10)); } return version; } /********************************************************************************************************** * initialize-head **********************************************************************************************************/ //function initFavicon(){ // var link=document.createElement('link'); // $(link) // .attr({'rel':'shortcut icon', 'href':'/images/common/favicon.ico'}) // .appendTo($(document.head)); //} /********************************************************************************************************** * initialize-body-class **********************************************************************************************************/ /** * browser¿¡ µû¸¥ body-tag-class ºÎ¿© */ function initBody(){ var name=''; if($.browser.msie){ name='msie'+get_msie_version(); }else if($.browser.chrome){ name='chrome'; }else if($.browser.safari){ name='safari'; }else if($.browser.opera){ name='opera'; }else if($.browser.mozilla){ name='firefox'; } //$(document.body).addClass(name); $('body').addClass(name); } /********************************************************************************************************** * initialize-header **********************************************************************************************************/ var _header=null; function initHeader(){ if(typeof(_type_gnb)!='undefined'){ try{ _header=new CommonHeader(); }catch(e){} } } /********************************************************************************************************** * initialize-footer **********************************************************************************************************/ var _footer=null; function initFooter(){ try{ _footer=new CommonFooter(); }catch(e){} } /********************************************************************************************************** * initialize-event **********************************************************************************************************/ /** * document-event ±¸¼º */ /********************************************************************************************************** * initialize-a-link **********************************************************************************************************/ function initAlink(){ $(document).find('a').each(function(a){ if($(this).attr('href')=='#' || $(this).attr('href')=='#none'){ $(this).attr('href', 'javascript:nothing();'); } }); } function nothing(){ // do-nothing } /********************************************************************************************************** * initialize-table **********************************************************************************************************/ /** * Á¢±Ù¼º°ü·Ã table-tag Á¤º¸ ÀÚµ¿¿Ï¼º */ function initTable(){ $(document).find('body table').each(function(a){ if($(this).attr('summary')=='' || $(this).attr('summary')==undefined){ // search-element-th var msg=''; $(this).find('th').each(function(b){ var bth=($(this).contents()[0]!=undefined)?$.trim($(this).contents()[0].nodeValue):''; if($.trim(bth)!=''){ msg+=((msg=='')?'':',')+bth; } }); if(msg!=''){ // defind-language var iseng=$('body').hasClass('eng'); // search-element-caption var caption=$.trim($(this).find('caption').text()) || ''; // add-message if(iseng){ msg='Table include '+msg; if($.trim(caption)!='') msg=caption+' '+msg; }else{ msg+='(À¸)·Î ÀÌ·ç¾îÁø'; if($.trim(caption)!='') msg+=' '+caption; msg+=' Å×À̺íÀÔ´Ï´Ù.'; } // add-attribute $(this).attr('summary',msg); } } }); } /********************************************************************************************************** * initialize-select **********************************************************************************************************/ var _common_select=null; // object-CommonSelect /** * css Àû¿ë */ function initCheckbox(){ var owner=this; $(document.body).find('input[type=checkbox]').each(function(a){ if(!$(this).data('iscustom')){ var m=0; m=($.browser.msie)?5:m; m=($.browser.safari)?-3:m; m=($.browser.opera)?1:m; var acontainer=document.createElement('div'); $(acontainer).css({ 'position':($.browser.msie && get_msie_version()=='7')?'none':'relative', 'display':($.browser.msie && get_msie_version()=='7')?'inline':'inline-block', 'vertical-align':'middle', 'zoom':'1', 'margin-top':m+'px' }) .insertBefore($(this)); $(this) .data('iscustom', true) .css({'opacity':'0'}) .bind({ 'click focusin focusout':function(e){ owner.toggleCheckbox(e); } }) .appendTo($(acontainer)) .trigger('focusout'); } }); } /** * css Àû¿ë */ function initRadio(){ var owner=this; $(document.body).find('input[type=radio]').each(function(a){ if(!$(this).data('iscustom')){ var m=0; m=($.browser.msie)?5:m; m=($.browser.safari)?-3:m; m=($.browser.opera)?1:m; var acontainer=document.createElement('div'); $(acontainer).css({ 'position':($.browser.msie && get_msie_version()=='7')?'none':'relative', 'display':($.browser.msie && get_msie_version()=='7')?'inline':'inline-block', 'vertical-align':'middle', 'zoom':'1', 'margin-top':m+'px' }) .insertBefore($(this)); $(this) .data('iscustom', true) .css({'opacity':'0'}) .bind({ 'click':function(e){ owner.selectRadio(e.currentTarget); }, 'focusin focusout':function(e){ owner.toggleRadio(e); } }) .appendTo($(acontainer)) .trigger('focusout'); } }); } /********************************************************************************************************** * initialize-class-faq **********************************************************************************************************/ function initFaq(){ } /** * tool-tip ÃʱâÈ­ */ function initHelp(){ var owner=this; $('.lay-help').each(function(a){ if(!$(this).data('iscustom')){ var container=$(this); // 1. hide-content $(this).find('.txt-help').hide(); // 2. event-open $(this).find('a:eq(0)') .bind('click', function(e){ owner.clearHelp(); $(this).parent() .css({'z-index':'999'}) .find('.txt-help').show(); }); // 3. event-close $(this).find('.lay-close') .bind('click', function(e){ owner.clearHelp(); }); } }); } /** * tool-tip È­¸é ÃʱâÈ­ */ /********************************************************************************************************** * initialize-data-role-slider **********************************************************************************************************/ function initSlider(){ $(document).find('*[data-role=slider]').each(function(a){ if(!$(this).data('iscustom')){ $(this) .data('iscustom', true) .data('scope', new CommonSlider($(this))); } }); $(document).find('*[data-role=block-slider]').each(function(b){ if(!$(this).data('iscustom')){ $(this) .data('iscustom', true) .data('scope', new CommonBlockSlider($(this), b)); } }); }