1/* 2#------------------------------------------------------------------------ 3# The World News II - #6 2011 template (for Joomla 1.5) 4# 5# Copyright (C) 2007-2010 Gavick.com. All Rights Reserved. 6# License: Copyrighted Commercial Software 7# Website: http://www.gavick.com 8# Support: [email protected] 9#------------------------------------------------------------------------ 10# Based on T3 Framework 11#------------------------------------------------------------------------ 12# Copyright (C) 2004-2009 J.O.O.M Solutions Co., Ltd. All Rights Reserved. 13# @license - GNU/GPL, http://www.gnu.org/copyleft/gpl.html 14# Author: J.O.O.M Solutions Co., Ltd 15# Websites: http://www.joomlart.com - http://www.joomlancers.com 16#------------------------------------------------------------------------ 17*/ 18 19//Call noconflict if detect jquery 20//Apply jquery.noConflict if jquery is enabled 21if ($defined(window.jQuery) && $type(jQuery.noConflict)=='function') { 22 jQuery.noConflict(); 23 jQuery.noConflict(); 24} 25 26function switchFontSize (ckname,val){ 27 var bd = $E('body'); 28 switch (val) { 29 case 'inc': 30 if (CurrentFontSize+1 < 7) { 31 bd.removeClass('fs'+CurrentFontSize); 32 CurrentFontSize++; 33 bd.addClass('fs'+CurrentFontSize); 34 } 35 break; 36 case 'dec': 37 if (CurrentFontSize-1 > 0) { 38 bd.removeClass('fs'+CurrentFontSize); 39 CurrentFontSize--; 40 bd.addClass('fs'+CurrentFontSize); 41 } 42 break; 43 default: 44 bd.removeClass('fs'+CurrentFontSize); 45 CurrentFontSize = val; 46 bd.addClass('fs'+CurrentFontSize); 47 } 48 Cookie.set(ckname, CurrentFontSize,{duration:365}); 49} 50 51function switchTool (ckname, val) { 52 createCookie(ckname, val, 365); 53 window.location.reload(); 54} 55 56function createCookie(name,value,days) { 57 if (days) { 58 var date = new Date(); 59 date.setTime(date.getTime()+(days*24*60*60*1000)); 60 var expires = "; expires="+date.toGMTString(); 61 }else expires = ""; 62 document.cookie = name+"="+value+expires+"; path=/"; 63} 64 65//addEvent - attach a function to an event 66function gkAddEvent(obj, evType, fn){ 67 if (obj.addEventListener){ 68 obj.addEventListener(evType, fn, false); 69 return true; 70 } else if (obj.attachEvent){ 71 var r = obj.attachEvent("on"+evType, fn); 72 return r; 73 } else { 74 return false; 75 } 76} 77 78window.addEvent('load', function() { 79 new SmoothScroll(); 80 // 81 if($('stylearea')){ 82 $$('.style_switcher').each(function(element,index){ 83 element.addEvent('click',function(event){ 84 var event = new Event(event); 85 event.preventDefault(); 86 changeStyle(index+1); 87 }); 88 }); 89 } 90 // 91 if($('btn_login') || $('btn_register')) { 92 var popup_overlay = $('gk-popup-overlay'); 93 popup_overlay.setStyle('display', 'block'); 94 var popup_overlay_fx = new Fx.Style(popup_overlay, 'opacity', {duration:200}).set(0); 95 var opened_popup = null; 96 var popup_login = null; 97 var popup_login_h = null; 98 var popup_login_fx = null; 99 var popup_register = null; 100 var popup_register_h = null; 101 var popup_register_fx = null; 102 103 if($('btn_login')) { 104 popup_login = $('gk-popup-login'); 105 popup_login.setStyle('display', 'block'); 106 popup_login_h = popup_login.getElement('.gk-popup-wrap').getSize().size.y + 8; 107 popup_login_fx = new Fx.Styles(popup_login, {duration:200, transition: Fx.Transitions.Circ.easeInOut}).set({'opacity': 0, 'height': 0, 'margin-top':0}); 108 $('btn_login').addEvent('click', function(e) { 109 new Event(e).stop(); 110 popup_overlay_fx.start(0.85); 111 popup_login_fx.start({'opacity':1, 'margin-top': -popup_login_h / 2, 'height': popup_login_h}); 112 opened_popup = 'login'; 113 }); 114 } 115 116 if($('btn_register')) { 117 popup_register = $('gk-popup-register'); 118 popup_register.setStyle('display', 'block'); 119 popup_register_h = popup_register.getElement('.gk-popup-wrap').getSize().size.y + 8; 120 popup_register_fx = new Fx.Styles(popup_register, {duration:200, transition: Fx.Transitions.Circ.easeInOut}).set({'opacity': 0, 'height': 0, 'margin-top':0}); 121 $('btn_register').addEvent('click', function(e) { 122 new Event(e).stop(); 123 popup_overlay_fx.start(0.85); 124 popup_register_fx.start({'opacity':1, 'margin-top': -popup_register_h / 2, 'height': popup_register_h}); 125 opened_popup = 'register'; 126 }); 127 } 128 129 // nsp header suffix improvement ;) 130 if($$('div.header')[0] && $$('div.header')[0].getElement('.nsp_header')) { 131 $$('div.header').each(function(mod) { 132 var headers = mod.getElements('.nsp_header'); 133 headers.each(function(elm) { 134 if(elm.getParent().getElement('p.nsp_info')) { 135 elm.getParent().getElement('p.nsp_info').inject(elm, 'bottom'); 136 } 137 138 if(elm.getParent().getElement('p.nsp_text')) { 139 elm.getParent().getElement('p.nsp_text').inject(elm, 'bottom'); 140 } 141 }); 142 }); 143 } 144 145 popup_overlay.addEvent('click', function() { 146 if(opened_popup == 'login') { 147 popup_overlay_fx.start(0); 148 popup_login_fx.start({ 149 'opacity' : 0, 150 'height' : 0, 151 'margin-top': 0 152 }); 153 } 154 155 if(opened_popup == 'register') { 156 popup_overlay_fx.start(0); 157 popup_register_fx.start({ 158 'opacity' : 0, 159 'height' : 0, 160 'margin-top': 0 161 }); 162 } 163 }); 164 } 165}); 166// Function to change styles 167function changeStyle(style){ 168 var file1 = tmplurl+'/css/style'+style+'.css'; 169 new Asset.css(file1); 170 new Cookie.set('gk55_style',style,{duration: 200,path: "/"}); 171} 172// JCaptionCheck
173function JCaptionCheck() { 174 return (typeof(JCaption) == "undefined")? false: true; 175} 176 177if(!JCaptionCheck()) { 178 var JCaption = new Class({ 179 initialize: function(selector) 180 { 181 this.selector = selector; 182 var images = $$(selector); 183 images.each(function(image){ this.createCaption(image); }, this); 184 }, 185 186 createCaption: function(element) 187 { 188 var caption = document.createTextNode(element.title); 189 var container = document.createElement("div"); 190 var text = document.createElement("p"); 191 var width = element.getAttribute("width"); 192 var align = element.getAttribute("align"); 193 var docMode = document.documentMode; 194 195 //Windows fix 196 if (!align) 197 align = element.getStyle("float"); // Rest of the world fix 198 if (!align) // IE DOM Fix 199 align = element.style.styleFloat; 200 201 text.appendChild(caption); 202 text.className = this.selector.replace('.', '_'); 203 204 if (align=="none") { 205 if (element.title != "") { 206 element.parentNode.replaceChild(text, element); 207 text.parentNode.insertBefore(element, text); 208 } 209 } else { 210 element.parentNode.insertBefore(container, element); 211 container.appendChild(element); 212 if ( element.title != "" ) { 213 container.appendChild(text); 214 } 215 container.className = this.selector.replace('.', '_'); 216 container.className = container.className + " " + align; 217 container.setAttribute("style","float:"+align); 218 219 //IE8 fix 220 if (!docMode|| docMode < 8) { 221 container.style.width = width + "px"; 222 } 223 } 224 225 } 226 }); 227 228 document.caption = null; 229 window.addEvent('load', function() { 230 var caption = new JCaption('img.caption') 231 document.caption = caption 232 }); 233}
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.