PageRenderTime 60ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/blog/wp-content/themes/Insignia/lib/scripts/custom.js

https://bitbucket.org/bsnowman/classyblog
JavaScript | 896 lines | 572 code | 115 blank | 209 comment | 165 complexity | cc924dfe63f84dc8bc6b0c6867216564 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. jQuery.noConflict();
  2. jQuery(document).ready(function() {
  3. /*
  4. * Adjust searchform size to screen width
  5. */
  6. SearchInputResize();
  7. /*
  8. * Tab functions
  9. */
  10. if(jQuery('ul.tabs').length > 0){
  11. jQuery('ul.tabs').tabs('> .tabs_content');
  12. }
  13. if(jQuery('ul.tabs_framed').length > 0){
  14. jQuery('ul.tabs_framed').tabs('> .tabs_framed_content');
  15. }
  16. if(jQuery('ul.tabs_button').length > 0){
  17. jQuery('ul.tabs_button').tabs('> .tabs_button_content');
  18. }
  19. if(jQuery('.tabs_vertical_frame').length > 0){
  20. jQuery('.tabs_vertical_frame').tabs('> .tabs_vertical_content');
  21. jQuery('.tabs_vertical_frame').data('tabs').onBeforeClick(function(e,index) {
  22. this.getTabs().parent().removeClass('current');
  23. this.getTabs().eq(index).parent().addClass('current');
  24. });
  25. }
  26. if(jQuery('ul.blog_tabs').length > 0){
  27. jQuery('ul.blog_tabs').tabs('> .blog_tabs_content');
  28. jQuery('ul.blog_tabs').data('tabs').onClick(function(index) {
  29. //Cufon.refresh();
  30. });
  31. }
  32. /*
  33. * Hover fade
  34. */
  35. jQuery('.hover_fade_js').live('hover', function(e) {
  36. if( e.type == 'mouseenter' )
  37. jQuery(this).stop().animate({opacity:0.7},400);
  38. if( e.type == 'mouseleave' )
  39. jQuery(this).stop().animate({opacity:1},400);
  40. });
  41. /*
  42. * toggle functions
  43. */
  44. jQuery('.toggle').toggle(function(){
  45. jQuery(this).addClass('active');
  46. }, function () {
  47. jQuery(this).removeClass('active');
  48. });
  49. jQuery('.toggle').click(function(){
  50. jQuery(this).next('.toggle_content').slideToggle();
  51. });
  52. jQuery('.toggle_frame_set').each(function(i) {
  53. var _this = jQuery(this),
  54. toggle = _this.find('.toggle_accordion');
  55. toggle.click(function(){
  56. if( jQuery(this).next().is(':hidden') ) {
  57. _this.find('.toggle_accordion').removeClass('active').next().slideUp();
  58. jQuery(this).toggleClass('active').next().slideDown();
  59. }
  60. return false;
  61. });
  62. });
  63. /*
  64. * image reflect functions
  65. */
  66. jQuery('img.reflect').reflect({height:0.5,opacity:0.5});
  67. /*
  68. * prettyPhoto
  69. */
  70. jQuery("a[rel^='prettyPhoto'], a[rel^='lightbox']").prettyPhoto({
  71. overlay_gallery: false, social_tools: '', 'theme': 'light_square' /* light_square / dark_rounded / light_square / dark_square / facebook */
  72. });
  73. /*
  74. * spam protction on mailto: links
  75. */
  76. jQuery('a.email_link_noreplace').nospam({
  77. replaceText: false,
  78. filterLevel: 'normal'
  79. });
  80. jQuery('a.email_link_replace').nospam({
  81. replaceText: true,
  82. filterLevel: 'normal'
  83. });
  84. /*
  85. * Contact form submit
  86. */
  87. jQuery('.contact_form_submit').click(function() {
  88. clearInterval(preLoaderSmall);
  89. preLoaderCount = 0;
  90. alliPreloaderSmall('.alli_contact_feedback');
  91. jQuery(this).next().css('display','inline-block');
  92. });
  93. /*
  94. * "target_blank" links
  95. */
  96. jQuery('.flickr_badge_image a').attr('target', '_blank');
  97. jQuery('.target_blank').attr('target', '_blank');
  98. });
  99. /*
  100. * Preload image function
  101. */
  102. (function($) {
  103. var cache = [];
  104. // Arguments are image paths relative to the current page.
  105. $.preLoadImages = function() {
  106. var args_len = arguments.length;
  107. for (var i = args_len; i--;) {
  108. var cacheImage = document.createElement('img');
  109. cacheImage.src = arguments[i];
  110. cache.push(cacheImage);
  111. }
  112. }
  113. })(jQuery)
  114. // Preload loading images
  115. jQuery.preLoadImages(
  116. assetsUri+ '/transparent.gif',
  117. assetsUri+ '/preloader.png'
  118. );
  119. /*
  120. * Preloader image
  121. */
  122. var preLoader = null;
  123. var preLoaderCount = 0;
  124. function alliPreloader(img_class) {
  125. // var i,positions;
  126. //i=0;
  127. //positions=[-26,-52,-78,-104,-130,-156,-182,-208,-234,-260,-286,0];
  128. //positionsClass = 'center';
  129. //preLoader=setInterval(function(){
  130. //jQuery(img_class +' img').css('background-position',positions[i]+'px ' +positionsClass);
  131. //i++;
  132. //preLoaderCount++;
  133. //if(preLoaderCount===200){clearInterval(preLoader);preLoaderCount = 0;}
  134. //if(i===12){i=0;}
  135. //},70);
  136. //jQuery(img_class +' img').css('background-position',positions[i]+'px ' +positionsClass);
  137. }
  138. var preLoaderSmall = null;
  139. var preLoaderSmallCount = 0;
  140. function alliPreloaderSmall(img_class) {
  141. /*var i,
  142. positions;
  143. i=0;
  144. positionsSmall=[-16,-32,-48,-64,-80,-96,-112,-128,-144,-160,-176,0];
  145. positionsClassSmall = 'bottom';
  146. preLoaderSmall=setInterval(function(){
  147. jQuery(img_class +' img').css('background-position',positionsSmall[i]+'px ' +positionsClassSmall);
  148. i++;
  149. preLoaderSmallCount++;
  150. if(preLoaderSmallCount===200){clearInterval(preLoaderSmall);preLoaderSmallCount = 0;}
  151. if(i===12){i=0;}
  152. },70);*/
  153. }
  154. var preLoaderLarge = null;
  155. var preLoaderLargeCount = 0;
  156. function alliPreloaderLarge(img_class) {
  157. /* var i,
  158. positions;
  159. i=0;
  160. positionsLarge=[-35,-70,-105,-140,-175,-210,-245,-280,-315,-350,-385,0];
  161. positionsClassLarge = 'top';
  162. preLoaderLarge=setInterval(function(){
  163. jQuery(img_class +' img').css('background-position',positionsLarge[i]+'px ' +positionsClassLarge);
  164. i++;
  165. preLoaderLargeCount++;
  166. if(preLoaderLargeCount===200){clearInterval(preLoaderLarge);preLoaderLargeCount = 0;}
  167. if(i===12){i=0;}
  168. },70);*/
  169. }
  170. alliPreloader('.alli_preloader');
  171. alliPreloaderLarge('.alli_preloader_large');
  172. /*
  173. * YouTube api events
  174. */
  175. function onYouTubePlayerAPIReady(id) {
  176. new YT.Player(id, {
  177. height: '',
  178. width: '',
  179. videoId: '',
  180. events: {
  181. 'onStateChange': onPlayerStateChange
  182. }
  183. });
  184. }
  185. function onPlayerStateChange(event) {
  186. if( event.data == YT.PlayerState.PLAYING ) {
  187. if( jQuery('#alli_scrolling_slider').length>0){
  188. jQuery('#alli_scrolling_slider').data('scrollable').stop();
  189. jQuery('#slider_module_inner').mouseout(function() {
  190. jQuery('#alli_scrolling_slider').data('scrollable').stop();
  191. });
  192. }
  193. if( jQuery('#fading_slides').length>0){
  194. jQuery('.slider_nav').data('slideshow').stop();
  195. }
  196. }
  197. }
  198. /*
  199. * Vimeo api events
  200. */
  201. var VimeoEmbed = {};
  202. VimeoEmbed.vimeo_player_loaded = function(player_id) {
  203. VimeoEmbed.setupAPIEventListeners(player_id);
  204. };
  205. VimeoEmbed.setupAPIEventListeners = function(target) {
  206. iframe_player = document.getElementById(target);
  207. iframe_player.addEvent( 'onPlay', VimeoEmbed.vimeo_on_play);
  208. };
  209. VimeoEmbed.vimeo_on_play = function(player_id) {
  210. if( jQuery('#alli_scrolling_slider').length>0){
  211. jQuery('#alli_scrolling_slider').data('scrollable').stop();
  212. jQuery('#slider_module_inner').mouseout(function() {
  213. jQuery('#alli_scrolling_slider').data('scrollable').stop();
  214. });
  215. }
  216. if( jQuery('#fading_slides').length>0){
  217. jQuery('.slider_nav').data('slideshow').stop();
  218. }
  219. };
  220. /*
  221. * Contact ajaxForm
  222. */
  223. (function($)
  224. {
  225. $(function() {
  226. try {
  227. $('div.alli_form > form').ajaxForm({
  228. data: { '_alli_form_ajax_submit': 1 },
  229. dataType: 'json',
  230. success: function(data) {
  231. if($.browser.safari){ bodyelem = $('body') } else { bodyelem = $('html') }
  232. jQuery(data.into).find(':input').each(function() {
  233. jQuery(this).removeClass('required_error');
  234. });
  235. if(data.errors) {
  236. if(data.errored_fields){
  237. $('.alli_message').remove();
  238. for(var i in data.errored_fields){
  239. $('#' +data.errored_fields[i]).addClass('required_error');
  240. }
  241. bodyelem.animate({ scrollTop: $(data.into).offset().top-80
  242. }, 'slow', function(){
  243. jQuery('.alli_contact_feedback').css('display','none');
  244. });
  245. }
  246. if(data.errored_fields == '' || !data.sidebar){
  247. if(data.errors) {
  248. bodyelem.animate({
  249. scrollTop: $(data.into).offset().top-80
  250. }, 'slow', function(){
  251. $('.alli_message').remove();
  252. $(data.errors).css('display', 'none').prependTo(data.into).slideDown('slow');
  253. jQuery('.alli_contact_feedback').css('display','none');
  254. });
  255. }
  256. }
  257. }
  258. if( data.mail_sent ) {
  259. $('.alli_message').remove();
  260. $(data.into + ' > form').remove();
  261. bodyelem.animate({
  262. scrollTop: $(data.into).offset().top-80
  263. }, 'slow', function(){
  264. $(data.success).css('display', 'none').prependTo(data.into).slideDown('slow');
  265. jQuery('.alli_contact_feedback').css('display','none');
  266. });
  267. }
  268. }
  269. });
  270. } catch (e) {
  271. //suppress error
  272. }
  273. });
  274. })(jQuery);
  275. /*
  276. * Alliase image preloader
  277. */
  278. (function($)
  279. {
  280. $.fn.preloader = function(options) {
  281. var defaults = {
  282. selector: '',
  283. imgSelector: 'img',
  284. imgAppend: 'a',
  285. fade: true,
  286. delay: 500,
  287. fadein: 400,
  288. imageResize: imageResize,
  289. resizeDisabled: resizeDisabled,
  290. nonce: imageNonce,
  291. beforeShowAll: function(){},
  292. onDone: function(){},
  293. oneachload: function(image){}
  294. },
  295. options = $.extend({}, defaults, options);
  296. var ua = $.browser,
  297. uaVersion = ua.version.substring(0,1);
  298. if(options.imageResize == 'wordpress')
  299. options.delay = 0;
  300. return this.each(function() {
  301. options.beforeShowAll.call(this);
  302. var $this = $(this),
  303. images = $this.find(options.imgSelector),
  304. count = images.length;
  305. $this.load = {
  306. preload: function(count) {
  307. if(count>0) {
  308. $this.load.loadImage(0,count);
  309. } else {
  310. return;
  311. }
  312. },
  313. loadImage: function(i,count) {
  314. if(i<count) {
  315. var imgId = Math.floor(Math.random()*1000)+'_img_';
  316. $this.load.append(i,imgId);
  317. if(options.imageResize == 'timthumb' || options.resizeDisabled == 'true')
  318. $this.load.loader(i,$(images[i]).attr('src'),imgId);
  319. if( (options.imageResize == 'wordpress') && (options.resizeDisabled == false) )
  320. $this.load.resize(i,imgId);
  321. } else {
  322. options.onDone.call(this);
  323. }
  324. },
  325. append: function(i,imgId) {
  326. $('<span id="'+imgId+(i+1)+'"></span>').each(function() {
  327. if( options.imgAppend ) {
  328. $(this).appendTo($this.find(options.imgAppend).eq(i));
  329. } else {
  330. $(this).appendTo($(options.selector));
  331. }
  332. });
  333. },
  334. loader: function(i,image,imgId) {
  335. var newImage = new Image(),
  336. currImage = $('#'+imgId+(i+1)),
  337. title = ( $(images[i]).attr('title') ) ? $(images[i]).attr('title') : '';
  338. $(newImage).load(function () {
  339. $(this).attr('width', $(images[i]).attr('width'));
  340. $(this).attr('height', $(images[i]).attr('height'));
  341. $(images[i]).parent().remove()
  342. if( options.fade ) {
  343. $(this).css('display','none');
  344. $(currImage).append(this);
  345. j = i+1;
  346. // Remove preloader
  347. $(this).parent().prev().delay(j*options.delay).queue(function() {
  348. $(this).remove();
  349. });
  350. // FadeIn image
  351. $(this).delay(j*options.delay).fadeIn(options.fadein).queue(function() {
  352. $(this).addClass($(images[i]).attr('class'));
  353. if( $(this).parent().parent().is('a')) {
  354. if(($(this).parent().parent().attr('rel'))){
  355. if($(this).parent().parent().attr('rel').match('prettyPhoto')){
  356. var filename = $(this).parent().parent().attr('href'),
  357. videos=['swf','youtube','vimeo','mov'];
  358. for(var v in videos){
  359. if(filename.match(videos[v])){
  360. var video_icon = true;
  361. }else{
  362. var zoom_icon = true;
  363. }
  364. }
  365. }
  366. }
  367. //$(this).parent().prev().remove();
  368. } else {
  369. //$(this).parent().prev().remove();
  370. }
  371. if( video_icon ){
  372. $(this).parent().parent().css('backgroundImage','url(' +assetsUri+ '/play.png)');
  373. }else if(zoom_icon){
  374. $(this).parent().parent().css('backgroundImage','url(' +assetsUri+ '/zoom.png)');
  375. }
  376. options.oneachload.call(this, this);
  377. });
  378. if( (!ua.msie) || (uaVersion >= '9' && ua.msie) ){
  379. $this.load.loadImage(i+1,count);
  380. }
  381. } else {
  382. $(this).addClass($(images[i]).attr('class'));
  383. $(currImage).append(this);
  384. if( (!ua.msie) || (uaVersion >= '9' && ua.msie) ){
  385. $this.load.loadImage(i+1,count);
  386. }
  387. options.oneachload.call(this, this);
  388. }
  389. }).error(function () {
  390. // try to load next item
  391. $this.load.loadImage(i+1,count);
  392. })
  393. .attr('src', image)
  394. .attr('title', title)
  395. .attr('alt', $(images[i]).attr('alt'));
  396. if(uaVersion <= '8' && ua.msie){
  397. $this.load.loadImage(i+1,count);
  398. }
  399. },
  400. resize: function(i,imgId) {
  401. var imgResize = $('<input>', { type: 'text', name:'ajax_image_resize_url', val: $(images[i]).attr('src') })
  402. imgWidth = $('<input>', { type: 'text', name:'img_width', val: $(images[i]).attr('width') }),
  403. imgHeight = $('<input>', { type: 'text', name:'img_height', val: $(images[i]).attr('height') }),
  404. j5M5601 = $('<input>', { type: 'text', name:'j5M5601', val: options.nonce });
  405. postData = imgResize.add(imgWidth).add(imgHeight).add(j5M5601).serialize();
  406. $.ajax({
  407. type: 'POST',
  408. dataType: 'json',
  409. data: postData,
  410. beforeSend: function(x) {
  411. if(x && x.overrideMimeType) {
  412. x.overrideMimeType('application/json;charset=UTF-8');
  413. }
  414. },
  415. success: function(data) {
  416. $this.load.loader(i,data.url,imgId);
  417. }
  418. });
  419. }
  420. };
  421. $this.load.preload(count);
  422. });
  423. }
  424. })(jQuery);
  425. /*********************
  426. //* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/
  427. //* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering
  428. //* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
  429. *********************/
  430. //Update: April 12th, 10: Fixed compat issue with jquery 1.4x
  431. //Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs):
  432. var arrowimages={down:['', ''], right:['', '']}
  433. var main_navigation={
  434. animateduration: {over: 200, out: 25}, //duration of slide in/ out animation, in milliseconds
  435. buildmenu:function(menuid, arrowsvar){
  436. jQuery(document).ready(function($){
  437. $(" #main_navigation a").removeAttr("title");
  438. var $mainmenu=$("."+menuid+">ul")
  439. var $headers=$mainmenu.find("ul").parent()
  440. $headers.each(function(i){
  441. var $curobj=$(this)
  442. var $subul=$(this).find('ul:eq(0)')
  443. this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
  444. this.istopheader=$curobj.parents("ul").length==1? true : false
  445. $subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
  446. /*
  447. $curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
  448. '<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])
  449. +'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])
  450. + '" style="border:0;" />'
  451. )*/
  452. $curobj.hover(
  453. function(e){
  454. var $targetul=$(this).children("ul:eq(0)")
  455. this._offsets={left:$(this).offset().left, top:$(this).offset().top}
  456. if(jQuery.browser.msie){
  457. var menuleft=this.istopheader? 0 : this._dimensions.w +2
  458. menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) -4 : menuleft
  459. }
  460. if(!jQuery.browser.msie){
  461. var menuleft=this.istopheader? 0 : this._dimensions.w
  462. menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
  463. }
  464. if ($targetul.queue().length<=1){
  465. $targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(main_navigation.animateduration.over)
  466. if(jQuery.browser.msie){
  467. ieVersion = jQuery.browser.version.substring(0,1);
  468. if( ieVersion == 7 ){ var disableArrors = true; }
  469. }
  470. if( !disableArrors ) {
  471. if(this.istopheader && jQuery(this).children().eq(0).find('span.menu_arrow').length<1) {
  472. $curobj.children("a:eq(0)").append(
  473. '<span class="menu_arrow"></span>'
  474. )
  475. }
  476. }
  477. } //if 1 or less queued animations
  478. },
  479. function(e){
  480. var $targetul=$(this).children("ul:eq(0)")
  481. $targetul.slideUp(main_navigation.animateduration.out)
  482. }
  483. ) //end hover
  484. $curobj.click(function(){
  485. $(this).children("ul:eq(0)").hide()
  486. })
  487. }) //end $headers.each()
  488. $mainmenu.find("ul").css({display:'none', visibility:'visible'})
  489. }) //end document.ready
  490. }
  491. }
  492. //build menu with ID="main_navigation" on page:
  493. main_navigation.buildmenu("main_navigation", arrowimages);
  494. /*
  495. reflection.js for jQuery v1.03
  496. (c) 2006-2009 Christophe Beyls <http://www.digitalia.be>
  497. MIT-style license.
  498. */
  499. (function(a){a.fn.extend({reflect:function(b){b=a.extend({height:1/3,opacity:0.5},b);return this.unreflect().each(function(){var c=this;if(/^img$/i.test(c.tagName)){function d(){var g=c.width,f=c.height,l,i,m,h,k;i=Math.floor((b.height>1)?Math.min(f,b.height):f*b.height);if(a.browser.msie){l=a("<img />").attr("src",c.src).css({width:g,height:f,marginBottom:i-f,filter:"flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+(b.opacity*100)+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+(i/f*100)+")"})[0]}else{l=a("<canvas />")[0];if(!l.getContext){return}h=l.getContext("2d");try{a(l).attr({width:g,height:i});h.save();h.translate(0,f-1);h.scale(1,-1);h.drawImage(c,0,0,g,f);h.restore();h.globalCompositeOperation="destination-out";k=h.createLinearGradient(0,0,0,i);k.addColorStop(0,"rgba(255, 255, 255, "+(1-b.opacity)+")");k.addColorStop(1,"rgba(255, 255, 255, 1.0)");h.fillStyle=k;h.rect(0,0,g,i);h.fill()}catch(j){return}}a(l).css({display:"block",border:0});m=a(/^a$/i.test(c.parentNode.tagName)?"<span />":"<div />").insertAfter(c).append([c,l])[0];m.className=c.className;a.data(c,"reflected",m.style.cssText=c.style.cssText);a(m).css({width:g,height:f+i,overflow:"hidden"});c.style.cssText="display: block; border: 0px";c.className="reflected"}if(c.complete){d()}else{a(c).load(d)}}})},unreflect:function(){return this.unbind("load").each(function(){var c=this,b=a.data(this,"reflected"),d;if(b!==undefined){d=c.parentNode;c.className=d.className;c.style.cssText=b;a.removeData(c,"reflected");d.parentNode.replaceChild(c,d)}})}})})(jQuery);
  500. /**
  501. * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
  502. * <http://cherne.net/brian/resources/jquery.hoverIntent.html>
  503. *
  504. * @param f onMouseOver function || An object with configuration options
  505. * @param g onMouseOut function || Nothing (use configuration options object)
  506. * @author Brian Cherne <brian@cherne.net>
  507. */
  508. (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
  509. /*
  510. * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
  511. *
  512. * Uses the built in easing capabilities added In jQuery 1.1
  513. * to offer multiple easing options
  514. *
  515. * TERMS OF USE - jQuery Easing
  516. *
  517. * Open source under the BSD License.
  518. *
  519. * Copyright © 2008 George McGinley Smith
  520. * All rights reserved.
  521. *
  522. * Redistribution and use in source and binary forms, with or without modification,
  523. * are permitted provided that the following conditions are met:
  524. *
  525. * Redistributions of source code must retain the above copyright notice, this list of
  526. * conditions and the following disclaimer.
  527. * Redistributions in binary form must reproduce the above copyright notice, this list
  528. * of conditions and the following disclaimer in the documentation and/or other materials
  529. * provided with the distribution.
  530. *
  531. * Neither the name of the author nor the names of contributors may be used to endorse
  532. * or promote products derived from this software without specific prior written permission.
  533. *
  534. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
  535. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  536. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  537. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  538. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  539. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  540. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  541. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  542. * OF THE POSSIBILITY OF SUCH DAMAGE.
  543. *
  544. */
  545. jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
  546. else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
  547. else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
  548. else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});
  549. /*
  550. * No Spam (1.3)
  551. * by Mike Branski (www.leftrightdesigns.com)
  552. * mikebranski@gmail.com
  553. *
  554. * Copyright (c) 2008 Mike Branski (www.leftrightdesigns.com)
  555. * Licensed under GPL (www.leftrightdesigns.com/library/jquery/nospam/gpl.txt)
  556. *
  557. * NOTE: This script requires jQuery to work. Download jQuery at www.jquery.com
  558. *
  559. * Thanks to Bill on the jQuery mailing list for the double slash idea!
  560. *
  561. * CHANGELOG:
  562. * v 1.3 - Added support for e-mail addresses with multiple dots (.) both before and after the at (@) sign
  563. * v 1.2.1 - Included GPL license
  564. * v 1.2 - Finalized name as No Spam (was Protect Email)
  565. * v 1.1 - Changed switch() to if() statement
  566. * v 1.0 - Initial release
  567. *
  568. */
  569. jQuery.fn.nospam = function(settings) {
  570. settings = jQuery.extend({
  571. replaceText: false, // optional, accepts true or false
  572. filterLevel: 'normal' // optional, accepts 'low' or 'normal'
  573. }, settings);
  574. return this.each(function(){
  575. e = null;
  576. if(settings.filterLevel == 'low') { // Can be a switch() if more levels added
  577. if(jQuery(this).is('a[rel]')) {
  578. e = jQuery(this).attr('rel').replace('//', '@').replace(/\//g, '.');
  579. } else {
  580. e = jQuery(this).text().replace('//', '@').replace(/\//g, '.');
  581. }
  582. } else { // 'normal'
  583. if(jQuery(this).is('a[rel]')) {
  584. e = jQuery(this).attr('rel').split('').reverse().join('').replace('//', '@').replace(/\//g, '.');
  585. } else {
  586. e = jQuery(this).text().split('').reverse().join('').replace('//', '@').replace(/\//g, '.');
  587. }
  588. }
  589. if(e) {
  590. if(jQuery(this).is('a[rel]')) {
  591. jQuery(this).attr('href', 'mailto:' + e);
  592. if(settings.replaceText) {
  593. jQuery(this).text(e);
  594. }
  595. } else {
  596. jQuery(this).text(e);
  597. }
  598. }
  599. });
  600. };
  601. /*
  602. CUSTOM FORM ELEMENTS
  603. Created by Ryan Fait
  604. www.ryanfait.com
  605. The only things you may need to change in this file are the following
  606. variables: checkboxHeight, radioHeight and selectWidth (lines 24, 25, 26)
  607. The numbers you set for checkboxHeight and radioHeight should be one quarter
  608. of the total height of the image want to use for checkboxes and radio
  609. buttons. Both images should contain the four stages of both inputs stacked
  610. on top of each other in this order: unchecked, unchecked-clicked, checked,
  611. checked-clicked.
  612. You may need to adjust your images a bit if there is a slight vertical
  613. movement during the different stages of the button activation.
  614. The value of selectWidth should be the width of your select list image.
  615. Visit http://ryanfait.com/ for more information.
  616. */
  617. var checkboxHeight = "25";
  618. var radioHeight = "25";
  619. var selectWidth = "190";
  620. /* No need to change anything after this */
  621. document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; } .disabled { opacity: 0.5; filter: alpha(opacity=50); }</style>');
  622. var Custom = {
  623. init: function() {
  624. var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
  625. for(a = 0; a < inputs.length; a++) {
  626. if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") {
  627. span[a] = document.createElement("span");
  628. span[a].className = inputs[a].type;
  629. if(inputs[a].checked == true) {
  630. if(inputs[a].type == "checkbox") {
  631. position = "0 -" + (checkboxHeight*2) + "px";
  632. span[a].style.backgroundPosition = position;
  633. } else {
  634. position = "0 -" + (radioHeight*2) + "px";
  635. span[a].style.backgroundPosition = position;
  636. }
  637. }
  638. inputs[a].parentNode.insertBefore(span[a], inputs[a]);
  639. inputs[a].onchange = Custom.clear;
  640. if(!inputs[a].getAttribute("disabled")) {
  641. span[a].onmousedown = Custom.pushed;
  642. span[a].onmouseup = Custom.check;
  643. } else {
  644. span[a].className = span[a].className += " disabled";
  645. }
  646. }
  647. }
  648. inputs = document.getElementsByTagName("select");
  649. for(a = 0; a < inputs.length; a++) {
  650. if(inputs[a].className == "styled") {
  651. option = inputs[a].getElementsByTagName("option");
  652. active = option[0].childNodes[0].nodeValue;
  653. textnode = document.createTextNode(active);
  654. for(b = 0; b < option.length; b++) {
  655. if(option[b].selected == true) {
  656. textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
  657. }
  658. }
  659. span[a] = document.createElement("span");
  660. span[a].className = "select";
  661. span[a].id = "select" + inputs[a].name;
  662. span[a].appendChild(textnode);
  663. inputs[a].parentNode.insertBefore(span[a], inputs[a]);
  664. if(!inputs[a].getAttribute("disabled")) {
  665. inputs[a].onchange = Custom.choose;
  666. } else {
  667. inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled";
  668. }
  669. }
  670. }
  671. document.onmouseup = Custom.clear;
  672. },
  673. pushed: function() {
  674. element = this.nextSibling;
  675. if(element.checked == true && element.type == "checkbox") {
  676. this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px";
  677. } else if(element.checked == true && element.type == "radio") {
  678. this.style.backgroundPosition = "0 -" + radioHeight*3 + "px";
  679. } else if(element.checked != true && element.type == "checkbox") {
  680. this.style.backgroundPosition = "0 -" + checkboxHeight + "px";
  681. } else {
  682. this.style.backgroundPosition = "0 -" + radioHeight + "px";
  683. }
  684. },
  685. check: function() {
  686. element = this.nextSibling;
  687. if(element.checked == true && element.type == "checkbox") {
  688. this.style.backgroundPosition = "0 0";
  689. element.checked = false;
  690. } else {
  691. if(element.type == "checkbox") {
  692. this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
  693. } else {
  694. this.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
  695. group = this.nextSibling.name;
  696. inputs = document.getElementsByTagName("input");
  697. for(a = 0; a < inputs.length; a++) {
  698. if(inputs[a].name == group && inputs[a] != this.nextSibling) {
  699. inputs[a].previousSibling.style.backgroundPosition = "0 0";
  700. }
  701. }
  702. }
  703. element.checked = true;
  704. }
  705. },
  706. clear: function() {
  707. inputs = document.getElementsByTagName("input");
  708. for(var b = 0; b < inputs.length; b++) {
  709. if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") {
  710. inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
  711. } else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") {
  712. inputs[b].previousSibling.style.backgroundPosition = "0 0";
  713. } else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") {
  714. inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
  715. } else if(inputs[b].type == "radio" && inputs[b].className == "styled") {
  716. inputs[b].previousSibling.style.backgroundPosition = "0 0";
  717. }
  718. }
  719. },
  720. choose: function() {
  721. option = this.getElementsByTagName("option");
  722. for(d = 0; d < option.length; d++) {
  723. if(option[d].selected == true) {
  724. document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
  725. }
  726. }
  727. }
  728. }
  729. window.onload = Custom.init;
  730. /**
  731. * Resize function for the search widget
  732. */
  733. function SearchInputResize() {
  734. var get_search_button_size = jQuery('#searchsubmit').width();
  735. var padding = get_search_button_size + 50;
  736. jQuery('#searchform div').css('padding-right',padding);
  737. }
  738. /**
  739. * Vimeo Api
  740. * http://github.com/vimeo/froogaloop/raw/master/froogaloop.min.js
  741. */
  742. var Froogaloop=function(){var e={hasWindowEvent:false,PLAYER_DOMAIN:"",eventCallbacks:{},iframe_pattern:/player\.(([a-zA-Z0-9_\.]+)\.)?vimeo(ws)?\.com\/video\/([0-9]+)/i},j=function(b){b||(b=document.getElementsByTagName("iframe"));for(var a,c=0,f=b.length,g;c<f;c++){a=b[c];if(g=e.iframe_pattern.test(a.getAttribute("src"))){a.api=h.api;a.get=h.get;a.addEvent=h.addEvent}}},h={api:function(b,a){i(b,a,this)},get:function(b,a){k(b,a,this.id!=""?this.id:null);i(b,null,this)},addEvent:function(b,a){k(b,
  743. a,this.id!=""?this.id:null);b!="onLoad"&&i("api_addEventListener",[b,a.name],this);if(e.hasWindowEvent)return false;e.PLAYER_DOMAIN=d.getDomainFromUrl(this.getAttribute("src"));window.addEventListener?window.addEventListener("message",l,false):window.attachEvent("onmessage",l,false);e.hasWindowEvent=true}},i=function(b,a,c){if(!c.contentWindow.postMessage)return false;if(a===undefined||a===null)a="";var f=c.getAttribute("src").split("?")[0];b=d.serialize({method:b,params:a,id:c.getAttribute("id")});
  744. c.contentWindow.postMessage(b,f)},k=function(b,a,c){if(c){e.eventCallbacks[c]||(e.eventCallbacks[c]={});e.eventCallbacks[c][b]=a}else e.eventCallbacks[b]=a},l=function(b){if(b.origin!=e.PLAYER_DOMAIN)return false;var a=d.unserialize(b.data);b=a.params?a.params.split('"').join("").split(","):"";a=a.method;var c=b[b.length-1];if(c=="")c=null;if(a=c?e.eventCallbacks[c][a]:e.eventCallbacks[a])b.length>0?a.apply(null,b):a.call()},d={r20:/%20/g,isArray:function(b){return Object.prototype.toString.call(b)===
  745. "[object Array]"},isFunction:function(b){return Object.prototype.toString.call(b)==="[object Function]"},unserialize:function(b){if(!b)return false;var a={};b=b.split("&");for(var c,f,g=0;g<b.length;g++){c=unescape(b[g].split("=")[0]);f=unescape(b[g].split("=")[1]);if(f.indexOf("=")>-1)f=d.unserialize(f);a[c]=f}return a},s:false,serialize:function(b){d.s=[];for(var a in b)d.buildParams(a,b[a]);return d.s.join("&").replace(d.r20,"+")},buildParams:function(b,a){var c=0;if(d.isArray(a)){for(;c<a.length;c++)a[c]=
  746. encodeURIComponent(a[c]);d.addToParam(encodeURIComponent(b),a.join(","))}else d.addToParam(encodeURIComponent(b),encodeURIComponent(a))},addToParam:function(b,a){a=d.isFunction(a)?a():a;d.s[d.s.length]=b+"="+a},getDomainFromUrl:function(b){b=b.split("/");for(var a="",c=0;c<b.length;c++){if(c<3)a+=b[c];else break;if(c<2)a+="/"}return a}};j();return{init:j}}();
  747. /**
  748. * YouTube Api
  749. */
  750. (function(){var e=void 0,f=null,g,h=this,j=function(a){for(var a=a.split("."),b=h,c;c=a.shift();)if(b[c]!=f)b=b[c];else return f;return b},k="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36),aa=0,ba=function(a){return a.call.apply(a.bind,arguments)},ca=function(a,b){var c=b||h;if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return function(){var b=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(b,d);return a.apply(c,b)}}else return function(){return a.apply(c,
  751. arguments)}},m=function(){m=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?ba:ca;return m.apply(f,arguments)},n=function(a,b){var c=a.split("."),d=h;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var i;c.length&&(i=c.shift());)!c.length&&b!==e?d[i]=b:d=d[i]?d[i]:d[i]={}},p=function(a,b){o.prototype[a]=b},q=function(a,b){function c(){}c.prototype=b.prototype;a.p=b.prototype;a.prototype=new c};
  752. Function.prototype.bind=Function.prototype.bind||function(a){if(arguments.length>1){var b=Array.prototype.slice.call(arguments,1);b.unshift(this,a);return m.apply(f,b)}else return m(this,a)};var s=function(a){this.stack=Error().stack||"";if(a)this.message=String(a)};q(s,Error);var da=function(a){for(var b=1;b<arguments.length;b++)var c=String(arguments[b]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,c);return a},t=function(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};var u=function(a,b){b.unshift(a);s.call(this,da.apply(f,b));b.shift();this.o=a};q(u,s);var x=function(a,b){if(!a){var c=Array.prototype.slice.call(arguments,2),d="Assertion failed";if(b){d+=": "+b;var i=c}throw new u(""+d,i||[]);}};var y=Array.prototype,ea=y.indexOf?function(a,b,c){x(a.length!=f);return y.indexOf.call(a,b,c)}:function(a,b,c){c=c==f?0:c<0?Math.max(0,a.length+c):c;if(typeof a=="string"){if(typeof b!="string"||b.length!=1)return-1;return a.indexOf(b,c)}for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},fa=function(a,b,c){x(a.length!=f);return arguments.length<=2?y.slice.call(a,b):y.slice.call(a,b,c)};var ga=function(a){var b=z,c;for(c in b)if(a.call(e,b[c],c,b))return c};var A,B,C,D,E=function(){return h.navigator?h.navigator.userAgent:f};D=C=B=A=!1;var F;if(F=E()){var ha=h.navigator;A=F.indexOf("Opera")==0;B=!A&&F.indexOf("MSIE")!=-1;C=!A&&F.indexOf("WebKit")!=-1;D=!A&&!C&&ha.product=="Gecko"}var G=B,H=D,ia=C,I;
  753. a:{var J="",K;if(A&&h.opera)var L=h.opera.version,J=typeof L=="function"?L():L;else if(H?K=/rv\:([^\);]+)(\)|;)/:G?K=/MSIE\s+([^\);]+)(\)|;)/:ia&&(K=/WebKit\/(\S+)/),K)var M=K.exec(E()),J=M?M[1]:"";if(G){var N,O=h.document;N=O?O.documentMode:e;if(N>parseFloat(J)){I=String(N);break a}}I=J}
  754. var ja=I,P={},Q=function(a){var b;if(!(b=P[a])){b=0;for(var c=String(ja).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),i=Math.max(c.length,d.length),l=0;b==0&&l<i;l++){var r=c[l]||"",la=d[l]||"",ma=RegExp("(\\d*)(\\D*)","g"),na=RegExp("(\\d*)(\\D*)","g");do{var v=ma.exec(r)||["","",""],w=na.exec(la)||["","",""];if(v[0].length==0&&w[0].length==0)break;b=t(v[1].length==0?0:parseInt(v[1],10),w[1].length==0?0:parseInt(w[1],10))||t(v[2].length==
  755. 0,w[2].length==0)||t(v[2],w[2])}while(b==0)}b=P[a]=b>=0}return b};!G||Q("9");!H&&!G||G&&Q("9")||H&&Q("1.9.1");G&&Q("9");var ka=function(){};var R=function(){this.c=[];this.d={}};q(R,ka);R.prototype.i=1;R.prototype.f=0;var oa=function(a,b,c){var d=a.d[b];d||(d=a.d[b]=[]);var i=a.i;a.c[i]=b;a.c[i+1]=c;a.c[i+2]=e;a.i=i+3;d.push(i)};
  756. R.prototype.k=function(a){var b=this.d[a];if(b){this.f++;for(var c=fa(arguments,1),d=0,i=b.length;d<i;d++){var l=b[d];this.c[l+1].apply(this.c[l+2],c)}this.f--;if(this.e&&this.f==0)for(;b=this.e.pop();)if(this.f!=0){if(!this.e)this.e=[];this.e.push(b)}else if(c=this.c[b]){if(c=this.d[c])d=c,c=ea(d,b),c>=0&&(x(d.length!=f),y.splice.call(d,c,1));delete this.c[b];delete this.c[b+1];delete this.c[b+2]}}};var S=function(a){if(a=a||j("window.event")){this.type=a.type;var b=a.target||a.srcElement;if(b&&b.nodeType==3)b=b.parentNode;this.target=b;if(b=a.relatedTarget)try{b=b.nodeName&&b}catch(c){b=f}else if(this.type=="mouseover")b=a.fromElement;else if(this.type=="mouseout")b=a.toElement;this.relatedTarget=b;this.data=a.data;this.source=a.source;this.origin=a.origin;this.state=a.state;this.clientX=a.clientX!==e?a.clientX:a.pageX;this.clientY=a.clientY!==e?a.clientY:a.pageY;if(a.pageX||a.pageY)this.pageX=
  757. a.pageX,this.pageY=a.pageY;else if((a.clientX||a.clientY)&&document.body&&document.documentElement)this.pageX=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.pageY=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;this.keyCode=a.keyCode||0;this.charCode=a.charCode||(this.type=="keypress"?this.keyCode:0);this.n=a}};g=S.prototype;g.type="";g.target=f;g.relatedTarget=f;g.currentTarget=f;g.data=f;g.source=f;g.origin=f;g.state=f;g.keyCode=0;g.charCode=0;
  758. g.n=f;g.clientX=0;g.clientY=0;g.pageX=0;g.pageY=0;var z=j("yt.events.listeners_")||{};n("yt.events.listeners_",z);var T=j("yt.events.counter_")||{count:0};n("yt.events.counter_",T);var pa=function(a,b){return ga(function(c){return c[0]==a&&c[1]=="message"&&c[2]==b})},ra=function(){var a=window,b=qa;if(a&&(a.addEventListener||a.attachEvent)){var c=pa(a,b);if(!c){var c=++T.count+"",d=function(c){c=new S(c);c.currentTarget=a;return b.call(a,c)};z[c]=[a,"message",b,d];a.addEventListener?a.addEventListener("message",d,!1):a.attachEvent("onmessage",d)}}};n("yt.config_",window.yt&&window.yt.config_||{});n("yt.globals_",window.yt&&window.yt.globals_||{});n("yt.msgs_",window.yt&&window.yt.msgs_||{});n("yt.timeouts_",window.yt&&window.yt.timeouts_||[]);var U=window.yt&&window.yt.intervals_||[];n("yt.intervals_",U);eval("/*@cc_on!@*/false");var V=window.YTConfig||{},sa={width:640,height:390,title:"video player",host:"http://www.youtube.com",apiReady:"onYouTubePlayerAPIReady"},ta={0:"onEnded",1:"onPlaying",2:"onPaused",3:"onBuffering",5:"onVideoCued"},W=f,X=function(a,b){return(b?b:{})[a]||V[a]||sa[a]},qa=function(a){if(a.origin==X("host")){var a=JSON.parse(a.data),b=W[a.id];switch(a.event){case "onReady":window.clearInterval(b.h);Y(b,"onReady");break;case "onStateChange":b.state=a.state;Z(b,a);Y(b,"onStateChange",b.state);b.state!=-1&&
  759. Y(b,ta[b.state]);break;case "onPlaybackQualityChange":b.l=a.quality;Y(b,"onPlaybackQualityChange",b.l);break;case "onError":Y(b,"onError",a.error);break;case "infoDelivery":Z(b,a)}}},o=function(a,b){var c=typeof a=="string"?document.getElementById(a):a;if(c){if(c.tagName.toLowerCase()!="iframe"){var d=document.createElement("iframe");c.appendChild(d);d.setAttribute("frameborder","0");d.setAttribute("title","YouTube "+X("title",b));d.setAttribute("type","text/html");if(b&&(d.height=X("height",b),d.width=
  760. X("width",b),"videoId"in b||"videoId"in V)){c=X("playerVars",b)||[];c.enablejsapi=1;window.location.host&&(c.origin=window.location.protocol+"//"+window.location.host);var i=[],l;for(l in c)c.hasOwnProperty(l)&&i.push(l+"="+c[l]);d.src=X("host",b)+"/embed/"+X("videoId",b)+"?"+i.join("&")}c=d}this.b=c;this.id=this[k]||(this[k]=++aa);this.a={};this.g=new R;d=this.id;W||(W={},ra());W[d]=this;d=m(this.j,this);d=window.setInterval(d,250);U.push(d);this.h=d;if(b){var d=X("events",b),r;for(r in d)d.hasOwnProperty(r)&&
  761. this.addEventListener(r,d[r])}}};g=o.prototype;g.m=function(){var a=this.b;a&&a.parentNode&&a.parentNode.removeChild(a)};g.b=f;g.id=0;g.h=0;g.state=-1;g.g=f;g.j=function(){this.sendMessage({event:"listening"})};var Z=function(a,b){var c=b.info||{},d;for(d in c)c.hasOwnProperty(d)&&(a.a[d]=c[d])};o.prototype.addEventListener=function(a,b){var c=b;typeof b=="string"&&(c=function(){window[b].apply(window,arguments)});oa(this.g,a,c)};
  762. var Y=function(a,b,c){a.g.k(b,{target:a,data:c})},$=function(a,b,c){c=c||[];c=Array.prototype.slice.call(c);a.sendMessage({event:"command",func:b,args:c})};g=o.prototype;g.sendMessage=function(a){a.id=this.id;this.b.contentWindow.postMessage(JSON.stringify(a),X("host"))};g.cueVideoById=function(){$(this,"cueVideoById",arguments);return this};g.loadVideoById=function(){$(this,"loadVideoById",arguments);return this};g.cueVideoByUrl=function(){$(this,"cueVideoByUrl",arguments);return this};
  763. g.loadVideoByUrl=function(){$(this,"loadVideoByUrl",arguments);return this};g.playVideo=function(){$(this,"playVideo");return this};g.pauseVideo=function(){$(this,"pauseVideo");return this};g.stopVideo=function(){$(this,"stopVideo");return this};g.seekTo=function(){$(this,"seekTo",arguments);return this};g.clearVideo=function(){$(this,"clearVideo");return this};g.mute=function(){$(this,"mute");return this};g.unMute=function(){$(this,"unMute");return this};g.isMuted=function(){return this.a.isMuted};
  764. g.setVolume=function(){$(this,"setVolume",arguments);return this};g.getVolume=function(){return this.a.volume};g.setSize=function(a,b){this.b.width=a;this.b.height=b;return this};g.getVideoBytesLoaded=function(){return this.a.videoBytesLoaded};g.getVideoBytesTotal=function(){return this.a.videoBytesTotal};g.getVideoStartBytes=function(){return this.a.videoStartBytes};g.getPlayerState=function(){return this.state};g.getCurrentTime=function(){return this.a.currentTime};g.getPlaybackQuality=function(){return this.a.quality};
  765. g.setPlaybackQuality=function(){$(this,"setPlaybackQuality",arguments);return this};g.getAvailableQualityLevels=function(){return this.a.availableQualityLevels};g.getDuration=function(){return this.a.duration};g.getVideoUrl=function(){return this.a.videoUrl};g.getVideoEmbedCode=function(){return'<iframe title="'+this.b.title+'" class="'+this.b.className+'" width="'+this.b.width+'" height="'+this.b.height+'" src="'+this.b.src+'" type="text/html" frameborder="0"></iframe>'};n("YT.PlayerState.ENDED",0);n("YT.PlayerState.PLAYING",1);n("YT.PlayerState.PAUSED",2);n("YT.PlayerState.BUFFERING",3);n("YT.PlayerState.CUED",5);n("YT.Player",o);p("destroy",o.prototype.m);p("cueVideoById",o.prototype.cueVideoById);p("loadVideoById",o.prototype.loadVideoById);p("cueVideoByUrl",o.prototype.cueVideoByUrl);p("loadVideoByUrl",o.prototype.loadVideoByUrl);p("playVideo",o.prototype.playVideo);p("pauseVideo",o.prototype.pauseVideo);p("stopVideo",o.prototype.stopVideo);p("seekTo",o.prototype.seekTo);
  766. p("clearVideo",o.prototype.clearVideo);p("mute",o.prototype.mute);p("unMute",o.prototype.unMute);p("isMuted",o.prototype.isMuted);p("setVolume",o.prototype.setVolume);p("getVolume",o.prototype.getVolume);p("setSize",o.prototype.setSize);p("getVideoBytesLoaded",o.prototype.getVideoBytesLoaded);p("getVideoBytesTotal",o.prototype.getVideoBytesTotal);p("getVideoStartBytes",o.prototype.getVideoStartBytes);p("getPlayerState",o.prototype.getPlayerState);p("getCurrentTime",o.prototype.getCurrentTime);
  767. p("getPlaybackQuality",o.prototype.getPlaybackQuality);p("setPlaybackQuality",o.prototype.setPlaybackQuality);p("getAvailableQualityLevels",o.prototype.getAvailableQualityLevels);p("getDuration",o.prototype.getDuration);p("getVideoUrl",o.prototype.getVideoUrl);p("getVideoEmbedCode",o.prototype.getVideoEmbedCode);p("addEventListener",o.prototype.addEventListener);var ua=j(X("apiReady"));ua&&ua();})();