1.  
  2. /** $.log(m, x)
  3. * @author Russell Madsen russell [at] madsendev.com
  4. * @version Jan.2010
  5. * @url http://www.madsendev.com/
  6. *
  7. * @param m: The message you are wanting to log - it
  8. * could be an object, or string
  9. * @param x: The logging classification
  10. */
  11. var logger = true;// set to false for production
  12. $.log = function(m, x){
  13. //if logging is enabled, allow user to log messages
  14. if (!logger) {return false;}
  15. else if('console' in window && console.debug) {
  16. switch(x){
  17. case 'debug':console.debug(m);break;
  18. case 'error':console.error(m);break;
  19. case 'info': console.info(m);break;
  20. case 'warn': console.warn(m);break;
  21. default: console.log(m); break;
  22. }
  23. } else { /*alert(m);*/ }
  24. }
  25.  
  26.  
  27. //function for flash to call to open the modal
  28. var openSignupModal = function(){
  29.  
  30. $('#flashgoeshere').css({'visibility':'hidden'});
  31. $('#SWADenver').append('<div id="carousel-noscript" class="png_bg"></div>');
  32.  
  33. $.openDOMWindow({
  34. borderSize:0,
  35. borderColor:'transparent',
  36. height:544,
  37. width:827,
  38. positionType:'absolute',
  39. positionTop:100,
  40. positionLeft:($(window).width()/2 - 408),
  41. loader:1,
  42. loaderImagePath:'/landing/den/images/sw-denver/loading.gif',
  43. loaderHeight:16,
  44. loaderWidth:17,
  45. windowPadding:0,
  46. windowSource:'ajax',
  47. windowHTTPType:'get',
  48. windowSourceURL:'/landing/den/entryform.html'
  49. });
  50.  
  51. $.log("after openDOMWINDOW");
  52. }
  53.  
  54.  
  55. /**=== DOM READY ===**/
  56. $( function(){
  57.  
  58. /**=== EVENT HANDLING ===**/
  59. /* Actions for clicking the yes button
  60. * Action Taken on click: show the sign-up form
  61. */
  62.  
  63.  
  64. /**==IE detection==**/
  65. if($.browser.msie && $.browser.version=="6.0"){
  66. //ie 6 actions
  67. $.fx.off = true;
  68. DD_belatedPNG.fix('.png_bg, .imgReplacement');
  69. } else if( $.browser.msie ){
  70. //general ie actions
  71. $('.btn_yes').blend({speed:300, top:true});
  72. } else {
  73. //standards complient browsers' actions
  74. $('.btn_yes').blend({ speed:300, top:true });
  75. }
  76.  
  77. /*
  78. //Create ticker plugin - remove comments to enable if there is more than one item in the ticker
  79. $('.ticker').cycle({
  80. fx: 'fade',
  81. timeout: 7000,
  82. speed: 1000,
  83. speedIn: 1000,
  84. speedOut: 'fast',
  85. pause: true
  86. });
  87. */
  88.  
  89. function checkIfFlash(){
  90. if( $('#SWADenver object').length ){
  91. $.log("flash enabled :)");
  92. //Hide JS related
  93. $('#jsgoeshere').hide();
  94. //Detect version and give popup to the upload
  95. playerVersion = swfobject.getFlashPlayerVersion();
  96. if(playerVersion.major < 12){
  97. $.openDOMWindow({
  98. borderSize:0,
  99. borderColor:'transparent',
  100. height:318,
  101. width:613,
  102. positionType:'absolute',
  103. positionTop:100,
  104. positionLeft:($(window).width()/2 - 306),
  105. loader:1,
  106. loaderImagePath:'/landing/den/images/sw-denver/loading.gif',
  107. loaderHeight:16,
  108. loaderWidth:17,
  109. windowPadding:0,
  110. windowSource:'ajax',
  111. windowHTTPType:'get',
  112. windowSourceURL:'/landing/den/ajax_flashinstall_popup.html'
  113. });
  114. }
  115. } else {
  116. $.log("no flash enabled :(");
  117. //LOAD THE JS CAROUSEL AFTER THE PAGE AND ALL OTHER SCRIPTS IF NO FLASH IS ENABLED
  118. $("#carousel-noscript").hide();
  119. $('#d_carousel .content').hide();
  120. $('#d_carousel #no-script').hide();
  121. $('#nine11').hide();
  122. $('#d_carousel .content').load("ajax_carousel.html", function(){
  123. setTimeout( function(){
  124. $('#d_carousel #loading').fadeTo(1000, 0, function(){ $(this).remove();});
  125. $('#d_carousel .content').fadeIn(1200, function(){
  126. $(this).css({'display': 'block'});
  127. });
  128. }, 1200 );
  129. });
  130. }
  131. }
  132.  
  133. //LOAD THE CAROUSEL AFTER THE PAGE AND ALL OTHER SCRIPTS
  134. var flashvars = {};
  135. flashvars.xmlDir = "/landing/den/flash/xml/";
  136. flashvars.flvDir = "/landing/den/flash/flv/denverlandingpage/";
  137. flashvars.imageDir = "/landing/den/flash/images/denverlandingpage/";
  138. var params = {};
  139. params.wmode = "transparent";
  140. params.base = "";
  141. var attributes = {};
  142. attributes.id = "flashgoeshere";
  143. swfobject.embedSWF("flash/swf/SouthWestDenver.swf", "flashgoeshere", "960", "503", "9.0.0", "flash/swf/expressInstall.swf", flashvars, params, attributes, checkIfFlash);
  144.  
  145.  
  146. });
  147.