1<!-- 2 3//waJSQuery.noConflict() 4waJSQuery(function() { 5 6/* 7 if (waJSQuery().waJSQuery!='1.7.1') 8 { 9 WA_loadScript("waJSQuery.js?v=86c",function(){ 10 */ 11 12 waJSQuery.fn.extend({ 13 disableSelection : function() { 14 this.each(function() { 15 this.onselectstart = function() { return false; }; 16 this.unselectable = "on"; 17 waJSQuery(this).css('-moz-user-select', 'none'); 18 waJSQuery(this).css('-webkit-user-select', 'none'); 19 }); 20 } 21 }); 22 23 waJSQuery.fn.extend({ everyTime: function(interval, label, fn, times, belay) { return this.each(function() { waJSQuery.timer.add(this, interval, label, fn, times, belay); }); }, oneTime: function(interval, label, fn) { return this.each(function() { waJSQuery.timer.add(this, interval, label, fn, 1); }); }, stopTime: function(label, fn) { return this.each(function() { waJSQuery.timer.remove(this, label, fn); }); } }); waJSQuery.extend({ timer: { guid: 1, global: {}, regex: /^([0-9]+)\s*(.*s)?$/, powers: { /* Yeah this is major overkill... */'ms': 1, 'cs': 10, 'ds': 100, 's': 1000, 'das': 10000, 'hs': 100000, 'ks': 1000000 }, timeParse: function(value) { if (value == undefined || value == null) return null; var result = this.regex.exec(waJSQuery.trim(value.toString())); if (result[2]) { var num = parseInt(result[1], 10); var mult = this.powers[result[2]] || 1; return num * mult; } else { return value; } }, add: function(element, interval, label, fn, times, belay) { var counter = 0; if (waJSQuery.isFunction(label)) { if (!times) times = fn; fn = label; label = interval; } interval = waJSQuery.timer.timeParse(interval); if (typeof interval != 'number' || isNaN(interval) || interval <= 0) return; if (times && times.constructor != Number) { belay = !!times; times = 0; } times = times || 0; belay = belay || false; if (!element.$timers) element.$timers = {}; if (!element.$timers[label]) element.$timers[label] = {}; fn.$timerID = fn.$timerID || this.guid++; var handler = function() { if (belay && this.inProgress) return; this.inProgress = true; if ((++counter > times && times !== 0) || fn.call(element, counter) === false) waJSQuery.timer.remove(element, label, fn); this.inProgress = false; }; handler.$timerID = fn.$timerID; if (!element.$timers[label][fn.$timerID]) element.$timers[label][fn.$timerID] = window.setInterval(handler,interval); if ( !this.global[label] ) this.global[label] = []; this.global[label].push( element ); }, remove: function(element, label, fn) { var timers = element.$timers, ret; if ( timers ) { if (!label) { for ( label in timers ) this.remove(element, label, fn); } else if ( timers[label] ) { if ( fn ) { if ( fn.$timerID ) { window.clearInterval(timers[label][fn.$timerID]); delete timers[label][fn.$timerID]; } } else { for ( var fn in timers[label] ) { window.clearInterval(timers[label][fn]); delete timers[label][fn]; } } for ( ret in timers[label] ) break; if ( !ret ) { ret = null; delete timers[label]; } } for ( ret in timers ) break; if ( !ret ) element.$timers = null; } } } }); if (waJSQuery.browser.msie) waJSQuery(window).one("unload", function() { var global = waJSQuery.timer.global; for ( var label in global ) { var els = global[label], i = els.length; while ( --i ) waJSQuery.timer.remove(els[i], label); } }); 24 25 if (document.internalPreview!=true) 26 { 27 waJSQuery(".wa-market-link").each(function() 28 { 29 var _lnk = waJSQuery(this); 30 _lnk.css("cursor","pointer") 31 //alert(_lnk) 32 _lnk.click(function() 33 { 34 javascript:WA_showMarketCart() 35 //// 36 }); 37 }); 38 } 39 // alert(waJSQuery().waJSQuery) 40 41}); 42 43 44/*******************/ 45/* DIVERS */ 46/*******************/ 47 48function waParseCleanStringJSON(s) 49{ 50 var _sep1 = "{" 51 var _sep2 = "}" 52 53 var _result="" 54 var c; 55 for (var i=0;i<s.length;i++) 56 { 57 c = s.charAt(i) 58 if (c=="\"") 59 { 60 do 61 { 62 i++; 63 c = s.charAt(i) 64 } 65 while (c!="\"") 66 } 67 if (c==_sep1) 68 { 69 var _countBracket = 0; 70 var _bOk = true; 71 var _isInString = false; 72 do 73 { 74 _bOk = true; 75 i++; 76 c = s.charAt(i) 77 if ((_isInString==false)&&(c=="\"")) 78 { 79 _isInString = true; 80 } 81 else 82 if ((_isInString==true)&&(c=="\"")) 83 { 84 _isInString = false;
85 } 86 87 if (_isInString==false) 88 { 89 if (c==_sep1) 90 { 91 _countBracket++; 92 } 93 if ((c!=_sep2)||(_countBracket!=0)) 94 { 95 _result+=c; 96 } 97 98 if (_countBracket>0) 99 if (c==_sep2) 100 { 101 _countBracket--; 102 _bOk = false 103 } 104 } 105 else 106 { 107 _result+=c; 108 } 109 110 111 112 } 113 while ((_bOk==false)||(c!=_sep2)||(_countBracket!=0)) 114 break; 115 } 116 } 117 118 _result = _sep1+_result+_sep2 119 120//alert(_result) 121 try { 122 return waJSQuery.parseJSON( _result ); 123 } 124 catch( e ) { 125 } 126 return null; 127} 128 129 130function waLoadGoogleFonts() 131{ 132 var wf = document.createElement('script'); 133 wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + 134 '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; 135 wf.type = 'text/javascript'; 136 wf.async = 'true'; 137 var s = document.getElementsByTagName('script')[0]; 138 s.parentNode.insertBefore(wf, s); 139} 140 141 142var BrowserDetect = { 143 init: function () { 144 this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; 145 this.version = this.searchVersion(navigator.userAgent) 146 || this.searchVersion(navigator.appVersion) 147 || "an unknown version"; 148 this.OS = this.searchString(this.dataOS) || "an unknown OS"; 149 }, 150 searchString: function (data) { 151 for (var i=0;i<data.length;i++) { 152 var dataString = data[i].string; 153 var dataProp = data[i].prop; 154 this.versionSearchString = data[i].versionSearch || data[i].identity; 155 if (dataString) { 156 if (dataString.indexOf(data[i].subString) != -1) 157 return data[i].identity; 158 } 159 else if (dataProp) 160 return data[i].identity; 161 } 162 }, 163 searchVersion: function (dataString) { 164 var index = dataString.indexOf(this.versionSearchString); 165 if (index == -1) return; 166 return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); 167 }, 168 dataBrowser: [ 169 { 170 string: navigator.userAgent, 171 subString: "Chrome", 172 identity: "Chrome" 173 }, 174 { string: navigator.userAgent, 175 subString: "OmniWeb", 176 versionSearch: "OmniWeb/", 177 identity: "OmniWeb" 178 }, 179 { 180 string: navigator.vendor, 181 subString: "Apple", 182 identity: "Safari", 183 versionSearch: "Version" 184 }, 185 { 186 prop: window.opera, 187 identity: "Opera", 188 versionSearch: "Version" 189 }, 190 { 191 string: navigator.vendor, 192 subString: "iCab", 193 identity: "iCab" 194 }, 195 { 196 string: navigator.vendor, 197 subString: "KDE", 198 identity: "Konqueror" 199 }, 200 { 201 string: navigator.userAgent, 202 subString: "Firefox", 203 identity: "Firefox" 204 }, 205 { 206 string: navigator.vendor, 207 subString: "Camino", 208 identity: "Camino" 209 }, 210 { // for newer Netscapes (6+) 211 string: navigator.userAgent, 212 subString: "Netscape", 213 identity: "Netscape" 214 }, 215 { 216 string: navigator.userAgent, 217 subString: "MSIE", 218 identity: "Explorer", 219 versionSearch: "MSIE" 220 }, 221 { 222 string: navigator.userAgent, 223 subString: "Gecko", 224 identity: "Mozilla", 225 versionSearch: "rv" 226 }, 227 { // for older Netscapes (4-) 228 string: navigator.userAgent, 229 subString: "Mozilla", 230 identity: "Netscape", 231 versionSearch: "Mozilla" 232 } 233 ], 234 dataOS : [ 235 { 236 string: navigator.platform, 237 subString: "Win", 238 identity: "Windows" 239 }, 240 { 241 string: navigator.platform, 242 subString: "Mac", 243 identity: "Mac" 244 }, 245 { 246 string: navigator.userAgent, 247 subString: "iPhone", 248 identity: "iPhone/iPod" 249 }, 250 { 251 string: navigator.platform, 252 subString: "Linux", 253 identity: "Linux" 254 } 255 ] 256 257}; 258BrowserDetect.init(); 259 260 261function RGBColor(_color_string) 262{ 263 this.ok = false;this.a = 1.0; 264 if (_color_string.charAt(0) == '#') { _color_string = _color_string.substr(1);} 265 _color_string = _color_string.replace(/ /g,''); 266 _color_string = _color_string.toLowerCase(); 267 var _color_defs = [ 268 {re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,2}\.*\d{0,2})\)$/,_process: function (bits){return [ parseInt(bits[1]),parseInt(bits[2]),parseInt(bits[3]),parseFloat(""+bits[4]) ]; }}, 269 {re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,_process: function (bits){ return [ parseInt(bits[1]),parseInt(bits[2]),parseInt(bits[3])];}}, 270 {re: /^(\w{2})(\w{2})(\w{2})(\w{2})$/,_process: function (bits){return [ parseInt(bits[1], 16),parseInt(bits[2], 16),parseInt(bits[3], 16),Math.round(parseInt(bits[4],16)*100/255)/100 ];}}, 271 {re: /^(\w{2})(\w{2})(\w{2})$/,_process: function (bits){return [ parseInt(bits[1], 16),parseInt(bits[2], 16),parseInt(bits[3], 16) ];}} 272 ]; 273 274 // search through the definitions to find a match 275 for (var i = 0; i < _color_defs.length; i++) { 276 var _re = _color_defs[i].re; 277 var _processor = _color_defs[i]._process; 278 // 279 var _bits = _re.exec(_color_string); 280 if (_bits) { 281 282 var _channels = _processor(_bits); 283 this.r = _channels[0];this.g = _channels[1];this.b = _channels[2];this.a = _channels[3]; 284 this.ok = true; 285 } 286 } 287 this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r); 288 this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g); 289 this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b); 290 this.a = (this.a > 1 || isNaN(this.a)) ? 1 : ((this.a < 0) ? 0 : this.a); 291 this.toRGB = function () 292 { 293 if (this.a==1)return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')'; 294 return 'rgba(' + this.r + ', ' + this.g + ', ' + this.b + ','+this.a+')'; 295 } 296
297 this.toRGB_opaque = function () 298 { 299 return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')'; 300 } 301 this._formatTo2Digit = function (_s) 302 { 303 if (_s.length==1)_s="0"+_s 304 return _s 305 } 306 this.toHexaOpaqueColor = function () 307 { 308 /* 309 var _decColor = this.r + 256 * this.g + 65536 * this.b; 310 return _decColor.toString(16); 311 */ 312 return "#"+this._formatTo2Digit(this.r.toString(16))+this._formatTo2Digit(this.g.toString(16))+this._formatTo2Digit(this.b.toString(16)); 313 } 314} 315 316function compliantColor(_rgba) 317{ 318 if (isMSIE_lower_than_ie9()) 319 { 320 if (_rgba=="") return ""; 321 if (_rgba=="transparent") return ""; 322 var _col = new RGBColor(_rgba) 323 324 if (_col.a==0) return "" 325 326 return _col.toHexaOpaqueColor(); 327 } 328 return _rgba; 329} 330 331//alert(compliantColor("rgba(255,0,0,0.5)")) 332 333 334 335 336function isProbablyRobot() 337{ 338 return BrowserDetect.browser.length==0 339 340} 341 342 343function isMSIE() 344{ 345 return BrowserDetect.browser=="Explorer" 346 347} 348function isFirefox() 349{ 350 return BrowserDetect.browser=="Firefox" 351 352// return true;//BrowserDetect.browser=="Explorer" 353} 354 355function isChrome() 356{ 357 return BrowserDetect.browser=="Chrome" 358} 359 360 361function isWindowsOS() 362{ 363 if (BrowserDetect.OS.match(/windows/i)) return true; 364 return false; 365} 366 367 368 369function isMSIE8() 370{ 371 if ((BrowserDetect.browser=="Explorer") && (BrowserDetect.version==8)) 372 { 373 return true; 374 } 375 return false; 376} 377 378function isMSIE_lower_than_ie9() 379{ 380 if (isMSIE()) 381 { 382 383 if (document.documentMode) 384 { 385 if (document.documentMode>=9) 386 { 387 return false; 388 } 389 } 390 391 return true; 392 393 } 394 return false; 395} 396 397function isMSIE_higher_than_ie8() 398{ 399 if (isMSIE()) 400 { 401 402 if (document.documentMode) 403 { 404 if (document.documentMode>=9) 405 { 406 return true; 407 } 408 } 409 410 return false; 411 412 } 413 return false; 414} 415function isWebKit() 416{ 417 if (navigator.userAgent.match(/webkit/i)) return true; 418 return false; 419} 420 421function isAndroidMobile() 422{ 423 if (navigator.userAgent.match(/android/i)) return true; 424 return false; 425} 426 427 428function isMobileBrowser() 429{ 430 if (navigator.userAgent.match(/(zunewp7|android|iphone|blackberry|symbian|symbianos|symbos|netfront|model-orange|javaplatform|iemobile|windows phone|samsung|htc|opera mobile|opera mobi|opera mini|presto|huawei|blazer|bolt|doris|fennec|gobrowser|iris|maemo browser|mib|cldc|minimo|semc-browser|skyfire|teashark|teleca|uzard|uzardweb|meego|nokia|bb10|playbook)/gi)) 431 { 432 return true; 433 } 434 return false; 435 //return isAppleMobile() || isAndroidMobile(); 436} 437 438function isChrome() 439{ 440 if ( navigator.userAgent.match(/Chrome/i) ) 441 return true; 442 return false; 443} 444 445function isWindowsMobile() 446{ 447 if (isMobileBrowser()) 448 { 449 if (isMSIE()) 450 { 451 return true; 452 } 453 } 454 return false; 455} 456 457function isAppleMobile() 458{ 459 return isIPhone() || isIPad() 460} 461 462function isTabletBrowser() 463{ 464 return isIPad() 465} 466 467function isIPad() 468{ 469 if ( navigator.userAgent.match(/iPad/i)) 470 return true; 471 return false; 472} 473 474function isIPhone() 475{ 476 if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ) 477 return true; 478 return false; 479} 480 481 482function extractNum(st) 483{ 484 var len = st.length 485 if ((len>0)&&(st.substring(len-2,len)=="px")) 486 { 487 return wa_evaluate(st.substring(0,len-2)) 488 } 489 return 0; 490} 491 492function waJSONLinkToHref(_lnk) 493{ 494 var _s="" 495 var _url=_lnk.url 496 var _lng=Translator.m_lang_for_filename 497 if (_lng.length>0)_lng="_"+_lng 498 _url = _url.replace(/@lng@/g,_lng) 499 500 var _js = _lnk.js 501 if (_js==undefined)_js = "" 502 503 504 _s+="href=\""+_url+"\" " 505 if (_lnk.open==1) 506 { 507 _s+="target=" 508 _s+="_blank " 509 } 510 511 if (_js.length>0) 512 { 513 _s += "onclick=waLaunchFunction(function(){"+_js+"}) " 514 } 515 return _s; 516} 517 518 519function waJSONLinkToOnClick(_lnk) 520{ 521 var _s="" 522 var _url=_lnk.url 523 var _lng=Translator.m_lang_for_filename 524 if (_lng.length>0)_lng="_"+_lng 525 _url = _url.replace(/@lng@/g,_lng) 526 var _target = ""; 527 if (_lnk.open==1) 528 { 529 _target="_blank" 530 } 531 var _js = _lnk.js 532 if (_js==undefined)_js = "" 533 534 _js = _js.replace(/\"/g,""") 535 536 _s+="onclick=\"waOnClick('"+_url+"',{'targ':'"+_target+"'"; 537 538 if (_js.length>0) 539 { 540 _s += ",'js':function(){"+_js+"}" 541 } 542 543 _s+="});return false;\" " 544 545 return _s; 546} 547 548function waLaunchFunction(_fct) 549{ 550 _fct() 551} 552 553function waOnClick(_url,_par) 554{ 555 if (_par.js!=undefined) 556 { 557 //launch js 558 try 559 { 560 _par.js() 561 } 562 catch(e) 563 { 564 alert('ERROR: javascript link '+_par.js) 565 } 566 567 } 568 569 if ((_url==undefined)||(_url.length==0)) return; 570// alert(_par.js) 571 var _target=_par.targ; 572 if (_target && _target.length>0) 573 { 574 if ((_target.length>0)&&(_target!="_blank")) 575 { 576 window.frames[_target].location.href = (_url) 577 } 578 else 579 { 580 window.open(_url,_target) 581 } 582 } 583 else 584 { 585 window.location.href = (_url) 586 } 587 return false; 588} 589/********************************/ 590/********** DIV UTILS ***********/ 591/********************************/ 592 593 594function waActivateDynamicLoader(_parent,_autoResize) 595{ 596 597 var _loader = _parent.find(".wa-dyn-loader") 598 if (_loader.data('timer_animation_initialized')==true) 599 { 600 return; 601 } 602 _loader.data('timer_animation_initialized',true) 603 //alert(_parent.length) 604 if (_autoResize) 605 { 606 _loader.css({"width":_parent.width(),"height":_parent.height()}) 607 } 608
609 var _delay = 65 610 var _delayMaxImg = 500; 611 var _img = _loader.children("img") 612 613 614 _loader.everyTime(_delay,function(i) 615 { 616 var _delayImage= waJSQuery(this).data("anim_delay_img") 617 if (_delayImage==undefined)_delayImage = _delay; 618 if (_delayImage>=_delayMaxImg) 619 { 620 _img.show() 621 } 622 623 var _frm = _loader.data("anim_frm") 624 if (_frm==undefined)_frm = 0; 625 626 var _size = 40 627 var _xImg = 0; 628 var _yImg = _frm*_size 629 var _xImg2 = _xImg+_size; 630 var _yImg2 = _yImg+_size;; 631 var _decX = (waJSQuery(this).width()-_size)/2 632 var _decY = (waJSQuery(this).height()-_size)/2 633 634 635 _img.css({"left":_decX,"top":-_yImg+_decY}) 636 637 638 _img.css({"clip":"rect("+_yImg+"px,"+_xImg2+"px,"+_yImg2+"px,"+_xImg+"px)"}) 639 _frm = (_frm+1)%12 640 waJSQuery(this).data("anim_frm",_frm) 641 _delayImage+=_delay 642 waJSQuery(this).data("anim_delay_img",_delayImage) 643 644 }); 645 646 647} 648 649function htmlDynamicLoader(_absolute,_width,_height) 650{ 651 652 var _s = "" 653 _s += "<div class='wa-dyn-loader' style=\""; 654 if (_absolute) 655 { 656 _s += "position:absolute;left:0px;top:0px;" 657 } 658 else 659 { 660 _s += "position:relative;left:0px;top:0px;" 661 } 662 _s += "width:"+_width+"px;height:"+_height+"px;" 663 _s += "overflow:hidden;" 664 665 666// _s += "border:1px solid red;" 667 var n = 0 668 var _size = 40 669 var _xImg = 0; 670 var _yImg = n*_size 671 var _xImg2 = _xImg+_size; 672 var _yImg2 = _yImg+_size;; 673 674// _s += "width:"+_size+"px;height:"+_size+"px;text-align:center;\">" 675 _s += ";\">" 676 _s += "<img style=\"position:absolute;border:none;left:0px;top:0px;"; 677 //_s += "width:"+_size+"px;height:"+_size+"px;" 678 _s += "display:none;" 679 _s += "clip:rect("+_yImg+"px,"+_xImg2+"px,"+_yImg2+"px,"+_xImg+"px);" 680 _s += "\" "; 681 _s += "src=\"wa_loading.png\" />" 682 _s += "</div>" 683 return _s; 684} 685 686 687 688 689function Size(lx,ly) 690{ 691 this._width = lx;this._height = ly; 692 this.width = function(){return this._width} 693 this.height = function(){return this._height} 694 695 this.clone = function(){return new Size(this._width,this._height)} 696 697 this.greaterThan = function(_s){if ( _s==undefined) return null; return (this._width>_s._width)&&(this._height>_s._height)} 698 699 this.toString=function() 700 { 701 return this.width()+"x"+this.height() 702 } 703 704 this.scale=function(_max,_canIncrease) 705 { 706 if (!_canIncrease)_canIncrease=false 707 var _size = this; 708 var _lx0=_size.width() 709 var _ly0=_size.height() 710 var p1 = _lx0 * _max.height(); 711 var p2 = _max.width() * _ly0; 712 var r1 = _lx0 / _ly0; 713 var r2 = _ly0 / _lx0; 714 var newSize1 = new Size(_max.height() * r1,_max.height()); 715 var newSize2 = new Size(_max.width(),_max.width() * r2); 716 if (p2 > p1) 717 { 718 if ((_canIncrease==true)||((newSize1.width()<=_size.width())&&(newSize1.height()<=_size.height()))) 719 { 720 _size._width= Math.round(newSize1.width()); 721 _size._height= Math.round(newSize1.height()); 722 } 723 } 724 else 725 { 726 if ((_canIncrease==true)||((newSize2.width()<=_size.width())&&(newSize2.height()<=_size.height()))) 727 { 728 _size._width= Math.round(newSize2.width()); 729 _size._height= Math.round(newSize2.height()); 730 } 731 } 732 this._width=_size.width(); 733 this._height=_size.height(); 734 735 return true; 736 } 737 this.scaleByExpanding=function(_max) 738 { 739 740 var _size = this; 741 var _lx0=_size.width() 742 var _ly0=_size.height() 743 744 var p1 = _lx0 * _max.height(); 745 var p2 = _max.width() * _ly0; 746 var r1 = _lx0 / _ly0; 747 var r2 = _ly0 / _lx0; 748 var newSize1 = new Size(_max.height() * r1,_max.height()); 749 var newSize2 = new Size(_max.width(),_max.width() * r2); 750 751 752 753 754 if (p2 < p1) 755 { 756 if ((newSize1.width()<=_size.width())&&(newSize1.height()<=_size.height())) 757 { 758 _size._width= Math.round(newSize1.width()); 759 _size._height= Math.round(newSize1.height()); 760 } 761 } 762 else 763 { 764 if ((newSize2.width()<=_size.width())&&(newSize2.height()<=_size.height())) 765 { 766 _size._width= Math.round(newSize2.width()); 767 _size._height= Math.round(newSize2.height()); 768 } 769 } 770 771 this._width=_size.width(); 772 this._height=_size.height(); 773 774 return true; 775 } 776} 777 778 779function Point(p_x,p_y){this.x = p_x;this.y = p_y; 780 this.translate = function(_x,_y){this.x+=_x;this.y+=_y;} 781 this.clone = function(){return new Point(this.x,this.y)} 782 } 783 784function Rect(p_x,p_y,lx,ly) 785{ 786 this.x = p_x;this.y = p_y;this.width = lx;this.height = ly; 787 this.clone = function(){return new Rect(this.x,this.y,this.width,this.height)} 788 this.equals = function(_o){return (this.x==_o.x)&&(this.y==_o.y)&&(this.width==_o.width)&&(this.height==_o.height);} 789 this.copy = function(_o){this.x=_o.x;this.y=_o.y;this.width=_o.width;this.height=_o.height;} 790 this.translate = function(_x,_y){this.x+=_x;this.y+=_y;} 791 this.isValid = function(){ return (this.width>0)&&(this.height>0);} 792} 793 794 795 796var _m_table_accent = [ 797 {acc:"e", l:["é","è","ë"]}
797, 798 {acc:"a", l:["à","ä","â","ã"]}, 799 {acc:"u", l:["ü","û"]}, 800 {acc:"c", l:["ç"]}, 801 {acc:"o", l:["ö","ô"]} 802 ]; 803 804function removeAccentsFromString(s) 805{ 806 var res = s.toLowerCase(); 807 for(var i=0;i<_m_table_accent.length;i++) 808 { 809 var array2 = _m_table_accent[i].l; 810 for(var i2=0;i2<array2.length;i2++) 811 { 812 var reg=new RegExp(array2[i2], "g"); 813 res=res.replace(reg,_m_table_accent[i].acc) 814 } 815 } 816 return res; 817} 818 819function IsNumeric(_sText) 820{ 821 var _ValidChars = "0123456789.";var _IsNumber=true;var _Char; 822 for (_i = 0; _i < _sText.length && _IsNumber == true; _i++){ _Char = _sText.charAt(_i);if (_ValidChars.indexOf(_Char) == -1) _IsNumber = false;} 823 return _IsNumber; 824} 825 826function getDocumentSize() 827{ 828 return new Size(waJSQuery(document).width(),waJSQuery(document).height()); 829} 830 831function getWindowSize() 832{ 833 834 if (isAppleMobile()) 835 { 836 return new Size(window.innerWidth,window.innerHeight); 837 } 838 839 return new Size(waJSQuery(window).width(),waJSQuery(window).height()); 840} 841 842 843function urlSuffixe(_delay_minuts) 844{ 845 var _freeCacheSecondeDelay = _delay_minuts * 60; 846 var _now_date = new Date(); 847 var _sec = 0; 848 _sec+=_now_date.getYear() * 12 * 31 * 24 * 60 * 60; 849 _sec+=_now_date.getMonth() * 31 * 24 * 60 * 60; 850 _sec+=_now_date.getDate() * 24 * 60 * 60; 851 _sec+=_now_date.getHours() * 60 * 60; 852 _sec+=_now_date.getMinutes() * 60; 853 _sec+=_now_date.getSeconds(); 854 if (_freeCacheSecondeDelay!=0) 855 { 856 _sec = Math.floor(_sec/_freeCacheSecondeDelay)*_freeCacheSecondeDelay 857 } 858 return "-"+_sec; 859} 860 861function urlAntiCacheForPreview() 862{ 863 if (document.webaca_is_preview) return urlSuffixe(0); 864 return ""; 865} 866 867 868 869function _disableMouseOverEvents() 870{ 871 var _list=document.getElementsByTagName("A"); 872 for (var _i=0;_i<_list.length;_i++) 873 { 874 var _o = _list[_i]; 875 if (_o.onmouseover)_o.onmouseover = null; 876 if (_o.onmouseout)_o.onmouseout = null; 877 } 878} 879 880function _enableFocusEvents() 881{ 882// alert("_enableFocusEvents"+document.wa_global_list_element.length) 883 for (var _n in document.wa_global_list_element) 884 { 885 var _id=document.wa_global_list_element[_n] 886 var _el = document.getElementById(_id) 887 _el.onclick = function() 888 { 889 WA_focus(this) 890 } 891 } 892} 893 894 895 896function WA_declare(_id) 897{ 898 if (!document.wa_global_list_element) 899 { 900 document.wa_global_list_element = new Array();; 901 } 902 document.wa_global_list_element.push(_id) 903} 904 905 906function _WA_getQueryInfo() 907{ 908 var _url = window.location.search; 909 if (_url.substr(0,1)=="?")_url=_url.substr(1); 910 if (_url.length==0)return; 911 var _qs = new Array(); 912 var _vars = _url.split("&"); 913 for (var i=0;i<_vars.length;i++) 914 { 915 var _pair = _vars[i].split("=");_qs[_pair[0]]=_pair[1]; 916 } 917 var _s_info = _qs["wa_key"]; 918 if (!_s_info)return; 919 var _query_info = new Array(); 920 _query_info.m_unid=_s_info; 921 _query_info.m_index_item=-1; 922 var _ind_sep_info = _s_info.indexOf("-") ; 923 if (_ind_sep_info != -1) 924 { 925 _query_info.m_unid=_s_info.substring(0,_ind_sep_info); 926 _query_info.m_index_item=parseInt(_s_info.substring(_ind_sep_info+1)); 927 } 928 document.wa_global_query_info=_query_info; 929// alert("#"+_query_info.m_unid+" "+_query_info.m_index_item+"#") 930} 931 932 933function IS_onload_WA() 934{ 935 if (isAppleMobile()) 936 { 937 _disableMouseOverEvents() 938 } 939 else 940 { 941 _enableFocusEvents() 942 } 943 944 _WA_getQueryInfo(); 945 // 946 947 948 /// 949 _WAcenterBackgroundImage() 950 951 952} 953 954 955function _WAcenterBackgroundImage() 956{ 957 958 959 var _bgOffsetX = 0; 960 var _bgOffsetY =document.webaca_banner_height; 961 962 var _bgALign = document.webaca_page_option_background 963 if (document.webaca_page_is_centered) 964 { 965 var _lxWin=getDocumentSize().width() 966 //var _lxWin=getWindowSize().width() 967 //getWindowSize() 968 var _lxPage=document.webaca_width_page 969 970 if ((_bgALign==0)||(_bgALign==1)) 971 { 972 if (_lxWin>_lxPage)_bgOffsetX=(_lxWin-_lxPage)/2; 973 } 974 else 975 if (_bgALign==2) 976 { 977 //nop 978 } 979 else 980 if (_bgALign==3)//center bg 981 { 982 _bgOffsetX=_lxWin/2-(document.webaca_page_background_img_size[0]/2); 983 } 984 985 } 986 if (document.body && document.body.style) 987 document.body.style.backgroundPosition=_bgOffsetX+"px "+_bgOffsetY+"px"; 988} 989 990waJSQuery(window).resize(function() {
991 _WAcenterBackgroundImage() 992}); 993 994/********************************/ 995/******** TRANSLATOR *************/ 996/********************************/ 997 998function WA_loadMessages() 999{ 1000 for (var k in CONST_WA_TR) 1001 { 1002 var key = CONST_WA_TR[k] 1003 Translator.m_tr[key[0]]=key[1] 1004 } 1005 for (var n=0;n<CONST_WA_COUNTRIES.codes.length;n++) 1006 { 1007 var _key = CONST_WA_COUNTRIES.codes[n] 1008 var _label = CONST_WA_COUNTRIES.labels[n] 1009 Translator.m_countries[_key]=_label 1010 } 1011} 1012 1013////// 1014function Translator() 1015{ 1016} 1017 1018Translator.m_tr = new Array(); 1019Translator.m_countries = new Array(); 1020Translator.tr=function(k,bEncodeBr) 1021{ 1022 try 1023 { 1024 var v = Translator.m_tr[k] 1025 if ((v==undefined)||(v.length==0))return "@"+k; 1026 if (bEncodeBr!=false) 1027 { 1028 v=v.replace(/\n/g,"<br>") 1029 } 1030 1031 return v 1032 } 1033 catch (e){} 1034 return k; 1035} 1036 1037 1038 1039 1040Translator.country=function(k) 1041{ 1042 try 1043 { 1044 var v = Translator.m_countries[k] 1045 if ((v==undefined)||(v.length==0))return "@"+k; 1046 return v 1047 } 1048 catch (e){} 1049 return k; 1050 1051} 1052 1053 1054////////////////////////// 1055 1056/////// 1057 1058 1059 1060function isOperaBrowser() 1061{ 1062 return (/opera/i.test(navigator.userAgent)) 1063} 1064 1065function WA_exec_callback_opera_compliant(_obj,_callback) 1066{ 1067 /* 1068 if(/opera/i.test(navigator.userAgent)) 1069 WA_exec_delayedCallback(_obj,_callback) 1070 else 1071 */ 1072 _callback.call(_obj) 1073} 1074 1075function WA_exec_delayedCallback(_obj,_callback) 1076{ 1077 wa_timeout(Delegate.create(_obj, _callback), 0); 1078} 1079 1080 1081///////////////// 1082 1083function WA_loadScript(url, callback,params) 1084{ 1085 1086 var e = document.createElement("script"); 1087 e.src = url; 1088 e.type = "text/javascript"; 1089 e.onerror=function(){callback(params,false);}// Other browsers 1090 if (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)) { 1091 // IE 1092 e.onreadystatechange = function(){ 1093 if ((this.readyState == 'complete')||(this.readyState == 'loaded')) { 1094 callback(params,true); 1095 } 1096 } 1097 } else 1098 { 1099 e.onload=function(){ 1100 //timeout ->bug sous opera 1101 1102 if (/opera/i.test(navigator.userAgent)) 1103 wa_timeout(callback,0,params,true); 1104 else 1105 callback(params,true); 1106 1107 }// Other browsers 1108 } 1109 document.getElementsByTagName("head")[0].appendChild(e); 1110} 1111 1112 1113function WA_onSearch(_id_input) 1114{ 1115 1116 1117 var _input = document.getElementById(_id_input); 1118 if (document.wa_search_js_loaded == true) 1119 { 1120 WA_openSearchDialog(_input,document.const_wa_search_index_js) 1121 } 1122 else 1123 { 1124 WA_Dialog.progress(); 1125 _WA_loadSearchLibrary(_input) 1126 } 1127} 1128 1129function _WA_SearchLibraryLoaded(_params) 1130{ 1131 document.wa_search_js_loaded = true 1132 WA_openSearchDialog(_params[0],document.const_wa_search_index_js) 1133} 1134 1135 1136function _WA_loadSearchLibrary(_input_field) 1137{ 1138 WA_loadScript(document.const_wa_search_js,_WA_SearchLibraryLoaded,[_input_field]) 1139} 1140 1141 1142function _getCookieVal(offset) { 1143 var endstr=document.cookie.indexOf (";", offset); 1144 if (endstr==-1) 1145 endstr=document.cookie.length; 1146 return unescape(document.cookie.substring(offset, endstr)); 1147} 1148 1149function WA_GetCookie(name) 1150{ 1151 var arg=name+"="; 1152 var alen=arg.length; 1153 var clen=document.cookie.length; 1154 var i=0; 1155 while (i<clen) 1156 { 1157 var j=i+alen; 1158 if (document.cookie.substring(i, j)==arg) 1159 return _getCookieVal (j); 1160 i=document.cookie.indexOf(" ",i)+1; 1161 if (i==0) break; 1162 } 1163 return ""; 1164} 1165 1166function WA_SetCookie (name, value) { 1167 var argv=WA_SetCookie.arguments; 1168 var argc=WA_SetCookie.arguments.length; 1169 var expires=(argc > 2) ? argv[2] : null; 1170 var path=(argc > 3) ? argv[3] : null; 1171 var domain=(argc > 4) ? argv[4] : null; 1172 var secure=(argc > 5) ? argv[5] : false; 1173 document.cookie=name+"="+escape(value)+ 1174 ((expires==null) ? "" : ("; expires="+expires.toGMTString()))+ 1175 ((path==null) ? "" : ("; path="+path))+ 1176 ((domain==null) ? "" : ("; domain="+domain))+ 1177 ((secure==true) ? "; secure" : ""); 1178} 1179 1180 1181/* 1182function RGBColor(_color_string) 1183{ 1184 this.ok = false;this.a = 1.0; 1185 if (_color_string.charAt(0) == '#') { _color_string = _color_string.substr(1);} 1186 _color_string = _color_string.replace(/ /g,''); 1187 _color_string = _color_string.toLowerCase(); 1188 var _color_defs = [ 1189 {re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,2}\.*\d{0,2})\)$/,_process: function (bits){return [ parseInt(bits[1]),parseInt(bits[2]),parseInt(bits[3]),parseFloat(""+bits[4]) ]; }}, 1190 {re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,_process: function (bits){ return [ parseInt(bits[1]),parseInt(bits[2]),parseInt(bits[3])];}}, 1191 {re: /^(\w{2})(\w{2})(\w{2})(\w{2})$/,_process: function (bits){return [ parseInt(bits[1], 16),parseInt(bits[2], 16),parseInt(bits[3], 16),Math.round(parseInt(bits[4],16)*100/255)/100 ];}}, 1192 {re: /^(\w{2})(\w{2})(\w{2})$/,_process: function (bits){return [ parseInt(bits[1], 16),parseInt(bits[2], 16),parseInt(bits[3], 16) ];}} 1193 ]; 1194 1195 // search through the definitions to find a match 1196 for (var i = 0; i < _color_defs.length; i++) { 1197 var _re = _color_defs[i].re; 1198 var _processor = _color_defs[i]._process; 1199 // 1200 var _bits = _re.exec(_color_string); 1201 if (_bits) { 1202 1203 var _channels = _processor(_bits); 1204 this.r = _channels[0];this.g = _channels[1];this.b = _channels[2];this.a = _channels[3]; 1205 this.ok = true; 1206 } 1207 } 1208 this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r); 1209 this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g); 1210 this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b); 1211 this.a = (this.a > 1 || isNaN(this.a)) ? 1 : ((this.a < 0) ? 0 : this.a); 1212 this.toRGB = function () 1213 { 1214 if (this.a==1)return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')'; 1215 return 'rgba(' + this.r + ', ' + this.g + ', ' + this.b + ','+this.a+')'; 1216 } 1217
1218 this.toRGB_opaque = function () 1219 { 1220 return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')'; 1221 } 1222 1223 this.toHsl = function(){ 1224 var r = this.r;var g = this.g;var b = this.b;r /= 255, g /= 255, b /= 255; 1225 var max = Math.max(r, g, b), min = Math.min(r, g, b); 1226 var h, s, l = (max + min) / 2; 1227 if(max == min){h = s = 0; // achromatic 1228 }else{ 1229 var d = max - min;s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 1230 switch(max){ 1231 case r: h = (g - b) / d + (g < b ? 6 : 0); break; 1232 case g: h = (b - r) / d + 2; break; 1233 case b: h = (r - g) / d + 4; break; 1234 } 1235 h /= 6; 1236 } 1237 return [h, s, l]; 1238 } 1239 // 1240 this._hue2rgb=function(p, q, t) 1241 { 1242 if(t < 0) t += 1;if(t > 1) t -= 1;if(t < 1/6) return p + (q - p) * 6 * t;if(t < 1/2) return q;if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; 1243 return p; 1244 }; 1245 this.fromHsl = function(h, s, l){ 1246 if (l>1.0)l=1.0 1247 var r, g, b; 1248 if(s == 0){r = g = b = l; // achromatic 1249 }else{ 1250 var q = l < 0.5 ? l * (1 + s) : l + s - l * s; 1251 var p = 2 * l - q; 1252 r = this._hue2rgb(p, q, h + 1/3);g = this._hue2rgb(p, q, h);b = this._hue2rgb(p, q, h - 1/3); 1253 } 1254 r= r * 255;g= g * 255;b= b * 255; 1255 r = Math.round(r);g = Math.round(g);b = Math.round(b); 1256 if (r<0)r=-r;if (g<0)g=-g;if (b<0)b=-b 1257 this.r = r;this.g = g;this.b = b; 1258 }; 1259} 1260*/ 1261/////// 1262function MD5(string) { 1263 1264 function RotateLeft(lValue, iShiftBits) { 1265 return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits)); 1266 } 1267 1268 function AddUnsigned(lX,lY) { 1269 var lX4,lY4,lX8,lY8,lResult; 1270 lX8 = (lX & 0x80000000); 1271 lY8 = (lY & 0x80000000); 1272 lX4 = (lX & 0x40000000); 1273 lY4 = (lY & 0x40000000); 1274 lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF); 1275 if (lX4 & lY4) { 1276 return (lResult ^ 0x80000000 ^ lX8 ^ lY8); 1277 } 1278 if (lX4 | lY4) { 1279 if (lResult & 0x40000000) { 1280 return (lResult ^ 0xC0000000 ^ lX8 ^ lY8); 1281 } else { 1282 return (lResult ^ 0x40000000 ^ lX8 ^ lY8); 1283 } 1284 } else { 1285 return (lResult ^ lX8 ^ lY8); 1286 } 1287 } 1288 1289 function F(x,y,z) { return (x & y) | ((~x) & z); } 1290 function G(x,y,z) { return (x & z) | (y & (~z)); } 1291 function H(x,y,z) { return (x ^ y ^ z); } 1292 function I(x,y,z) { return (y ^ (x | (~z))); } 1293 1294 function FF(a,b,c,d,x,s,ac) { 1295 a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); 1296 return AddUnsigned(RotateLeft(a, s), b); 1297 }; 1298 1299 function GG(a,b,c,d,x,s,ac) { 1300 a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); 1301 return AddUnsigned(RotateLeft(a, s), b); 1302 }; 1303 1304 function HH(a,b,c,d,x,s,ac) { 1305 a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); 1306 return AddUnsigned(RotateLeft(a, s), b); 1307 }; 1308 1309 function II(a,b,c,d,x,s,ac) { 1310 a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); 1311 return AddUnsigned(RotateLeft(a, s), b); 1312 }; 1313 1314 function ConvertToWordArray(string) { 1315 var lWordCount; 1316 var lMessageLength = string.length; 1317 var lNumberOfWords_temp1=lMessageLength + 8; 1318 var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64; 1319 var lNumberOfWords = (lNumberOfWords_temp2+1)*16; 1320 var lWordArray=Array(lNumberOfWords-1); 1321 var lBytePosition = 0; 1322 var lByteCount = 0; 1323 while ( lByteCount < lMessageLength ) { 1324 lWordCount = (lByteCount-(lByteCount % 4))/4; 1325 lBytePosition = (lByteCount % 4)*8; 1326 lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition)); 1327 lByteCount++; 1328 } 1329 lWordCount = (lByteCount-(lByteCount % 4))/4; 1330 lBytePosition = (lByteCount % 4)*8; 1331 lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition); 1332 lWordArray[lNumberOfWords-2] = lMessageLength<<3; 1333 lWordArray[lNumberOfWords-1] = lMessageLength>>>29; 1334 return lWordArray; 1335 }; 1336 1337 function WordToHex(lValue) { 1338 var WordToHexValue="",WordToHexValue_temp="",lByte,lCount; 1339 for (lCount = 0;lCount<=3;lCount++) { 1340 lByte = (lValue>>>(lCount*8)) & 255; 1341 WordToHexValue_temp = "0" + lByte.toString(16); 1342 WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2); 1343 } 1344 return WordToHexValue; 1345 }; 1346 1347 function Utf8Encode(string) { 1348 string = string.replace(/\r\n/g,"\n"); 1349 var utftext = ""; 1350 1351 for (var n = 0; n < string.length; n++) { 1352 1353 var c = string.charCodeAt(n); 1354 1355 if (c < 128) { 1356 utftext += String.fromCharCode(c); 1357 } 1358 else if((c > 127) && (c < 2048)) { 1359 utftext += String.fromCharCode((c >> 6) | 192); 1360 utftext += String.fromCharCode((c & 63) | 128); 1361 } 1362 else { 1363 utftext += String.fromCharCode((c >> 12) | 224); 1364 utftext += String.fromCharCode(((c >> 6) & 63) | 128); 1365 utftext += String.fromCharCode((c & 63) | 128); 1366 } 1367 1368 } 1369 1370 return utftext; 1371 }; 1372 1373 var x=Array(); 1374 var k,AA,BB,CC,DD,a,b,c,d; 1375 var S11=7, S12=12, S13=17, S14=22; 1376 var S21=5, S22=9 , S23=14, S24=20; 1377 var S31=4, S32=11, S33=16, S34=23; 1378 var S41=6, S42=10, S43=15, S44=21; 1379 1380 string = Utf8Encode(string); 1381 1382 x = ConvertToWordArray(string); 1383 1384 a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; 1385 1386 for (k=0;k<x.length;k+=16) { 1387 AA=a; BB=b; CC=c; DD=d; 1388 a=FF(a,b,c,d,x[k+0], S11,0xD76AA478); 1389 d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756); 1390 c=FF(c,d,a,b,x[k+2], S13,0x242070DB); 1391 b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE); 1392 a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF); 1393 d=FF(d,a,b,c,x[k+5], S12,0x4787C62A); 1394 c=FF(c,d,a,b,x[k+6], S13,0xA8304613); 1395 b=FF(b,c,d,a,x[k+7], S14,0xFD469501); 1396 a=FF(a,b,c,d,x[k+8], S11,0x698098D8); 1397 d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF); 1398 c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1); 1399 b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE); 1400 a=FF(a,b,c,d,x[k+12],S11,0x6B901122); 1401 d=FF(d,a,b,c,x[k+13],S12,0xFD987193); 1402 c=FF(c,d,a,b,x[k+14],S13,0xA679438E); 1403 b=FF(b,c,d,a,x[k+15],S14,0x49B40821); 1404 a=GG(a,b,c,d,x[k+1], S21,0xF61E2562); 1405 d=GG(d,a,b,c,x[k+6], S22,0xC040B340); 1406 c=GG(c,d,a,b,x[k+11],S23,0x265E5A51); 1407 b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA); 1408 a=GG(a,b,c,d,x[k+5], S21,0xD62F105D); 1409 d=GG(d,a,b,c,x[k+10],S22,0x2441453); 1410 c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681); 1411 b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8); 1412 a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6); 1413 d=GG(d,a,b,c,x[k+14],S22,0xC33707D6); 1414 c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87); 1415 b=GG(b,c,d,a,x[k+8], S24,0x455A14ED); 1416 a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905); 1417 d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8); 1418 c=GG(c,d,a,b,x[k+7], S23,0x676F02D9); 1419 b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A); 1420 a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
1421 d=HH(d,a,b,c,x[k+8], S32,0x8771F681); 1422 c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122); 1423 b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C); 1424 a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44); 1425 d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9); 1426 c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60); 1427 b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70); 1428 a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6); 1429 d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA); 1430 c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085); 1431 b=HH(b,c,d,a,x[k+6], S34,0x4881D05); 1432 a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039); 1433 d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5); 1434 c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8); 1435 b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665); 1436 a=II(a,b,c,d,x[k+0], S41,0xF4292244); 1437 d=II(d,a,b,c,x[k+7], S42,0x432AFF97); 1438 c=II(c,d,a,b,x[k+14],S43,0xAB9423A7); 1439 b=II(b,c,d,a,x[k+5], S44,0xFC93A039); 1440 a=II(a,b,c,d,x[k+12],S41,0x655B59C3); 1441 d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92); 1442 c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D); 1443 b=II(b,c,d,a,x[k+1], S44,0x85845DD1); 1444 a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F); 1445 d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0); 1446 c=II(c,d,a,b,x[k+6], S43,0xA3014314); 1447 b=II(b,c,d,a,x[k+13],S44,0x4E0811A1); 1448 a=II(a,b,c,d,x[k+4], S41,0xF7537E82); 1449 d=II(d,a,b,c,x[k+11],S42,0xBD3AF235); 1450 c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB); 1451 b=II(b,c,d,a,x[k+9], S44,0xEB86D391); 1452 a=AddUnsigned(a,AA); 1453 b=AddUnsigned(b,BB); 1454 c=AddUnsigned(c,CC); 1455 d=AddUnsigned(d,DD); 1456 } 1457 1458 var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d); 1459 1460 return temp.toLowerCase(); 1461} 1462 1463/* 1464function htmlImageResource(_nImage) 1465{ 1466 var _sizeImg = [ 1467 [26,18],[19,19],[25,16],[10,10],[15,15],[15,15], 1468 [18,18],[ 9, 9],[12, 8],[12, 8],[11,11],[15,12] 1469 ] 1470 var _matrixCols = 6; 1471 var _matrix = 41; 1472 var _colImage = _nImage%_matrixCols 1473 var _rowImage = Math.floor((_nImage*_matrix)/(_matrixCols*_matrix)) 1474 var _xImg = _colImage*_matrix; 1475 var _yImg = _rowImage*_matrix 1476 var _xImg2 = _xImg+_sizeImg[_nImage][0]; 1477 var _yImg2 = _yImg+_sizeImg[_nImage][1];; 1478 var _lx=_sizeImg[_nImage][0]-1 1479 var _ly=_sizeImg[_nImage][1]-1 1480 var _src = 'webacappella4.png' 1481 var _imgHtml = "" 1482// window.status = _xImg+" "+_yImg+" "+ _xImg2+" "+_yImg2+ " "+_rowImage+"x"+_colImage 1483 _imgHtml = "<div style='position:absolute;width:"+_lx+"px;height:"+_ly+"px;'><img src='"+_src+"' style='position:absolute;"; 1484 1485// _imgHtml+="-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-o-user-select: none;user-select: none;" 1486 _imgHtml+="left:"+(-_xImg)+"px;top:"+(-_yImg)+"px;clip:rect("+_yImg+"px,"+_xImg2+"px,"+_yImg2+"px,"+_xImg+"px);'></div>" 1487 1488 _imgHtml = "<div style='position:absolute;;width:"+_lx+"px;height:"+_ly+"px;" 1489 //_imgHtml +="-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-o-user-select: none;user-select: none;" 1490 _imgHtml += "'>"; 1491 1492 _imgHtml += "<div style='"; 1493 _imgHtml+="position:absolute;" 1494 _imgHtml+="width:"+((_colImage+1)*_matrix)+"px;height:"+((_rowImage+1)*_matrix)+"px;" 1495 _imgHtml+="background:url("+_src+");" 1496 _imgHtml+="left:"+(-_xImg)+"px;top:"+(-_yImg)+"px;" 1497 _imgHtml+="clip:rect("+_yImg+"px,"+_xImg2+"px,"+_yImg2+"px,"+_xImg+"px);" 1498 _imgHtml+="'> </div> </div>" 1499 1500//alert(_imgHtml) 1501 return _imgHtml; 1502} 1503*/ 1504 1505 1506 1507function centerTextContent(_o) 1508{ 1509 var _label = _o.html() 1510 _o.html("<div class='inner-content' style='position:absolute;'></div>") 1511 var _inner = _o.find(".inner-content") 1512 _inner.html(_label) 1513 _inner.css({top:(_o.height()-_inner.height())/2,left:(_o.width()-_inner.width())/2}) 1514} 1515 1516 1517 1518function centerElement(_elem,_class) 1519{ 1520var _img = _elem.children(_class) 1521_img.css("left",(_elem.width()-_img.width())/2) 1522_img.css("top",(_elem.height()-_img.height())/2) 1523} 1524 1525/* 1526var s = "bg1(#ff0000 #ff000) bg(rbga(1,2,3,4) #ff0000) bg2()" 1527var ar = splitClassParameters(s,"(",")") 1528alert(ar['bg']) 1529*/ 1530function splitClassParameters(s,sep1,sep2) 1531{ 1532 s = jQuery.trim(s); 1533 var arr = new Array() 1534 var clName="" 1535 var clParam = "" 1536 var c; 1537 for (var i=0;i<s.length;i++) 1538 { 1539 c = s.charAt(i) 1540 if ((c==' ')||(c=='\n')||(c==sep2)) 1541 { 1542 arr[clName] = clParam; 1543 1544 clName = "" 1545 clParam = "" 1546 } 1547 else 1548 if (c==sep1) 1549 { 1550 var _countBracket = 0; 1551 var _bOk = true; 1552 do 1553 { 1554 _bOk = true; 1555 i++; 1556 c = s.charAt(i) 1557 1558 if (c==sep1) 1559 { 1560 _countBracket++; 1561 } 1562 1563 if ((c!=sep2)||(_countBracket!=0)) 1564 { 1565 clParam+=c; 1566 } 1567 1568 if (_countBracket>0) 1569 if (c==sep2) 1570 { 1571 _countBracket--; 1572 _bOk = false 1573 } 1574 } 1575 while ((_bOk==false)||(c!=sep2)||(_countBracket!=0)) 1576 //alert(clName+"="+clParam) 1577 } 1578 else 1579 { 1580 clName+=c; 1581 } 1582 } 1583 if (clName.length>0) 1584 { 1585 arr[clName] = clParam; 1586 } 1587 1588 return arr; 1589} 1590 1591 1592function splitClass(s) 1593{ 1594 var arr = splitClassParameters(s,'[',']') 1595 1596 for (k in arr) 1597 { 1598 var v = arr[k]; 1599 1600 if (v.length>0) 1601 { 1602 1603 var arr2 = splitClassParameters(v,'(',')') 1604 for (k2 in arr2) 1605 { 1606 alert("#"+k+" "+k2+ " = "+arr2[k2]) 1607 } 1608 } 1609 } 1610} 1611 1612function extractClassInfo(s,className) 1613{ 1614 //alert('extractClassInfo '+className) 1615 var arr = splitClassParameters(s,'[',']') 1616 1617 for (k in arr) 1618 { 1619 1620 var v = arr[k]; 1621 1622 1623 if (v.length>0) 1624 { 1625 // 1626 if (k == className) 1627 { 1628 1629 // 1630 var arr2 = splitClassParameters(v,'(',')') 1631 //alert("splitClassParameters="+v+" "+arr2.length) 1632 // alert("extractClassInfo "+k+" "+arr2['bg']) 1633 return arr2; 1634 } 1635 } 1636 } 1637 return null 1638} 1639 1640 1641function extractParamInfo(_o,_nameParam,_blocName) 1642{ 1643 if (_blocName==undefined)_blocName="param" 1644 if (_o==undefined) return "" 1645 var _cl = _o.attr("class"); 1646 //alert(_cl) 1647 if (_cl==undefined) return "" 1648 var _clParam = extractClassInfo(_cl,_blocName); 1649 1650// alert(_cl+" "+_clParam) 1651 if (_clParam==null) return "" 1652 if (_clParam==undefined) return "" 1653 if (_clParam[_nameParam]==undefined) return "" 1654 1655 if (_nameParam) return _clParam[_nameParam] 1656 return _clParam; 1657} 1658 1659 1660/*******************/ 1661/* initializeWA_waJSQuery */ 1662/*******************/ 1663 1664function getBrowserInfos() 1665{ 1666 var _map={ 1667 } 1668 if (waJSQuery.browser.webkit)_map.engine = "webkit" 1669 if (waJSQuery.browser.mozilla)_map.engine = "ff" 1670 if (waJSQuery.browser.msie)_map.engine = "ie" 1671 1672 1673 return _map 1674} 1675 1676 1677function waSetVisibilityMainPageContenair(_b) 1678{ 1679 1680 if (_b) 1681 { 1682 waJSQuery(".wa-video").show() 1683 } 1684 else 1685 { 1686 waJSQuery(".wa-video").hide() 1687 } 1688 1689 1690} 1691 1692function isValidEmailAddress(_email) 1693{ 1694var _pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); 1695return _pattern.test(_email); 1696} 1697 1698 1699 1700function _waDrawRect(c,x,y,lx,ly) 1701{ 1702 c.beginPath(); 1703 c.moveTo(x,y); 1704 c.lineTo(x+lx,y); 1705 c.lineTo(x+lx,y+ly); 1706 c.lineTo(x,y+ly); 1707 c.lineTo(x,y); 1708 c.closePath(); 1709} 1710 1711/* 1712function _waDrawRoundedRect(c,x,y,lx,ly,_arc) 1713{ 1714 c.beginPath(); 1715 _waBasicDrawRoundedRect(c,x,y,lx,ly,_arc) 1716 c.closePath(); 1717} 1718*/ 1719function _waBasicDrawRoundedRect(c,x,y,lx,ly,_arc,_clowckwise) 1720{ 1721 if (typeof(_arc)=="number") 1722 { 1723 _arc = [_arc,_arc,_arc,_arc] 1724 } 1725 if (_clowckwise) 1726 { 1727 1728 //alert(_arc[0]+1) 1729 c.moveTo(x+_arc[0],y);c.lineTo(x+lx-_arc[1],y);c.quadraticCurveTo(x+lx,y,x+lx,y+_arc[1]);c.lineTo(x+lx,y+ly-_arc[2]);c.quadraticCurveTo(x+lx,y+ly,x+lx-_arc[2],y+ly);c.lineTo(x+_arc[3],y+ly);c.quadraticCurveTo(x,y+ly,x,y+ly-_arc[3]);c.lineTo(x,y+_arc[0]);
1729c.quadraticCurveTo(x,y,x+_arc[0],y); 1730 // c.lineTo(x,y+_arc[0]); 1731 1732 return; 1733 } 1734 c.moveTo(x,y+_arc[0]);c.lineTo(x,y+ly-_arc[3]);c.quadraticCurveTo(x,y+ly,x+_arc[3],y+ly);c.lineTo(x+lx-_arc[2],y+ly);c.quadraticCurveTo(x+lx,y+ly,x+lx,y+ly-_arc[2]);c.lineTo(x+lx,y+_arc[1]);c.quadraticCurveTo(x+lx,y,x+lx-_arc[1],y);c.lineTo(x+_arc[0],y);c.quadraticCurveTo(x,y,x,y+_arc[0]); 1735 //c.lineTo(x,y+_arc[0]); 1736} 1737 1738function waExtractCssStyle(_s,_key) 1739{ 1740 return _waExtractCssStyle(_s,_key); 1741} 1742function _waExtractCssStyle(_s,_key) 1743{ 1744 //alert(_s) 1745 if (_s==undefined) return "" 1746 var _n0 = _s.indexOf(_key); 1747 if ( (_n0>-1) || ((_n0>0) && (_s.substring(_n0-1)==";")) ) 1748 { 1749 _s = _s.substring(_n0) 1750 _n0 = _s.indexOf(";"); 1751 if (_n0>-1) 1752 { 1753 _s= _s.substring(0,_n0) 1754 // alert("css="+_s) 1755 _n0 = _s.indexOf(":"); 1756 if (_n0>-1) 1757 { 1758 _s= _s.substring(_n0+1) 1759 } 1760 1761 return waJSQuery.trim(_s); 1762 } 1763 else 1764 { 1765 _n0 = _s.indexOf(":"); 1766 if (_n0>-1) 1767 { 1768 _s= _s.substring(_n0+1) 1769 } 1770 1771 return waJSQuery.trim(_s); 1772 } 1773 } 1774 return ""; 1775} 1776 1777function waExtractRadiusFromCss(_o) 1778{ 1779 var _borderWidth = 0; 1780 var _CSSStr = _o.attr("style"); 1781 1782 //alert(_CSSStr) 1783 var _tagBorderRadius = "border-radius" 1784 1785 if (isMSIE_higher_than_ie8()) 1786 { 1787 _tagBorderRadius = "-moz-border-radius" //bizarrement le tag est tronqué sous IE9 1788 } 1789 var _radiusStr= _waExtractCssStyle(_CSSStr,_tagBorderRadius) 1790// alert("@@@ " +_radiusStr+ " "+_CSSStr) 1791 if (_radiusStr.length==0) 1792 { 1793 // alert(_CSSStr) 1794 var _arc0 = _waExtractCssStyle(_CSSStr,"border-top-left-radius") 1795 var _arc1 = _waExtractCssStyle(_CSSStr,"border-top-right-radius") 1796 var _arc2 = _waExtractCssStyle(_CSSStr,"border-bottom-right-radius") 1797 var _arc3 = _waExtractCssStyle(_CSSStr,"border-bottom-left-radius") 1798 /* 1799 if (_arc0.length==0)_arc0 = _waExtractCssStyle(_CSSStr,"border-left-top-radius") 1800 if (_arc1.length==0)_arc1 = _waExtractCssStyle(_CSSStr,"border-right-top-radius") 1801 if (_arc2.length==0)_arc2 = _waExtractCssStyle(_CSSStr,"border-right-bottom-radius") 1802 if (_arc3.length==0)_arc3 = _waExtractCssStyle(_CSSStr,"border-left-bottom-radius") 1803 */ 1804 if (_arc0.length==0)_arc0="0px" 1805 if (_arc1.length==0)_arc1="0px" 1806 if (_arc2.length==0)_arc2="0px" 1807 if (_arc3.length==0)_arc3="0px" 1808 1809 _radiusStr=_arc0+" "+_arc1+" "+_arc2+" "+_arc3 1810 1811 //alert(_radiusStr) 1812 //border-top-left-radius 1813 // alert(splitradiusStr) 1814 } 1815// alert("@@# "+_radiusStr) 1816 1817 1818 var splitradiusStr = _radiusStr.split(" ") 1819 1820// alert(_radiusStr+" "+splitradiusStr.length) 1821 1822 1823 1824 // alert("@"+_radiusStr.substring(_tagBorderRadius.length+1)+"@ "+ splitradiusStr[0]+" "+splitradiusStr[1]) 1825 1826 var _arc1=Math.max(0,parseInt(splitradiusStr[0])-_borderWidth) 1827 var _arc2=Math.max(0,parseInt(splitradiusStr[1])-_borderWidth) 1828 var _arc3=Math.max(0,parseInt(splitradiusStr[2])-_borderWidth) 1829 var _arc4=Math.max(0,parseInt(splitradiusStr[3])-_borderWidth) 1830 if (splitradiusStr.length==1) 1831 { 1832 _arc2=_arc1;_arc3=_arc1;_arc4=_arc1; 1833 } 1834 /* 1835 if (isNaN(_arc1))_arc1 = 0 1836 if (isNaN(_arc2))_arc2 = 0 1837 if (isNaN(_arc3))_arc3 = 0 1838 if (isNaN(_arc4))_arc4 = 0 1839 */ 1840 1841 if (isNaN(_arc1))_arc1 = 0 1842 if (isNaN(_arc2))_arc2 = _arc1 1843 if (isNaN(_arc3))_arc3 = _arc2 1844 if (isNaN(_arc4))_arc4 = _arc3 1845 1846 return new Array(_arc1,_arc2,_arc3,_arc4) 1847} 1848 1849function waSoustractFromArrayRadius(_arr,_val) 1850{ 1851 for (var i=0;i<_arr.length;i++) 1852 { 1853 if (isNaN(_arr[i])||(_arr[i].length==0)) 1854 { 1855 _arr[i] = 0 1856 } 1857 else 1858 { 1859 _arr[i] = Math.max(0,_arr[i]-_val) 1860 } 1861 1862 } 1863 return _arr; 1864} 1865 1866 1867 1868function waGenerateNewGradientID() 1869{ 1870 var _curId = waJSQuery(document).data("curCanvasGradientId") 1871 if (_curId==undefined)_curId=0; 1872 waJSQuery(document).data("curCanvasGradientId",_curId+1) 1873 return "canvasGradientId"+_curId; 1874} 1875 1876 1877function waGetDrawingSurface(_o,_w,_h) 1878{ 1879 1880 1881 var _className="wa-div-bg-gradient" 1882// alert(_className) 1883 var _canv = null 1884 var _div = _o.find("."+_className) 1885 //alert(_div.length) 1886 if (_div.length==0) 1887 { 1888 //_w+=5 1889 //_h+=5 1890 1891 var _index = -1; 1892 _o.append("<div class='"+_className+"' ></div>") 1893 _div = _o.find("."+_className) 1894 _div.css({position:"absolute",top:0,left:0,width:_w,height:_h,zIndex:_index}) 1895 1896 var _canvId=waGenerateNewGradientID(); 1897 //alert(_canvId)
1898 _div.html("<canvas id='"+_canvId+"' width="+_w+" height="+_h+" style='z-index:"+_index+"' ></canvas>") 1899 1900 _div.data("waCanvasId",_canvId) 1901 _canv = document.getElementById(_canvId); 1902 1903 //alert(isMSIE_lower_than_ie9()) 1904 if (isMSIE_lower_than_ie9()) 1905 { 1906 if (window.G_vmlCanvasManager) 1907 window.G_vmlCanvasManager.initElement(_canv); 1908 } 1909 //alert(_canv) 1910 1911 1912 } 1913 else 1914 { 1915 1916 var _canvId=_div.data("waCanvasId") 1917 _canv = document.getElementById(_canvId); 1918 1919 } 1920 1921 if (_canv==null) 1922 { 1923 if (isMSIE()) 1924 { 1925 if (document.documentMode==8) 1926 { 1927 //alert(navigator.userAgent) 1928 if ( /MSIE 9/.test(navigator.userAgent) ) 1929 { 1930 if (document.warning_ie9_frame!=true) 1931 { 1932 document.warning_ie9_frame = true 1933 alert(window.location+"\n"+Translator.tr("This site is probably in a frame,Display problems can occur with IE9 you have to enabled Force IE8 rendering in WA4 website properties",false)); 1934 1935 } 1936 } 1937 1938 } 1939 //alert(document.compatMode+" "+document.documentMode) 1940 } 1941 return null; 1942 } 1943 var _c = _canv.getContext('2d'); 1944 return _c; 1945} 1946 1947
1948function _waPutFillLinearGradient(_c,_gradProps) 1949{ 1950 var _arrGradStr = _gradProps.split(" ") 1951 if (_arrGradStr.length>1) 1952 { 1953 var _x1 = parseInt(_arrGradStr[0]); 1954 var _y1 = parseInt(_arrGradStr[1]);; 1955 var _x2 = parseInt(_arrGradStr[2]); 1956 var _y2 = parseInt(_arrGradStr[3]); 1957 1958 var _col1=_arrGradStr[4] 1959 var _col2=""; 1960 1961 if (_arrGradStr.length>5) 1962 { 1963 _col2 = _arrGradStr[5] 1964 } 1965 1966 if (_col1=="undefined")_col1="" 1967 if (_col2=="undefined")_col2="" 1968 1969 //_col1 = compliantColor(_col1) 1970 //_col2 = compliantColor(_col2) 1971 1972 1973 ////if (_col1=="")_col1="transparent" 1974 1975 // alert(_col2) 1976 if (_col2=="")_col2=_col1 1977 1978 1979 if (isMSIE_lower_than_ie9()) 1980 { 1981 //_col1 = compliantColor(_col1) 1982 //_col2 = compliantColor(_col2) 1983 var _oCol1 = new RGBColor(_col1) 1984 var _oCol2 = new RGBColor(_col2) 1985 if (_col1=="") 1986 { 1987 var _tmp = new RGBColor(_col2) 1988 _tmp.a = 0; 1989 _col1 = _tmp.toRGB() 1990 } 1991 1992 if (_col2=="") 1993 { 1994 var _tmp = new RGBColor(_col1) 1995 _tmp.a = 0; 1996 _col2 = _tmp.toRGB() 1997 } 1998 /* 1999 2000 if (_col1=="transparent")_col1= 2001 if (_col1=="transparent")_col1="transparent" 2002 */ 2003 2004 } 2005 2006 //_col2="" 2007 //_col2="#ffffffff" 2008 2009 //if (_col2=="")_col2="transparent" 2010 2011 2012 //_col2="transparent" 2013 2014 // alert(_col1+" "+_col2) 2015 // alert(_col2) 2016 2017 var _grad = _c.createLinearGradient(_x1,_y1,_x2,_y2); 2018 //alert(_col1+" "+_col2) 2019 _grad.addColorStop(0,_col1); 2020 _grad.addColorStop(1,_col2); 2021 2022 //alert(_col2) 2023 //alert(_col1+" "+_col2) 2024 // _c.fillStyle = _grad 2025 return _grad 2026 } 2027 else 2028 { 2029 // _c.fillStyle = _gradProps 2030 return _gradProps 2031 } 2032} 2033 2034function waDrawRoundedRectInSurface(_c,_w,_h,_arc,_gradProps,_borderWidth,_borderColor) 2035{ 2036 // alert(_borderColor 2037 // alert(_borderColor+" "+_borderWidth+" "+_borderColor.length) 2038 if ((_borderColor==undefined) || (_borderColor.length==0)) 2039 { 2040 _borderWidth=0 2041 } 2042 if (_borderWidth==0) 2043 { 2044 _borderColor="" 2045 } 2046 2047 2048//alert(_borderColor+" "+_borderWidth+" "+_borderColor.length) 2049 var _wInner = _w-2*_borderWidth 2050 var _hInner = _h-2*_borderWidth 2051 2052 var _arcInner = new Array(_arc[0],_arc[1],_arc[2],_arc[3]) 2053 2054 _arcInner = waSoustractFromArrayRadius(_arcInner,_borderWidth) 2055 2056 2057 if (_gradProps!=null) 2058 { 2059 {
2060 _c.fillStyle = _waPutFillLinearGradient(_c,_gradProps) 2061 //// 2062 2063 var _x = _borderWidth 2064 var _y = _borderWidth 2065 2066 if (_c.fillStyle !="") 2067 { 2068 _c.beginPath(); 2069 _waBasicDrawRoundedRect(_c,_x,_y,_wInner,_hInner,_arcInner) 2070 _c.closePath(); 2071 _c.fill() 2072 } 2073 } 2074 } 2075 2076 2077 2078 if ((_borderWidth>0)&&(_borderColor)&&(_borderColor.length>0)) 2079 { 2080 // alert(_borderColor+" "+_h) 2081 _c.fillStyle = _borderColor; 2082 _c.beginPath(); 2083 _waBasicDrawRoundedRect(_c,0,0,_w,_h,_arc) 2084 _waBasicDrawRoundedRect(_c,_borderWidth,_borderWidth,_wInner,_hInner,_arcInner,true) 2085 _c.closePath(); 2086 _c.fill() 2087 } 2088 2089 2090 2091} 2092 2093function waDrawRoundedRect(_o,_w,_h,_arc,_gradProps,_borderWidth,_borderColor) 2094{ 2095 2096var _c = waGetDrawingSurface(_o,_w,_h) 2097 waDrawRoundedRectInSurface(_c,_w,_h,_arc,_gradProps,_borderWidth,_borderColor) 2098} 2099 2100 2101function waDrawButton(_o,_gradProps,_borderColor,_innerBorderColor,_bgImage) 2102{ 2103 //alert('waDrawButton') 2104 var _pars = _o.parent() 2105 var _waButInner=_pars.find(".waButInner") 2106 _waButInner.hide() 2107 var _waGlossInner=_pars.find(".waButGlossInner") 2108 _waGlossInner.hide() 2109 2110 _o.css("background","") 2111 _o.css("border","none") 2112 2113 2114 var _borderWidth = 1; 2115 2116 if ((_borderColor==undefined)|| (_borderColor.length==0)) 2117 { 2118 _borderWidth = 0; 2119 } 2120 2121 var _innerBorderWidth = 1; 2122 2123 var _widthBut = _o.outerWidth() 2124 var _heightBut = _o.outerHeight() 2125 2126 var _w = _widthBut 2127 var _h = _heightBut 2128 2129 var _hasAquaEffect= (extractParamInfo(_o,"aqua")=="1") 2130 2131 var _arc = waExtractRadiusFromCss(_o) 2132 2133 var _c = waGetDrawingSurface(_o,_w,_h) 2134 2135// alert(_c) 2136 if (isMSIE_lower_than_ie9()) 2137 { 2138 _o.css("border","") 2139 } 2140 2141 2142 //alert(_gradProps) 2143 2144 _c.clearRect(0,0,_w,_h) 2145 var _bordColor0 = _borderColor 2146 2147 if (isMSIE_lower_than_ie9()) 2148 { 2149 2150 //alert(_gradProps) 2151 var _arrGrad = _gradProps.split(" ") 2152 var _col1="" 2153 var _col2="" 2154 // alert(_arrGrad.length) 2155 2156 if (_arrGrad.length<=1) 2157 { 2158 _col1=_gradProps 2159 _col2=_gradProps 2160 } 2161 else 2162 { 2163 _col1=_arrGrad[4] 2164 _col2=_arrGrad[5] 2165 } 2166 2167 if (_col1 == _col2) 2168 { 2169 waDrawRoundedRectInSurface(_c,_w,_h,_arc,_col1,_borderWidth,_bordColor0) 2170 } 2171 else 2172 { 2173 var _percentGrad = 40; 2174 if (_hasAquaEffect) 2175 { 2176 _percentGrad = 70; 2177 } 2178 var _hGrad = _h - Math.round(_h*_percentGrad/100) 2179 2180 var _arc1 = [_arc[0],_arc[1],0,0] 2181 2182 waDrawRoundedRectInSurface(_c,_w,_h-_hGrad,_arc1,_col1,_borderWidth,"") 2183 2184 2185 var _arc2 = [0,0,_arc[2],_arc[3]] 2186 var _gradPropsBottom = "0 0 0 "+_hGrad+" "+_col1+" "+_col2 2187
2188 _c.fillStyle = _waPutFillLinearGradient(_c,_gradPropsBottom) 2189 2190 _c.beginPath(); 2191 var _yGrad0 = _h-_hGrad 2192 _waBasicDrawRoundedRect(_c,0,_yGrad0,_w,_hGrad,_arc2) 2193 _c.closePath(); 2194 _c.fill() 2195 2196 //tour 2197 2198 if ((_bordColor0.length>0)&&(_borderWidth>0)) 2199 { 2200 _c.fillStyle="" 2201 _c.strokeStyle = _bordColor0; 2202 _c.beginPath(); 2203 _waBasicDrawRoundedRect(_c,0,0,_w,_h,_arc) 2204 _c.closePath(); 2205 _c.stroke(); 2206 //alert(_bordColor0+" "+_borderWidth) 2207 } 2208 2209 2210 2211 } 2212 2213 2214 2215 } 2216 else 2217 2218 { 2219 // alert(_gradProps) 2220 // _gradProps="url:crbst_ironman160060.jpg" 2221 waDrawRoundedRectInSurface(_c,_w,_h,_arc,_gradProps,_borderWidth,_bordColor0) 2222 } 2223 2224 2225 //alert(_innerBorderColor) 2226 if (_innerBorderColor && (_innerBorderColor.length>0)) 2227 { 2228 _c.fillStyle="" 2229 if (isMSIE_lower_than_ie9()) 2230 { 2231 _c.strokeStyle = _innerBorderColor; 2232 } 2233 else 2234 { 2235 _c.strokeStyle = _waPutFillLinearGradient(_c,"0 "+Math.round(_h/2)+" 0 "+_h+" "+_innerBorderColor+" transparent")//_innerBorderColor; 2236 } 2237 2238 _c.beginPath(); 2239 _waBasicDrawRoundedRect(_c,1.5,1.5,_w-3,_h-3,_arc) 2240 _c.closePath(); 2241 2242 2243 _c.stroke() 2244 } 2245 //alert('aqua '+_hasAquaEffect) 2246 if (_hasAquaEffect) 2247 { 2248 2249 var _col1 = "rgba(255,255,255,0.5)" 2250 var _col2 = "rgba(255,255,255,0.1)" 2251 var _hGrad = Math.round(_h*0.5); 2252 2253 var _corner = _arc[0] 2254 var _cornerGrad = _corner; 2255 _cornerGrad = Math.min(_cornerGrad,_hGrad/2); 2256 2257 //alert(_cornerGrad+" "+_arc[0]) 2258 2259 var _xDec = _corner-_cornerGrad; 2260 _xDec = Math.max(_xDec,0); 2261 var _gradProps = "0 0 0 "+_hGrad+" "+_col1+" "+_col2 2262 //alert(_gradProps)
2263 _c.fillStyle = _waPutFillLinearGradient(_c,_gradProps) 2264 _c.beginPath(); 2265 var _yGrad0 = 0 2266 _waBasicDrawRoundedRect(_c,_xDec,_yGrad0,_w-2*_xDec,_yGrad0+_hGrad,_cornerGrad) 2267 _c.closePath(); 2268 2269 2270 _c.fill() 2271 2272 } 2273 2274 2275} 2276 2277function waHackGradient() 2278{ 2279 if (isWebKit() || isFirefox()) 2280 { 2281 return false; 2282 } 2283// 2284 waJSQuery(".wa-bg-gradient").each(function() 2285 { 2286 var _o = waJSQuery(this) 2287 var _CSSStr = _o.attr("style"); 2288 2289 var _gradProps = extractParamInfo(_o,"grad") 2290 2291 2292 // alert(_gradProps) 2293 2294 var _array_borderProps = extractParamInfo(_o,"border").split(" ") 2295 2296 var _borderWidth = 0 2297 var _borderColor = "" 2298 if (_array_borderProps.length>0) 2299 { 2300 _borderWidth = parseInt(_array_borderProps[0]) 2301 if (isNaN(_borderWidth))_borderWidth = 0; 2302 } 2303 if (_array_borderProps.length>1) 2304 { 2305 _borderColor = _array_borderProps[1] 2306 } 2307 2308 // alert(_array_borderProps.length+" "+_borderWidth+" "+_borderColor) 2309 2310 var _imgSrc = _o.css("backgroundImage") 2311 2312 if ((_imgSrc.length>0)&&(_imgSrc!="none")) 2313 { 2314 _gradProps=null 2315 } 2316 //alert(_imgSrc) 2317 2318 var _w = _o.width()+2*_borderWidth 2319 var _h = _o.height()+2*_borderWidth 2320 var _arc = waExtractRadiusFromCss(_o) 2321 2322 2323 _o.css({border:"0px none",backgroundColor:"transparent"}) 2324 2325//alert(_gradProps) 2326 waDrawRoundedRect(_o,_w,_h,_arc,_gradProps,_borderWidth,_borderColor) 2327 2328 if (isMSIE()) 2329 { 2330 _o.css({width:_w,height:_h}) 2331 } 2332 }) 2333 2334} 2335 2336function waHasButtonHacking() 2337{ 2338// return true 2339 if (isWebKit() || isFirefox()) 2340 { 2341 return false; 2342 } 2343 return true; 2344} 2345 2346function waHackButtons() 2347{ 2348 2349 // alert("waHackButton") 2350 if (waHasButtonHacking()==false) 2351 { 2352 return false; 2353 } 2354 2355 waJSQuery(".wa-button").each(function() 2356 { 2357 var _o = waJSQuery(this) 2358 waHackButton(_o) 2359 2360 }) 2361} 2362 2363function waPercentGradientButton(_but) 2364{ 2365 var _hasAquaEffect= (extractParamInfo(_but,"aqua")=="1") 2366 var _percentYGrad = 40; 2367 if (_hasAquaEffect) 2368 { 2369 _percentYGrad = 70; 2370 } 2371 return _percentYGrad; 2372} 2373 2374function waHackButton(_o) 2375{ 2376 //alert("waHackButton") 2377 2378 var _pars = _o.parent() 2379 var _waButInner=_pars.find(".waButInner") 2380 //alert(_waButInner.length) 2381 _waButInner.show() 2382 var _waGlossInner=_pars.find(".waButGlossInner") 2383 _waGlossInner.show() 2384 2385 2386 2387 if (waHasButtonHacking()==false) 2388 { 2389 return false; 2390 } 2391 var _oldBg = _o.data("saved-background-image") 2392 if (_oldBg==null) 2393 { 2394 _o.data("saved-background-image",_o.css("background-image")) 2395 } 2396 2397 var _bg = _o.data("saved-background-image") 2398 if ((_bg.indexOf("url(")>-1)&&(_bg.indexOf("wa_transparent.gif")==-1)) 2399 { 2400 //_o.css("border","0px none") 2401 return false; 2402 } 2403 2404 //alert(_bg) 2405 //hack pour IE9 2406 _o.css("background-color","") 2407 2408 var _gradProps = extractParamInfo(_o,"grad") 2409 var _innerBorderColor = (extractParamInfo(_o,"inborder")) 2410 var _borderColor = (extractParamInfo(_o,"border")) 2411 2412 waDrawButton(_o,_gradProps,_borderColor,_innerBorderColor) 2413} 2414 2415function waHackButtonOver(_o) 2416{ 2417 2418 if (waHasButtonHacking()==false) 2419 { 2420 return false; 2421 } 2422 2423 var _but = waJSQuery(">button",_o); 2424 2425 var height = parseInt(_o.css("height")); 2426 2427 var cl = _o.attr("class") 2428 2429 2430 var bg= extractParamInfo(_o,"bg") 2431 2432 var _gradProps = null; 2433 2434 2435 var _percentYGrad = waPercentGradientButton(_but) 2436 if (bg && (bg.length>0)) 2437 { 2438 var _hGrad = Math.round(height*_percentYGrad/100) 2439 var cols = bg.split(" ") 2440 _gradProps = "0 "+_hGrad+" 0 "+height+" "+cols[0]+" "+cols[1] 2441 } 2442 2443 var bg_img= extractParamInfo(_o,"bg_img") 2444 if (bg_img && (bg_img.length>0)) 2445 { 2446 return; 2447 } 2448 2449 var _borderColor = extractParamInfo(_o,"bord"); 2450 var _innerBorderColor =extractParamInfo(_o,"inner_bord") 2451//alert("waDrawButton") 2452 waDrawButton(_but,_gradProps,_borderColor,_innerBorderColor) 2453} 2454 2455function waHackButtonOut(_o) 2456{ 2457 waHackButton(_o) 2458} 2459 2460 2461function waActivateOverButton(_butLink) 2462{ 2463 2464 var _bUseDiv = true; 2465 2466 var _mainDiv = null 2467 2468 if (_bUseDiv) 2469 { 2470 _mainDiv = _butLink; 2471 2472 } 2473 else 2474 { 2475 _mainDiv = waJSQuery(">span",_butLink); 2476 } 2477 //_mainDiv.css("background-color","url(wa-market-def3.png)") 2478 var o = _mainDiv 2479 2480 var button = waJSQuery(">button",o); 2481 2482 var txtSpan = null 2483 2484 if (_bUseDiv) 2485 { 2486 txtSpan = waJSQuery(">div",button); 2487 // txtSpan = waJSQuery(".wa-but-txt",button); 2488 //alert(txtSpan.length) 2489 } 2490 else 2491 {
2492 txtSpan = waJSQuery(">span",button); 2493 } 2494 2495 var _ref = _butLink.attr("onclick") 2496 if (_ref=="javascript:void(0)")_ref="" 2497 if (_ref==undefined)_ref="" 2498 if (_ref=="#")_ref="" 2499 2500 2501 if ((o.hasClass('wa-js-action')==false)&&(_ref.length==0)) 2502 2503 { 2504 _butLink.css("cursor","default") 2505 o.css("cursor","default") 2506 button.css("cursor","default") 2507 txtSpan.css("cursor","default") 2508 } 2509 else 2510 { 2511 _butLink.css("cursor","pointer") 2512 o.css("cursor","pointer") 2513 button.css("cursor","pointer") 2514 txtSpan.css("cursor","pointer") 2515 } 2516 2517 //alert(button.css("background-image")) 2518 2519 //_mainDiv.css("background-color","#ff0000") 2520 if (isMSIE()) 2521 { 2522 var _hasBgNormalImage = false; 2523 var _img = button.css("background-image") 2524 2525 if ((_img && (_img.length==0))||(_img=="none")) 2526 { 2527 2528 button.css("background-image","url(wa_transparent.gif)") 2529 2530 //sinon prob avec ie8 over 2531 _mainDiv.append("<div style='position:absolute;top:0px;left:0px;width:100%;height:100%;;background-image:url(wa_transparent.gif)'></div>") 2532 } 2533 else 2534 { 2535 _hasBgNormalImage = true; 2536 button.css("background-size",button.width()+" px "+button.height()+" px ") 2537 } 2538 // 2539 2540 } 2541 2542 var _waButInner=o.find(".waButInner") 2543 2544 var _wTextSpan = txtSpan.outerWidth() 2545 _wTextSpan = Math.min(_wTextSpan,button.width()) 2546 2547 2548 var img = waJSQuery(">img",button); 2549 var _xInput = Math.round((button.width()-_wTextSpan)/2) 2550 var _yInput = Math.round((button.height()-txtSpan.outerHeight())/2) 2551 2552//alert(button.width()+" "+txtSpan.outerWidth()+" "+_wTextSpan) 2553 var _align = button.css("textAlign"); 2554 2555 if (_align=="center") 2556 { 2557 _xInput = Math.round((button.width()-_wTextSpan)/2) 2558 } 2559 if (_align=="left") 2560 { 2561 _xInput = 3 2562 } 2563 if (_align=="right") 2564 { 2565 _xInput = button.width()-_wTextSpan-3 2566 } 2567 2568 //alert(img.attr("src")) 2569 if ((img.length==0)||(img.attr("src")==undefined)) 2570 { 2571 //txtSpan.css({"top":_yInput}) 2572 //alert(txtSpan.css("position")) 2573 //txtSpan.css({"position":"relative","left":_xInput,"top":_yInput}) 2574 } 2575 2576 //hover gestion 2577 2578 var cl = o.attr("class") 2579 2580 var clParam = extractClassInfo(cl,"param") 2581 2582 2583 _waButInner.css("border-bottom","0px none") 2584 2585 var _objEventOver = o 2586 _objEventOver = _mainDiv 2587 2588 // alert(_objEventOver.html()) 2589 _objEventOver.data("link_data",o) 2590 2591 2592 if (clParam!=null) 2593 _objEventOver.hover( 2594 2595 function () { 2596 2597 var o = waJSQuery(this).data("link_data") 2598 var button = waJSQuery(">button",o); 2599 2600 2601 var _state = button.data("waButState") 2602 if (_state==undefined) _state = 0; 2603 2604 if (_state!=0) return; 2605 2606 button.data("waButState",1) 2607 2608 var height = button.outerHeight() 2609 2610 2611 var _hasAquaEffect= (extractParamInfo(button,"aqua")=="1") 2612 2613 2614 var txtSpan = button.find(".wa-but-txt") 2615 2616 //alert(txtSpan.length) 2617 2618 // txtSpan = button.find(".wa-but-txt") 2619 2620 //alert(txtSpan.length) 2621 var imgTag = waJSQuery(">img",button); 2622 2623 imgTag = button.find("img");//sinon bug avec button + texte
2624 var innerSpan = waJSQuery(">.waButInner",o); 2625 2626 2627 button.data('wa-style',button.attr('style')) 2628 if (isMSIE_lower_than_ie9()) 2629 { 2630 button.data('wa-style-bg-img',button.css('background-image')) 2631 } 2632 2633 txtSpan.data('wa-style',txtSpan.attr('style')) 2634 imgTag.data('wa-style',imgTag.attr('style')) 2635 innerSpan.data('wa-style',innerSpan.attr('style')) 2636 imgTag.data('wa-style-src',imgTag.attr('src')) 2637 2638 //if (waHasButtonHacking()==false) 2639 { 2640 var bg= extractParamInfo(o,"bg") 2641 if (bg.length>0) 2642 { 2643 2644 2645 var cols = bg.split(" ") 2646 2647 var _col1 = cols[0] 2648 var _col2 = _col1 2649 if (cols.length>1)_col2 = cols[1] 2650 2651 var _infos = getBrowserInfos(); 2652 2653 //alert(bg+" # "+cols.length +" "+_col1+" "+_col2) 2654 2655 2656 var _percentYGrad = waPercentGradientButton(button) 2657 2658 if (_infos.engine=="webkit") 2659 { 2660 var _hGrad = Math.round(height*_percentYGrad/100) 2661 // alert(height+" "+_percentYGrad+" "+"-webkit-gradient(linear,0 "+_hGrad+", 0 "+height+",from("+_col1+"),to("+_col2+"))") 2662 button.css("background","-webkit-gradient(linear,0 "+_hGrad+", 0 "+height+",from("+_col1+"),to("+_col2+"))") 2663 } 2664 if (_infos.engine=="ff") 2665 { 2666 button.css("background","-moz-linear-gradient(top left -90deg,"+_col1+" "+_percentYGrad+"%, "+_col2+" 100%)") 2667 } 2668 2669 } 2670 2671 var borderCol= extractParamInfo(button,"border"); 2672 //alert(_borderColor2+" "+_borderColor3) 2673 var borderColOver= extractParamInfo(o,"bord"); 2674 2675 var _cBorderOver = new RGBColor(borderColOver) 2676 var _hasBorderOver = _cBorderOver.a>0; 2677 var _cBorder = new RGBColor(borderCol) 2678 var _hasBorder = _cBorder.a>0; 2679 2680 if (_hasBorderOver) 2681 { 2682 //button.css("border-color",borderColOver) 2683 2684 button.css("border","1px solid "+borderColOver) 2685 } 2686 else 2687 { 2688 button.css("border","0px") 2689 } 2690 2691 2692 /// 2693 2694 var bg_img= extractParamInfo(o,"bg_img"); 2695 2696 2697 if (bg_img && (bg_img.length>0)) 2698 { 2699 // 2700 //alert(_hasBorder+" "+_hasBorderOver) 2701 var _lx = button.width(); 2702 var _ly = button.height(); 2703 2704 if ((_hasBorder)) 2705 { 2706 _lx+=2; 2707 _ly+=2; 2708 } 2709 2710 button.css({"background-image":"url('"+bg_img+"')","background-size":""+_lx+"px "+_ly+"px"}) 2711 } 2712 2713 } 2714 2715 2716 var inner_borderCol= extractParamInfo(o,"inner_bord"); 2717 if (inner_borderCol && (inner_borderCol.length>0)) 2718 { 2719 innerSpan.css("border-color",inner_borderCol) 2720 } 2721 2722 var txtCol= extractParamInfo(o,"txt"); 2723 2724 //alert(txtCol) 2725 if (txtCol && (txtCol.length>0)) 2726 { 2727 //alert(txtCol) 2728 txtSpan.css("color",txtCol) 2729 button.css("color",txtCol) 2730 } 2731 2732 2733 var _underlineTxt= extractParamInfo(o,"u"); 2734 if (_underlineTxt && (_underlineTxt.length>0)) 2735 { 2736 if (_underlineTxt=="1") 2737 { 2738 txtSpan.css("textDecoration","underline") 2739 if (isMSIE()) 2740 { 2741 button.css("textDecoration","underline") 2742 } 2743 2744 } 2745 else 2746 { 2747 txtSpan.css("textDecoration","none") 2748 if (isMSIE()) 2749 { 2750 button.css("textDecoration","none") 2751 } 2752 2753 } 2754 2755 } 2756 2757 2758 var img= extractParamInfo(o,"img"); 2759 2760 if (img!=undefined) 2761 { 2762 2763 if (img.length==0) 2764 { 2765 imgTag.css("width",0) 2766 } 2767 else 2768 { 2769 var img_pars = img.split(" ") 2770 imgTag.attr("src",img_pars[0]) 2771 imgTag.css("width",img_pars[1]) 2772 imgTag.css("height",img_pars[2]) 2773 2774 } 2775 2776 } 2777 2778 2779 //if (button.data("disabled_hack_over")!=true) 2780 { 2781 waHackButtonOver(o) 2782 } 2783 2784 // 2785 2786 }, 2787 function () { 2788 // alert('out') 2789 2790 var o = waJSQuery(this).data("link_data") 2791 // alert(o) 2792 var button = waJSQuery(">button",o); 2793 2794 var _state = button.data("waButState") 2795 if (_state==undefined)_state = 0; 2796 if (_state!=1) return; 2797 button.data("waButState",0) 2798 2799 var txtSpan = button.find(".wa-but-txt") 2800 var imgTag = waJSQuery(">img",button); 2801 imgTag = button.find("img");//sinon bug avec button + texte
2802 var innerSpan = waJSQuery(">.waButInner",o); 2803 2804 2805 button.attr("style",button.data("wa-style")) 2806 if (isMSIE_lower_than_ie9()) 2807 { 2808 button.css("background-image",button.data("wa-style-bg-img")) 2809 } 2810 2811 txtSpan.attr("style",txtSpan.data("wa-style")) 2812 imgTag.attr("style",imgTag.data("wa-style")) 2813 2814 imgTag.attr("src",imgTag.data("wa-style-src")) 2815 2816 innerSpan.attr("style",innerSpan.data("wa-style")) 2817 2818 waHackButtonOut(button) 2819 2820 2821 } 2822 ); 2823 2824} 2825 2826 2827function waActivateOverButtons() 2828{ 2829 waJSQuery(".wa-button-link").each(function(i) 2830 { 2831 var _o = waJSQuery(this) 2832 //alert(_o.attr("onclick")) 2833 waActivateOverButton(_o) 2834 }) 2835 2836} 2837 2838function _waTextMarqueeTimer(_o) 2839{ 2840 wa_timeout(function(){_waTextMarqueeTimer(_o)},1000) 2841 2842 var _divText = _o.find("div") 2843 _divText.position().top 2844 2845 var _params = _divText.data("data-marquee") 2846 var _orientation = _params.orientation 2847 var _speed = _params.speed 2848} 2849 2850function _waCallBackAnimationStep(_divText,now, fx) 2851{ 2852 //window.status="_pos="+now 2853 if (isMSIE()) 2854 { 2855 var _params = _divText.data("data-marquee") 2856 2857 var _sizeCont = _params.size_cont; 2858 var _posX = 0; 2859 var _posY = 0; 2860 2861 if (_params.orientation!=0) //horizontal 2862 { 2863 _posX = -now; 2864 } 2865 else 2866 { 2867 _posY = -now; 2868 } 2869 var _w = _sizeCont.width() 2870 var _h = _sizeCont.height() 2871 2872 var _offset = 0; 2873 var _xImg = _offset+_posX; 2874 var _yImg = _offset+_posY; 2875 var _xImg2 = _w+_posX;; 2876 var _yImg2 = _h+_posY 2877 _divText.css("clip","rect("+_yImg+"px,"+_xImg2+"px,"+_yImg2+"px,"+_xImg+"px)") 2878 } 2879 2880 2881} 2882function _waStartMarqueeAnimation2(_divText,_canRestart) 2883{ 2884// _canRestart = false 2885 var _params = _divText.data("data-marquee") 2886 2887 var _prop=_params.prop 2888 var _l_size = _params.size 2889 var _l_inner = _params.innerSize 2890 var _compSize = _params.compSize 2891 2892 2893 2894 var _pos = 0; 2895 var _pos2 = 0; 2896 var _paramsAnimation={} 2897 if (_params.orientation!=0) //horizontal 2898 { 2899 if (_canRestart==false) 2900 { 2901 _pos = _divText.position().left;; 2902 _divText.css({"left":_pos}) 2903 } 2904 else 2905 { 2906 var _firstPos = _divText.data("first-pos-marquee") 2907 if (_firstPos==undefined) 2908 { 2909 _firstPos = _divText.position().left; 2910 _divText.data("first-pos-marquee",_firstPos) 2911 } 2912 else 2913 { 2914 _divText.css({"left":_firstPos}) 2915 } 2916 2917 _pos = _firstPos; 2918 } 2919 2920 // window.status="pos="+_pos+" _l_inner="+_l_inner 2921 if (_pos<=-_l_inner) 2922 { 2923 _pos = _compSize 2924 _divText.css(_prop,_pos) 2925 } 2926 _pos2 = -_l_size; 2927 _paramsAnimation={"left":_pos2} 2928 } 2929 else 2930 { 2931 if (_canRestart==false) 2932 { 2933 _pos = _divText.position().top;; 2934 _divText.css({"top":_pos}) 2935 } 2936 else 2937 { 2938 var _firstPos = _divText.data("first-pos-marquee") 2939 if (_firstPos==undefined) 2940 { 2941 _firstPos = _divText.position().top; 2942 _divText.data("first-pos-marquee",_firstPos) 2943 } 2944 else 2945 { 2946 _divText.css({"top":_firstPos}) 2947 } 2948 2949 _pos = _firstPos; 2950 } 2951 2952 2953 2954 if (_pos<=-_l_inner) 2955 { 2956 _pos = _compSize 2957 _divText.css(_prop,_pos) 2958 } 2959 _pos2 = -_l_size; 2960 _paramsAnimation={"top":_pos2} 2961 } 2962 2963 var _duration = ((_pos-_pos2)*1000)/_params.speed 2964 2965 var _animationOptions= { 2966 "duration":_duration, 2967 "easing":"linear", 2968 "complete":function() {_waStartMarqueeAnimation2(waJSQuery(this),true);}, 2969 "step":function(now, fx) {_waCallBackAnimationStep(waJSQuery(this),now, fx);} 2970 }; 2971 _divText.animate(_paramsAnimation,_animationOptions); 2972} 2973 2974function _waStartMarqueeAnimation(_o) 2975{ 2976 2977 var _orientation = parseInt(extractParamInfo(_o,"orientation","param_marquee")) 2978 var _speed = parseInt(extractParamInfo(_o,"speed","param_marquee")) 2979 //_orientation=1 2980 //_speed = 10; 2981 var _divText = _o.find("div") 2982 var _prop="top" 2983 var _size = _divText.height() 2984 var _innerSize = _divText.innerHeight() 2985 var _compSize = _o.height(); 2986 if (_orientation!=0) //horizontal 2987 { 2988 var _divText2 = _divText.find("div") 2989 var _html2 = _divText2.html() 2990 2991 var _w0 = _divText.innerWidth(); 2992 var _h = _divText2.innerHeight(); 2993 var _minH = _h 2994 var _wMin = _w0; 2995 for (var _w = _w0;_w<10000;_w+=30) 2996 { 2997 _divText.css("width",_w) 2998 _h = _divText2.innerHeight(); 2999 3000 if (_h<_minH) 3001 { 3002 _minH = _h
3003 _wMin = _w 3004 } 3005 } 3006 3007 _divText.css("width",_wMin+2) 3008 3009 } 3010 3011 if (_orientation!=0) //horizontal 3012 { 3013 _compSize = _o.width(); 3014 _prop="left" 3015 _size = _divText.width() 3016 _innerSize = _divText.innerWidth() 3017 //alert(_o.width()+" "+_size) 3018 _divText.css(_prop,_compSize) 3019 // alert(_innerSize) 3020 3021 // _divText.css(_prop,_innerSize) 3022 } 3023 else 3024 { 3025 _compSize = _o.height(); 3026 _prop="top" 3027 _size = _divText.height() 3028 _innerSize = _divText.innerHeight() 3029 _divText.css(_prop,_compSize) 3030 } 3031 3032 3033 3034 3035// alert("_compSize="+_compSize+" _size="+_size+" _innerSize="+_innerSize+" _prop="+_prop+" orientation="+_orientation) 3036 _divText.data("data-marquee",{"speed":_speed,"orientation":_orientation,"size":_size,"innerSize":_innerSize,"prop":_prop,"compSize":_compSize,"size_cont":new Size(_o.width(),_o.height())}) 3037 3038 _divText.hover(function(){ 3039 waJSQuery(this).stop(); 3040 }, 3041 function(){ 3042 3043 _waStartMarqueeAnimation2(waJSQuery(this),false) 3044 }); 3045 3046 _waStartMarqueeAnimation2(_divText) 3047} 3048 3049 3050 3051function initializeWA_JQuery() 3052{ 3053// alert("initializeWA_JQuery") 3054//// 3055 //hack pour certaines fontes web 3056 3057 if (isMSIE()) 3058 { 3059 3060 var _arrayFamilies = new Array(); 3061 var _descFamilies= waWebFontDescription.families 3062 for (var i=0;i<_descFamilies.length;i++) 3063 { 3064 var _fam = _descFamilies[i] 3065 _arrayFamilies.push(_fam+"::latin") 3066 } 3067 WebFontConfig = { 3068 google: { families: _arrayFamilies } 3069 }; 3070 if (_arrayFamilies.length>0) 3071 { 3072 waLoadGoogleFonts() 3073 } 3074 3075 } 3076 3077 /// 3078 IS_onload(); 3079 3080 3081 3082 /// 3083 /*******************/ 3084 /* img */ 3085 /*******************/ 3086 3087 ///////// 3088waJSQuery(".reflect").reflect(); 3089 //warning waJSQuery 3090 3091 waJSQuery(".wa-img").each(function() 3092 { 3093 // alert('wa-img') 3094 var _o = waJSQuery(this) 3095 3096 3097 var _over= extractParamInfo(_o,"over"); 3098 3099 3100 if (isMobileBrowser()==false) 3101 if (_over.length>0) 3102 { 3103 _o.hover( 3104 function () { 3105 var o = waJSQuery(this) 3106 var img = o 3107 var over= extractParamInfo(o,"over"); 3108 3109 var _imgDataOut = waJSQuery(this).data('src_out') //suite a un bug avecle cache 3110 if (_imgDataOut==undefined) 3111 { 3112 waJSQuery(this).data('src_out',img.attr('src')) 3113 } 3114 //img.attr('src') 3115 //waJSQuery(this).data('src',img.attr('src')) 3116 3117 img.attr("src",over) 3118 }, 3119 function () { 3120 3121 var o = waJSQuery(this) 3122 var img = o 3123 3124 img.attr("src",waJSQuery(this).data("src_out")) 3125 //alert('out '+waJSQuery(this).data("src")) 3126 ///img.attr("src",waJSQuery(this).data("src")) 3127 } 3128 ); 3129 } 3130 3131 }) 3132 /*******************/ 3133 /* texte sous IE */ 3134 /*******************/ 3135 3136 waJSQuery(".wa-text").each(function() 3137 { 3138 if (isMSIE()) 3139 { 3140 var _w = waJSQuery(this).width() 3141 var _h = waJSQuery(this).height() 3142 var _innerDiv = waJSQuery(this).children("div") 3143 //waJSQuery ne supporte pas un shorthand sde type margin 3144 var _margin = parseInt(_innerDiv.css("marginTop")) 3145 if (isNaN(_margin))_margin = 0; 3146 3147 var _border = parseInt(extractParamInfo(waJSQuery(this),"border","param")) 3148 //alert(_border) 3149 var _offset = _border; 3150 _innerDiv.css("margin",(_margin+_offset)+"px") 3151 3152 } 3153 3154 3155 //_waStartMarqueeAnimation(waJSQuery(this)) 3156 }) 3157 /*******************/ 3158 /* texte defilant */ 3159 /*******************/ 3160 3161 waJSQuery(".wa-textmarquee").each(function() 3162 { 3163 // alert("test") 3164 _waStartMarqueeAnimation(waJSQuery(this)) 3165 }) 3166 3167 3168 /*******************/ 3169 /* button */ 3170 /*******************/ 3171 3172 waActivateOverButtons() 3173 3174 waHackGradient() 3175 waHackButtons() 3176 3177waGlobalPatchIE() 3178 3179 3180} 3181 3182function waGlobalPatchIE() 3183{ 3184 if (isMSIE()) 3185 { 3186 if (window.waPatchIE) 3187 { 3188 waPatchIE() 3189 } 3190 } 3191} 3192 3193 3194/*! 3195 reflection.js for waJSQuery v1.1 3196 (c) 2006-2011 Christophe Beyls <http://www.digitalia.be> 3197 MIT-style license. 3198*/ 3199 3200(function(waJSQuery) { 3201 3202 3203waJSQuery.fn.extend({ 3204 3205 3206 reflect: function(options) { 3207 3208 var _o = waJSQuery(this) 3209 3210 var _radius = waExtractRadiusFromCss(_o) 3211 // alert(_radius) 3212 options = waJSQuery.extend({ 3213 height: 1/3, 3214 opacity: 0.5, 3215 borderRadius:_radius 3216 }, options); 3217 3218 return this.unreflect().each(function() { 3219 var img = this; 3220 if (/^img$/i.test(img.tagName)) { 3221 function doReflect() {
3222 var imageWidth = img.width, imageHeight = img.height, reflection, reflectionHeight, wrapper, context, gradient; 3223 //reflectionHeight = Math.floor((options.height > 1) ? Math.min(imageHeight, options.height) : imageHeight * options.height); 3224 reflectionHeight = Math.floor(imageHeight*options.height) 3225 reflection = waJSQuery("<canvas />")[0]; 3226 if (reflection.getContext) { 3227 context = reflection.getContext("2d"); 3228 try { 3229 3230 // waJSQuery(reflection).attr({width: imageWidth, height: reflectionHeight}); 3231 waJSQuery(reflection).attr({width: imageWidth, height: imageHeight}); 3232 3233 context.save(); 3234 context.translate(0, imageHeight-1); 3235 context.scale(1, -1); 3236 context.drawImage(img, 0, 0, imageWidth, imageHeight); 3237 context.restore(); 3238 context.globalCompositeOperation = "destination-out"; 3239 3240 gradient = context.createLinearGradient(0, 0, 0, reflectionHeight); 3241 gradient.addColorStop(0, "rgba(255, 255, 255, " + (1 - options.opacity) + ")"); 3242 gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)"); 3243 context.fillStyle = gradient; 3244 // context.rect(0, 0, imageWidth, reflectionHeight); 3245 context.rect(0, 0, imageWidth, imageHeight); 3246 context.fill(); 3247 3248 } catch(e) { 3249 return; 3250 } 3251 } else { 3252 if (!waJSQuery.browser.msie) return; 3253 reflection = waJSQuery("<img />").attr("src", img.src).css({ 3254 width: imageWidth, 3255 height: imageHeight, 3256 marginBottom: reflectionHeight - imageHeight, 3257 filter: "FlipV progid:DXImageTransform.Microsoft.Alpha(Opacity=" + (options.opacity * 100) + ", FinishOpacity=0, Style=1, StartX=0, StartY=0, FinishX=0, FinishY=" + (reflectionHeight / imageHeight * 100) + ")" 3258 })[0]; 3259 } 3260 var _radius1 = options.borderRadius 3261 // alert(_radius1[3]) 3262 var _radius2 = new Array(_radius1[3],_radius1[2],_radius1[1],_radius1[0]) 3263
3264 var _cssRadius1 = _radius1.join("px ")+"px" 3265 var _cssRadius2 = _radius2.join("px ")+"px" 3266 waJSQuery(reflection).css({display: "block",borderRadius:_cssRadius2}); 3267 // waJSQuery(reflection).css({display: "block",WebkitBorderRadius:_cssRadius2,MozBorderRadius: _cssRadius2, BorderRadius: _cssRadius2}); 3268 3269 wrapper = waJSQuery(/^a$/i.test(img.parentNode.tagName) ? "<span />" : "<div />").insertAfter(img).append([img, reflection])[0]; 3270 wrapper.className = img.className; 3271 waJSQuery.data(img, "reflected", wrapper.style.cssText = img.style.cssText); 3272 waJSQuery(wrapper).css({width: imageWidth, height: imageHeight + reflectionHeight, overflow: "hidden"}); 3273 // img.style.cssText = "display: block; border: 0px"; 3274 3275 img.style.cssText = "display: block;border:0px none;-webkit-border-radius:"+_cssRadius1+";-moz-border-radius:"+_cssRadius1+";border-radius:"+_cssRadius1+";width:"+imageWidth+"px;height:"+imageHeight+"px;" 3276 // waJSQuery(img).css(display,"block") 3277 3278 //waJSQuery(wrapper).css("rotate":) 3279 img.className = "reflected"; 3280 } 3281 3282 if (img.complete) doReflect(); 3283 else waJSQuery(img).load(doReflect); 3284 } 3285 }); 3286 }, 3287 3288 unreflect: function() { 3289 return this.unbind("load").each(function() { 3290 var img = this, reflected = waJSQuery.data(this, "reflected"), wrapper; 3291 3292 if (reflected !== undefined) { 3293 wrapper = img.parentNode; 3294 img.className = wrapper.className; 3295 img.style.cssText = reflected; 3296 waJSQuery.removeData(img, "reflected"); 3297 wrapper.parentNode.replaceChild(img, wrapper); 3298 } 3299 }); 3300 } 3301}); 3302 3303})(waJSQuery); 3304 3305 3306/** 3307 * waJSQuery Plugin to obtain touch gestures from iPhone, iPod Touch and iPad, should also work with Android mobile phones (not tested yet!) 3308 * Common usage: wipe images (left and right to show the previous or next image) 3309 * 3310 * @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de) 3311 * @version 1.1.1 (9th December 2010) - fix bug (older IE's had problems) 3312 * @version 1.1 (1st September 2010) - support wipe up and wipe down 3313 * @version 1.0 (15th July 2010) 3314 */ 3315(function(waJSQuery) { 3316 waJSQuery.fn.touchwipe = function(settings) { 3317 var config = { 3318 min_move_x: 20, 3319 min_move_y: 20, 3320 wipeLeft: function() { }, 3321 wipeRight: function() { }, 3322 wipeUp: function() { }, 3323 wipeDown: function() { }, 3324 preventDefaultEvents: true 3325 }; 3326 3327 if (settings) waJSQuery.extend(config, settings); 3328 3329 this.each(function() { 3330 var startX; 3331 var startY; 3332 var isMoving = false; 3333 3334 function cancelTouch() { 3335 this.removeEventListener('touchmove', onTouchMove); 3336 startX = null; 3337 isMoving = false; 3338 } 3339 3340 function onTouchMove(e) { 3341 if(config.preventDefaultEvents) { 3342 e.preventDefault(); 3343 } 3344 if(isMoving) { 3345 var x = e.touches[0].pageX; 3346 var y = e.touches[0].pageY; 3347 var dx = startX - x; 3348 var dy = startY - y; 3349 if(Math.abs(dx) >= config.min_move_x) { 3350 cancelTouch(); 3351 if(dx > 0) { 3352 config.wipeLeft(); 3353 } 3354 else { 3355 config.wipeRight(); 3356 } 3357 } 3358 else if(Math.abs(dy) >= config.min_move_y) { 3359 cancelTouch(); 3360 if(dy > 0) { 3361 config.wipeDown(); 3362 } 3363 else { 3364 config.wipeUp(); 3365 } 3366 } 3367 } 3368 } 3369 3370 function onTouchStart(e) 3371 { 3372 if (e.touches.length == 1) { 3373 startX = e.touches[0].pageX; 3374 startY = e.touches[0].pageY; 3375 isMoving = true; 3376 this.addEventListener('touchmove', onTouchMove, false); 3377 } 3378 } 3379 if ('ontouchstart' in document.documentElement) { 3380 this.addEventListener('touchstart', onTouchStart, false); 3381 } 3382 }); 3383 3384 return this; 3385 }; 3386 3387 })(waJSQuery); 3388 3389 3390//// 3391 3392/* 3393 WA_GetCookie(name) 3394 WA_SetCookie (name, value) 3395 3396*/ 3397 3398 3399 3400 3401/* 3402waJSQuery(function() { 3403 var _param= { 3404 "enable_preview_redirect":false,
3405 "enabled_internal_redirect":false, 3406 "redirect":{ 3407 "fr":"http://fr-fr.numento.com", 3408 "pt":"http://pt-br.numento.com", 3409 "es":"http://es-es.numento.com", 3410 "it":"http://it-it.numento.com", 3411 "ja":"http://ja-jp.numento.com", 3412 "de":"http://de-de.numento.com", 3413 }, 3414 "restricted_host":["numento.com","www.numento.com"] 3415 } 3416 waAutoDetectAndRedirectLang(_param); 3417}); 3418*/ 3419 3420//function waChgtLanguage('fr',"fr-fr.webacappella.com") 3421 3422function waChgtLanguage(_lng,_host) 3423{ 3424 var _langs = Translator.m_languages; 3425 var _pathname = window.location.pathname; 3426 var _curHref = window.location.href; 3427 var _curHost = window.location.host 3428 3429 var _n = _pathname.lastIndexOf("/") 3430 var _path = "" 3431 var _filename = _pathname 3432 3433 if (_n>-1) 3434 { 3435 _path= _pathname.substring(0,_n+1) 3436 _filename= _pathname.substring(_n+1) 3437 } 3438 3439 3440 if (_filename.length==0) 3441 { 3442 _filename = "index.html" 3443 _curHref+=_filename; 3444 } 3445 if (document.webaca_is_preview) 3446 { 3447 3448 if (_langs!=undefined) 3449 { 3450 var _lngFilename = _langs[_lng] 3451 if (_lngFilename) 3452 { 3453 window.location.replace(_lngFilename) 3454 return; 3455 } 3456 } 3457 } 3458 else 3459 { 3460 var _newUrl =_curHref 3461 _newUrl = _newUrl.replace(_curHost,_host); 3462 3463 if (_langs!=undefined) 3464 { 3465 var _lngFilename = _langs[_lng] 3466 3467 _newUrl = _newUrl.replace(_filename,_lngFilename); 3468 // alert(_newUrl) 3469 3470 // alert(_newUrl) 3471 window.location.replace(_newUrl) 3472 } 3473 3474 } 3475 3476} 3477 3478function waAutoDetectAndRedirectLang(_param) 3479{ 3480 if ((_param.enable_preview_redirect!=true) && document.webaca_is_preview) 3481 { 3482 return; 3483 } 3484 3485 if (isProbablyRobot()) 3486 { 3487 return; 3488 } 3489 //alert("waAutoDetectAndRedirectLang "+window.location.host+" "+_param.restricted_host+" "+document.webaca_is_preview) 3490 if ((_param.restricted_host!=undefined) && (document.webaca_is_preview!=true)) 3491 { 3492 var _match = false; 3493 for (var i=0;i<_param.restricted_host.length;i++) 3494 { 3495 var _host = _param.restricted_host[i] 3496 if (window.location.host == _host) 3497 { 3498 _match = true; 3499 break; 3500 } 3501 } 3502 if (_match==false) 3503 { 3504 return; 3505 } 3506 3507 } 3508 3509 var _language = navigator.language; 3510 if (navigator.browserLanguage) 3511 _language = navigator.browserLanguage; 3512 3513 3514 var _n = _language.indexOf("-") 3515 if (_n>0) 3516 { 3517 _language = _language.substr(0,_n) 3518 } 3519 3520 //language contient le code lanf "fr" "en" 3521 3522 3523 if (Translator.m_lang != _language) 3524 { 3525 //langue courant pas egale a la langue de la page 3526 if (_param.enabled_internal_redirect!=false) 3527 { 3528 var _langs = Translator.m_languages; 3529 if (_langs) 3530 { 3531 var _lng = _langs[_language] 3532 if (_lng) 3533 { 3534 window.location.replace(_lng) 3535 return; 3536 } 3537 } 3538 } 3539 3540 3541 if (_param.redirect!=undefined) 3542 { 3543 var _host = _param.redirect[_language] 3544 if (_host!=undefined) 3545 { 3546 3547 waChgtLanguage(_language,_host); 3548 // waChgtLanguage(_lng,_host) 3549 //window.location.replace(_host) 3550 } 3551 } 3552 3553 3554 } 3555} 3556 3557 3558-->
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.