// Poll jQuery if(document.getElementById('PollDynamics')) { $("#PollDynamics .SubmitButton").click(function() { $("#SBPoll").css("min-height",$("#SBPoll").height()); $("#PollDynamics").fadeOut(500, function () { UpdatePoll($('#TrackingURL').val()); $(this).html(''); }); return false; }); } function UpdatePoll(trackingURL) { $("#PollDynamics").load( "http://www.itinsideronline.com/includes/poll.php", $("#PollForm").serializeArray(), DisplayPollResults(trackingURL) ); } function DisplayPollResults(trackingURL) { $("#PollDynamics").fadeIn(500); $("#PollResults").load( trackingURL, '' ); } function GetNextPoll(newURL) { $("#SBPoll .Wrapper").fadeOut(500, RefreshPollContent(newURL)); } function RefreshPollContent(newURL) { $.ajax({ url:newURL, dataType:'html', timeout:5000, success:function (html) { $("#SBPoll .Wrapper").html(html); $("#SBPoll .Wrapper").fadeIn(500); $("#SBPoll .Wrapper #PollDynamics #PollForm fieldset input.SubmitButton").bind("click", function() { $("#SBPoll").css("min-height",$("#SBPoll").height()); $("#PollDynamics").fadeOut(500, function () { UpdatePoll($('#SBPoll #TrackingURL').val()) }); return false; }); } }); } function ClearText(Elem,DefaultText) { if(Elem) { if(typeof(Elem.value) != 'undefined') { if (Elem.value == DefaultText) { Elem.value = ''; } } else if(typeof(Elem.innerHTML) != 'undefined') { if (Elem.value == DefaultText) { Elem.innerHTML = ''; } } } } function DefaultText(Elem,DefaultText) { if(Elem) { if(typeof(Elem.value) != 'undefined') { if (Elem.value == '') { Elem.value = DefaultText; } } else if(typeof(Elem.innerHTML) != 'undefined') { if (Elem.innerHTML == '') { Elem.innerHTML = DefaultText; } } } } // Code for the jQuery slideshow initialization if(document.getElementById('main-photo-slider')) { var theInt = null; var $navthumb, $highlightthumb; var curclicked = 0; theInterval = function(cur){ clearInterval(theInt); if( typeof cur != 'undefined' ) curclicked = cur; $highlightthumb.removeClass("active-thumb"); $highlightthumb.eq(curclicked).addClass("active-thumb"); $(".stripNav ul li a").eq(curclicked).trigger('click'); theInt = setInterval(function(){ $highlightthumb.removeClass("active-thumb"); $highlightthumb.eq(curclicked).addClass("active-thumb"); $(".stripNav ul li a").eq(curclicked).trigger('click'); curclicked++; if( $highlightthumb.length == curclicked ) curclicked = 0; }, 6000); }; } $(function(){ if(document.getElementById('main-photo-slider')) { $("#main-photo-slider").codaSlider(); $navthumb = $(".nav-thumb"); $highlightthumb = $("#SlideShowNav li a"); $navthumb .click(function() { var $this = $(this); theInterval($this.parent().attr('href').slice(1) - 1); return false; }); var LastHeight = 0; $("#SlideShowNav li a span").each(function(index) { var ThisHeight = $(this).height(); if( ThisHeight > LastHeight) { LastHeight = ThisHeight; } var Height = LastHeight + 'px'; $(this).css("min-height", Height); }); // display all hidden slides jQuery(".son #Slideshow .panel").addClass( 'Show' ); theInterval(); } }); // Rating Stars // Highlight stars function HighlightStars( StarElement, Score ) { var MaxStars = 5; var Container = StarElement.parentNode; var Stars = Container.getElementsByTagName('a'); for( var StarIndex = 0; StarIndex < MaxStars; StarIndex++ ) { Stars[StarIndex].className = 'Star' + ( StarIndex+1 <= Score ? 'On' : 'Off' ); } } // Submit Rating Form if(document.getElementById('RatingForm')) { $("#RatingForm a").click(function() { $('#RatingScore').val($(this).attr('rel')); $("#RatingForm").submit(); return false; }); } // Fix z-index issues in ie7 if($.browser.msie) { userAgent = $.browser.version; version = userAgent.substring(0,userAgent.indexOf('.')); if(version==7 || version==6) { $(function() { var zIndexNumber = 10000; $('*').each(function() { $(this).css('zIndex', zIndexNumber); zIndexNumber -= 1; }); }); } } /*************************************************************** * Rate This Slideshow [Incredibly trimmed down version] ***************************************************************/ $(document).ready( function () { $(".son #PromoGeekGadgets .SlideForRatings").each( function () { $(this).hover( function() { $('#' + $(this).attr("id") + ' .excerpt').animate({opacity: 0.85}, 100); }, function() { $('#' + $(this).attr("id") + ' .excerpt').animate({opacity: 0.0}, 100); } ); } ); } ); /*************************************************************** * END Rate This Slideshow ***************************************************************/ // Geek Gadget Rating function submitRateThis (obj) { $(obj.swap).fadeOut(500, function () { $.ajax({ url:"#PATHTYPE(Root)#INSERT(TextFile,PHPRateThis)#ENDPATHTYPE", type:"post", dataType:"json", data:obj, timeout:5000, success: function (response) { $(obj.dest).html("

" + response.details + "

"); $(obj.dest).fadeIn(500); }, error: function (response) {} }); } ); }