// 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; }, 5000); }; } $(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; }); jQuery("#SON #Slideshow .panel").addClass( 'Show' ); theInterval(); } }); // Poll jQuery if(document.getElementById('PollDynamics')) { $("#PollDynamics .SubmitButton").click(function() { $("#Poll").css("min-height",$("#Poll").height()); $("#PollDynamics").fadeOut(500, function () { UpdatePoll($('#TrackingURL').val()); $(this).html(''); }); return false; }); } function UpdatePoll(trackingURL) { $("#PollDynamics").load( "http://www.thestyleglossy.com/ru/includes/pollphp.php", $("#PollForm").serializeArray(), DisplayPollResults(trackingURL) ); } function DisplayPollResults(trackingURL) { $("#PollDynamics").fadeIn(500); $("#PollResults").load( trackingURL, '' ); } function GetNextPoll(newURL) { $("#Poll .Wrapper").fadeOut(500, RefreshPollContent(newURL)); } function RefreshPollContent(newURL) { $.ajax({ url:newURL, dataType:'html', timeout:5000, success:function (html) { $("#Poll .Wrapper").html(html); $("#Poll .Wrapper").fadeIn(500); $("#Poll .Wrapper #PollDynamics #PollForm fieldset input.SubmitButton").bind("click", function() { $("#Poll").css("min-height",$("#Poll").height()); $("#PollDynamics").fadeOut(500, function () { UpdatePoll($('#Poll #TrackingURL').val()) }); return false; }); } }); }