1window.addEvent('domready', function(){ 2 // smooth anchor scrolling 3 new SmoothScroll(); 4 // style area 5 if(document.id('gkStyleArea')){ 6 $$('#gkStyleArea a').each(function(element,index){ 7 element.addEvent('click',function(e){ 8 e.stop(); 9 changeStyle(index+1); 10 }); 11 }); 12 } 13 14 // font-size switcher 15 if(document.id('gkTools') && document.id('gkComponentWrap')) { 16 var current_fs = 100; 17 var content_fx = new Fx.Tween(document.id('gkComponentWrap'), { property: 'font-size', unit: '%', duration: 200 }).set(100); 18 document.id('gkToolsInc').addEvent('click', function(e){ 19 e.stop(); 20 if(current_fs < 150) { 21 content_fx.start(current_fs + 10); 22 current_fs += 10; 23 } 24 }); 25 document.id('gkToolsReset').addEvent('click', function(e){ 26 e.stop(); 27 content_fx.start(100); 28 current_fs = 100; 29 }); 30 document.id('gkToolsDec').addEvent('click', function(e){ 31 e.stop(); 32 if(current_fs > 70) { 33 content_fx.start(current_fs - 10); 34 current_fs -= 10; 35 } 36 }); 37 } 38 // 39 if(document.id('btnLogin') || document.id('btnRegister')) { 40 var popup_overlay = document.id('gkPopupOverlay'); 41 popup_overlay.setStyles({'display': 'block', 'opacity': '0'}); 42 popup_overlay.fade('out'); 43 var popup_login = null; 44 var popup_login_h = null; 45 var popup_login_fx = null; 46 var popup_register = null; 47 var popup_register_h = null; 48 var popup_register_fx = null; 49 50 if(document.id('btnLogin')) { 51 popup_login = document.id('gkPopupLogin'); 52 popup_login.setStyle('display', 'block'); 53 popup_login_h = popup_login.getElement('.gkPopupWrap').getSize().y + 8; 54 popup_login_fx = new Fx.Morph(popup_login, {duration:200, transition: Fx.Transitions.Circ.easeInOut}).set({'opacity': 0, 'height': 0, 'margin-top':0}); 55 document.id('btnLogin').addEvent('click', function(e) { 56 new Event(e).stop(); 57 popup_overlay.fade(0.85); 58 popup_login_fx.start({'opacity':1, 'margin-top': -popup_login_h / 2, 'height': popup_login_h}); 59 opened_popup = 'login'; 60 }); 61 } 62 63 if(document.id('btnRegister')) { 64 popup_register = document.id('gkPopupRegister'); 65 popup_register.setStyle('display', 'block'); 66 popup_register_h = popup_register.getElement('.gkPopupWrap').getSize().y + 8; 67 popup_register_fx = new Fx.Morph(popup_register, {duration:200, transition: Fx.Transitions.Circ.easeInOut}).set({'opacity': 0, 'height': 0, 'margin-top':0}); 68 document.id('btnRegister').addEvent('click', function(e) { 69 new Event(e).stop(); 70 popup_overlay.fade(0.85); 71 popup_register_fx.start({'opacity':1, 'margin-top': -popup_register_h / 2, 'height': popup_register_h}); 72 opened_popup = 'register'; 73 showGKRecaptcha('gk_recaptcha', 'submit_1', 'recaptcha_required_1'); 74 }); 75 } 76 77 popup_overlay.addEvent('click', function() { 78 if(opened_popup == 'login') { 79 popup_overlay.fade('out'); 80 popup_login_fx.start({ 81 'opacity' : 0, 82 'height' : 0, 83 'margin-top': 0 84 }); 85 } 86 87 if(opened_popup == 'register') { 88 popup_overlay.fade('out'); 89 popup_register_fx.start({ 90 'opacity' : 0, 91 'height' : 0, 92 'margin-top': 0 93 }); 94 } 95 }); 96 } 97}); 98// function to set cookie 99function setCookie(c_name, value, expire) { 100 var exdate=new Date(); 101 exdate.setDate(exdate.getDate()+expire); 102 document.cookie=c_name+ "=" +escape(value) + ((expire==null) ? "" : ";expires=" + exdate.toUTCString()); 103} 104// Function to change styles 105function changeStyle(style){ 106 var file1 = $GK_TMPL_URL+'/css/style'+style+'.css'; 107 var file2 = $GK_TMPL_URL+'/css/typography.style'+style+'.css'; 108 new Asset.css(file1); 109 new Asset.css(file2); 110 Cookie.write('gk_mar2011_style',style, { duration:365, path: '/' }); 111}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.