1var preloadImages= new Array( 2 '/site-imgs/wait.gif', 3 '/site-imgs/check1.png', 4 '/site-imgs/radio1.png', 5 6 '/site-imgs/d_input_active.png', 7 '/site-imgs/d_textarea_active.png', 8 9 '/site-imgs/textarea_active.png', 10 '/site-imgs/input_active.png' 11); 12 13 14var site={ 15 location:'', 16 animation:false, 17 animations_inc:0, 18 box:{ 19 width:0, 20 height:0 21 }, 22 wizzard1:{ 23 sections:1, 24 design:0, 25 type:0, 26 sites:1, 27 interactive:0, 28 modules:{ 29 } 30 }, 31 resize_notify:function(){ 32 $('#site_blocker').css({width:'0',height:'0'}); 33 $('#site_blocker').css({ 34 width:$(document).width()+'px', 35 height:$(document).height()+'px' 36 }); 37 38 $('#site_blocker > div').css('top', 39 $(window).scrollTop()+ 40 ( 41 ($(window).height()/2) 42 - 43 ($('#site_blocker > div').outerHeight(true)/2) 44 ) - 50 45 ); 46 47 48 }, 49 50 notify:function(params) { 51 setTimeout(function(){ 52 $('#site_blocker').css({opacity:0,display:'block'}); 53 $('#site_blocker h1').html(params.title); 54 $('#site_blocker p').html(params.text); 55 $('#site_blocker > div > div > div').html(''); 56 if (!params.buttons) { 57 params.buttons={title:'Ïîíÿòíî!'}; 58 } 59 $(params.buttons).each(function(){ 60 var p=this; 61 var btn= $('<button>', { 62 text: p.title, 63 click: function(){ 64 if (p.action) p.action(); 65 site.notify_close(); 66 } 67 }); 68 $('#site_blocker > div > div > div').append(btn); 69 }); 70 $('#site_blocker').stop(true,true).animate({opacity:1},400); 71 site.resize_notify(); 72 },100); 73 }, 74 75 popup:function(obj,params) { 76 setTimeout(function(){ 77 if (!params) params={}; 78 79 $('#site_blocker').css({opacity:0,display:'block'}); 80 $('#site_blocker h1').html(params.title); 81 $('#'+obj).wrap('<div id="popup_placholder">'); 82 $('#site_blocker p').empty(); 83 $('#'+obj).appendTo($('#site_blocker p')).show(); 84 $('#site_blocker > div > div > div').html(''); 85 if (!params.buttons) 86 $('#site_blocker > div > div > div').hide(); 87 else 88 $('#site_blocker > div > div > div').show(); 89 90 if (!params.icon) 91 $('#site_blocker > div').css({'background-image':'url(/site-imgs/notify.png)'}); 92 else 93 $('#site_blocker > div').css({'background-image':'url('+params.icon+')'}); 94 95 $(params.buttons).each(function(){ 96 var p=this; 97 var btn= $('<button>', { 98 text: p.title, 99 click: function(){ 100 if (p.action) p.action(); 101 site.popup_close(); 102 } 103 }); 104 $('#site_blocker > div > div > div').append(btn); 105 }); 106 $('#site_blocker').stop(true,true).animate({opacity:1},400); 107 site.resize_notify(); 108 },100); 109 }, 110 111 112 113 popup_close:function(){ 114 $('#site_blocker p > div').insertBefore($('#popup_placholder')).hide(); 115 $('#popup_placholder').remove(); 116 $('#site_blocker').animate({opacity:0}
116,400,function(){$('#site_blocker').css({display:'none'})}); 117 }, 118 119 notify_close:function(){ 120 $('#site_blocker').animate({opacity:0},400,function(){$('#site_blocker').css({display:'none'})}); 121 }, 122 123 scroll_contacts:function (){ 124 if (!$('#contacts').data('busy')) { 125 if ($('#contacts').data('direction')<0) { 126 if ($('#contacts').scrollTop()==0) { 127 $('#contacts').data('direction',37); 128 } 129 else 130 $('#contacts').data('direction',-37); 131 } 132 else { 133 if ($('#contacts').height()-$('#contacts').scrollTop() < 1) { 134 $('#contacts').data('direction',-37); 135 } 136 else 137 $('#contacts').data('direction',-37); 138 } 139 140 $('#contacts') 141 .data('busy',true) 142 .stop(true,true) 143 .animate({scrollTop:$('#contacts').data('direction')},500,function(){ 144 $('#contacts').data('busy',false); 145 }); 146 147 } 148 setTimeout(site.scroll_contacts,5000); 149 }, 150 151 init_wizzard1:function (){ 152 $('#wizzard > div').width('90000px'); 153 $('#wizzard td').width('auto'); 154 var h_w=$('#wizzard').width(); 155 156 $('#wizzard').scrollLeft(0); 157 $('#wizzard td').width(h_w); 158 $('#wizzard td > div').css({visibility:'visible'}); 159 $('#wizzard > div').width($('#wizzard table').width()); 160 161 $('#wizz_control .next').unbind('click').click(function(){ 162 $('#wizzard').stop(true,true).animate({scrollLeft:'+='+h_w},600,site.wizzard1_check); 163 return false; 164 }); 165 $('#wizz_control .prev').unbind('click').click(function(){ 166 $('#wizzard').stop(true,true).animate({scrollLeft:'-='+h_w},600,site.wizzard1_check); 167 return false; 168 }); 169 site.wizzard1_check(); 170 setTimeout(site.animate_next_btn,10000); 171 return false; 172 }, 173 174 animate_next_btn:function(b){ 175 if (site.animations_inc>5) { 176 site.animations_inc=0; 177 setTimeout(site.animate_next_btn,5000); 178 return false; 179 } 180 site.animations_inc++; 181 if ($('#wizzard').scrollLeft()==0){ 182 if (!Number(b)) 183 $('#wizz_control a.next').animate({width:'+=10px'},250,function(){site.animate_next_btn(1);}); 184 else 185 $('#wizz_control a.next').animate({width:'-=10px'},250,function(){site.animate_next_btn();}); 186 } 187 }, 188 189 wizzard1_check:function(){ 190 $('#wizzard_hints').html(''); 191 192 if ($('#wizzard').scrollLeft()==0) { 193 $('#wizz_control .prev').stop(true,true).animate({opacity:0,width:0},300); 194 } else { 195 $('#wizz_control .prev').stop(true,true).animate({opacity:1,width:30},300); 196 } 197 198 if ($('#wizzard table').width()-$('#wizzard').scrollLeft()-$('#wizzard td:first').width()<1) { 199 200 //calculate 201 text_res=site.wizzard1.type.name+' '+site.wizzard1.design.name; 202 if (site.wizzard1.sections>1) { 203 text_res+=' ('+site.wizzard1.sections+' ðàçäåë'+(site.wizzard1.sections<5?'à':'îâ')+')'; 204 } 205 206 207 mp=site.wizzard1.design.idx+(site.wizzard1.design.idx>0?Math.ceil(site.wizzard1.design.idx*(site.wizzard1.sections-1)*0.1):site.wizzard1.sections)+site.wizzard1.interactive.idx+site.wizzard1.type.idx; 208 actm=0; 209 text_res+=' '+site.wizzard1.interactive.name; 210 211 if (site.wizzard1.sites>1) { 212 mp+=site.wizzard1.sites+(site.wizzard1.sites*actm); 213 text_res+=' íà '+site.wizzard1.sites+' âåðñè'+(site.wizzard1.sites<5?'è':'èé')+' ñàéò'+(site.wizzard1.sites<5?'à':'îâ')+' '; 214 } 215 216 217 $.each(site.wizzard1.modules,function(i,val){ 218 mp+=val; 219 if (val>0) { 220 actm++; 221 if (actm>1) text_res+=', '+i.replace('_',' '); 222 else text_res+=' è íàñòðîåííûìè ìîäóëÿìè: '+i.replace('_',' '); 223 } 224 }); 225 226 227 mp_res=""+(mp*1000); 228 $('#wizzard1_result .box_digit_right').html(mp_res.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 ')+' ð.'); 229 230 $('#wizzard1_result_text').html(text_res); 231 232 //lastpage 233 $('#wizzard_hints').html($('#wizzard1_summary_info').html()); 234 $('#wizz_control .next').stop(true,true).animate({opacity:0,width:0},100); 235 setTimeout(function(){ 236 $('#wizzard').stop(true,true).scrollLeft($('#wizzard table').width()-$('#wizzard td').width()); 237 },200); 238 } else { 239 $('#wizz_control .next').stop(true,true).animate({opacity:1,width:30},600); 240 } 241 242 }, 243 244 resize:function(){ 245 site.resize_notify(); 246 new_box={width:$(window).width(),height:$(window).height()}; 247 if (new_box.width!=site.box.width) { 248 site.init_wizzard1(); 249 } 250 site.box=new_box; 251 }, 252 253 init_controls:function(obj) { 254 //check 255 $(obj).find("a.check").click(function(){ 256 if ($(this).data('checked')) {
257 $(this).data('checked',false); 258 $(this).removeClass('checked'); 259 if ($(this).attr('data-type')) eval('site.wizzard1.'+$(this).attr('data-type')+'=0;'); 260 } else { 261 if ($(this).attr('data-type')) eval('site.wizzard1.'+$(this).attr('data-type')+'='+$(this).attr('data-value')+';'); 262 $(this).data('checked',true); 263 $(this).addClass('checked'); 264 } 265 return false; 266 }); 267 268 //radio 269 $(obj).find("a.radio").click(function(){ 270 $(this).parent().find('a.radio').each(function(){ 271 $(this).data('checked',false); 272 $(this).removeClass('checked'); 273 if ($(this).attr('data-type')) eval('site.wizzard1.'+$(this).attr('data-type')+'=0;'); 274 }); 275 if ($(this).attr('data-type')) eval('site.wizzard1.'+$(this).attr('data-type')+'='+$(this).attr('data-value')+';'); 276 $(this).data('checked',true); 277 $(this).addClass('checked'); 278 return false; 279 }); 280 $(obj).find(" * ").find(" a.radio:first").click(); 281 282 283 //check & radio hints 284 $(obj).find("#wizzard a.check, #wizzard a.radio").hover(function(){ 285 $('#wizzard_hints').html($(this).find('p').html()); 286 },function(){ 287 $('#wizzard_hints').html(''); 288 }); 289 290 //ajax 291 $(obj).find('.ajax_more').click(function(){ 292 $(this).parent().parent().empty().removeClass('slide').addClass('wait'); 293 return false; 294 }); 295 296 //digit_box inc 297 $(obj).find('.box_digit a.inc').click(function(){ 298 cp=Number($(this).parent().find('span').text()); 299 cp++; 300 if ($(this).attr('data-type')) eval('site.wizzard1.'+$(this).attr('data-type')+'='+cp+';'); 301 $(this).parent().find('span').text(cp); 302 $('body').focus(); 303 return false; 304 }); 305 306 //digit_box desc 307 $(obj).find('.box_digit a.dec').click(function(){ 308 cp=Number($(this).parent().find('span').text()); 309 cp--; 310 if (cp<1) cp=1; 311 if ($(this).attr('data-type')) eval('site.wizzard1.'+$(this).attr('data-type')+'='+cp+';'); 312 $(this).parent().find('span').text(cp); 313 $('body').focus(); 314 return false; 315 }); 316 317 318 //ajax 319 $(obj).find('.ajax_more').click(function(){ 320 $(this).parent().parent().empty().removeClass('slide').addClass('wait'); 321 return false; 322 }); 323 324 325 //cheeckbox 326 $('input:checkbox').checkbox(); 327 $('input:radio').checkbox({cls:'jquery-radiobox'}); 328 }, 329 330 busy:function(){ 331 $('body').animate({opacity:0.8},500); 332 $('#site_blocker').html('<div style="height:200px" class="wait"></div>'); 333 site.resize_notify(); 334 $('#site_blocker').css({opacity:1,display:'block'}); 335 return false; 336 }, 337 338 //preload 339 ready:function(page_id) { 340 //notification window 341 $('<div id="site_blocker"><div><div><h1></h1><p></p><div></div></div></div></div>').appendTo($('body')); 342 $('#site_blocker').mousewheel(function(event, delta) { 343 return false; 344 }); 345 346 347 //preload imgs 348 $.preloadImages(preloadImages,site.loaded); 349 350 351 ui_hints(); 352 window.alert=function(msg){ 353 msg=msg+''; 354 site.notify({text:msg.replace(/([^>]?)\n/g, '$1<br>\n')}); 355 }; 356 site.scroll_contacts(); 357 site.init_wizzard1(); 358 site.init_controls($('body')); 359 $(window).bind('resize',site.resize); 360}, 361 362 //after load 363 loaded:function (){ 364 365 //startpage 366 $("#portfolio .live-tile").each(function(){ 367 var $this=$(this); 368 setTimeout(function(){ 369 $this 370 .css({visibility:'visible',opacity:0.01}) 371 .animate({opacity:1},2000) 372 .liveTile({ 373 delay:20000, 374 initDelay:5000, 375 pauseOnHover:true, 376 preloadImages:true, 377 mode:(Math.random()>0.5)?'slide':'flip', 378 frontIsBackgroundImage:true, 379 direction:(Math.random()>0.5)?'horizontal':'vertical' 380 }) 381 ; 382 383 },500*(Math.floor(Math.random()*50)+10) 384 ) 385 }); 386 387 //portfolio 388 var $itr=0; 389 $(".live-tile.portfolio").each(function(){ 390 $itr++; 391 var $this=$(this); 392 setTimeout(function(){ 393 $this 394 .css({visibility:'visible',opacity:0}) 395 .animate({opacity:1},500) 396 .liveTile({ 397 delay:20000, 398 pauseOnHover:true, 399 initDelay:1000*(Math.floor(Math.random()*30)+1), 400 preloadImages:true, 401 mode:'slide', 402 direction:(Math.random()>0.5)?'horizontal':'vertical' 403 }); 404 },$itr*100) 405 }); 406 407 408 //blog 409 var $itr=0; 410 $(".live-tile.blog").each(function(){ 411 $itr++; 412 var $this=$(this); 413 setTimeout(function(){ 414 if (!$this.hasClass('static')) 415 $this 416 .css({visibility:'visible',opacity:0}
416) 417 .animate({opacity:1},500) 418 .liveTile({ 419 delay:20000, 420 initDelay:1000*((Math.floor(Math.random()*9+1)*10)), 421 preloadImages:true, 422 mode:'slide', 423 direction:(Math.random()>0.5)?'horizontal':'vertical' 424 }); 425 else 426 $this 427 .css({visibility:'visible',opacity:0}) 428 .animate({opacity:1},500); 429 430 },$itr*100) 431 }); 432 433 434 435 setTimeout(function(){ 436 $('#startpage').animate({'background-position':'0px -300px'},20000); 437 },5000); 438 439 }, 440 441 history_back:function(){ 442 setInterval(function(){ 443 //TODO 444 },1000); 445 } 446 447}; 448 449 450/** 451 * @author Alexander Farkas 452 * v. 1.02 453 */ 454(function($) { 455 $.extend($.fx.step,{ 456 backgroundPosition: function(fx) { 457 if (fx.state === 0 && typeof fx.end == 'string') { 458 var start = $.curCSS(fx.elem,'backgroundPosition'); 459 start = toArray(start); 460 fx.start = [start[0],start[2]]; 461 var end = toArray(fx.end); 462 fx.end = [end[0],end[2]]; 463 fx.unit = [end[1],end[3]]; 464 } 465 var nowPosX = []; 466 nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0]; 467 nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1]; 468 fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1]; 469 470 function toArray(strg){ 471 strg = strg.replace(/left|top/g,'0px'); 472 strg = strg.replace(/right|bottom/g,'100%'); 473 strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2"); 474 var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/); 475 return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]]; 476 } 477 } 478 }); 479})(jQuery); 480 481///////////////////// 482$.preloadImages = function () { 483 if (typeof arguments[arguments.length - 1] == 'function') { 484 var callback = arguments[arguments.length - 1]; 485 } else { 486 var callback = false; 487 } 488 if (typeof arguments[0] == 'object') { 489 var images = arguments[0]; 490 var n = images.length; 491 } else { 492 var images = arguments; 493 var n = images.length - 1; 494 } 495 var not_loaded = n; 496 for (var i = 0; i < n; i++) { 497 $(new Image()).load(function() { 498 if (--not_loaded < 1 && typeof callback == 'function') { 499 callback(); 500 } 501 }).attr('src', images[i]); 502 } 503} 504 505///////////////////////////
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.