(function() { // Localize jQuery variable var jQuery; /******** Load jQuery if not present *********/ if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2') { var script_tag = document.createElement('script'); script_tag.setAttribute('type','text/javascript'); script_tag.setAttribute('src', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'); script_tag.onload = scriptLoadHandler; script_tag.onreadystatechange = function () { // Same thing but for IE if (this.readyState == 'complete' || this.readyState == 'loaded') { scriptLoadHandler(); } }; // Try to find the head, otherwise default to the documentElement (document.getElementsByTagName('head')[0] || document.documentElement).appendChild(script_tag); } else { // The jQuery version on the window is the one we want to use jQuery = window.jQuery; main(); } /******** Called once jQuery has loaded ******/ function scriptLoadHandler() { // Restore $ and window.jQuery to their previous values and store the // new jQuery in our local jQuery variable jQuery = window.jQuery.noConflict(true); // Call our main function main(); } /******** Our main function ********/ function main() { jQuery(document).ready(function($) { /******* Load CSS *******/ /* var css_link = $('', { rel: 'stylesheet', type: 'text/css', href: '' }); css_link.appendTo('head'); */ /******* Load HTML *******/ var jsonp_url = 'http://newyork.nearsay.com/nearsay_widget_content/all/37009/1221/tall_wide/Bright Lights, My City Market/javascript//666666|D75242|000000|D75242|666666|666666'; $.ajax({ dataType: 'jsonp', url: jsonp_url, success: function (data) { $('#nearsay_marketplace_widget').html(data.html); /* $('.ab_widget_body_inner').fadeIn(); */ }, }); $('.deal_button').live('click', function() { var current_deal_nid = $(this).attr('current_deal_nid'); var next_deal_nid = $(this).attr('next_deal_nid'); $('#deal-' + current_deal_nid).fadeOut('fast', function(){ $('#deal-' + next_deal_nid).fadeIn('fast'); var next_next_deal = $('#deal-' + next_deal_nid).attr('next_deal_nid'); $('.deal_button').attr('current_deal_nid', next_deal_nid); $('.deal_button').attr('next_deal_nid', next_next_deal); }); }); $('.widget_business_logo').live('mouseover mouseout', function(event) { if (event.type == 'mouseover') { var nid = $(this).attr('nid'); $('#details-'+nid).css('display', 'block'); $('#details-inner-'+nid).fadeIn('fast'); } else { var nid = $(this).attr('nid'); $('#details-'+nid).css('display', 'none'); $('#details-inner-'+nid).css('display', 'none'); } }); //GOOGLE NETWORK: not sure how well this will work in iframe var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-17190531-2']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); //QUANTCAST: not sure how well this will work in iframe var _qevents = _qevents || []; (function() { var elem = document.createElement('script'); elem.src = (document.location.protocol == 'https:' ? 'https://secure' : 'http://edge') + '.quantserve.com/quant.js'; elem.async = true; elem.type = 'text/javascript'; var scpt = document.getElementsByTagName('script')[0]; scpt.parentNode.insertBefore(elem, scpt); })(); _qevents.push({ qacct:'p-beau88unv3E2c' }); }); } })(); // Call anonymous function immediately