﻿
$(document).ready(function() {

// Emo Vote (single.php)
$('.emo-vote').hide();

// Picture Switcher (single.php)
var imgWrapper = $('.slideshow > img');
imgWrapper.hide().filter(':first').show();

$('ul.recentlist li a').mouseover(function () {
if (this.className.indexOf('current') == -1){
imgWrapper.hide();
//imgWrapper.filter(this.hash).fadeIn(50);
imgWrapper.filter(this.rel).fadeIn(20);

$('ul.recentlist li a').removeClass('current');
$(this).addClass('current');
}
var AtnStatus = 'Click now to vote for ' + $(".current").text();
$('#atn_status').text(AtnStatus);

return false;
});



}); // ready.function

/////////////////////////////////////////////
/////////////////////////////////////////////

function callflags(AdrFromBody) {$('#theflags').html(geturl(AdrFromBody));}
function geturl(addr) {var r = $.ajax({type: 'GET',url: addr,async: false}).responseText;return r;}

function EffectBlink(element_id){ // add # before
var blinkCount = 4*2;// 2*2 for two blinks, 4*2 for four blinks
do {$(element_id)['fade'+(blinkCount%2==0?'Out':'In')]('slow');} while (--blinkCount);
} // EffectBlink

$(function(){$('#vote-wrapper a').click(function(){
var VoteFor = $(this).attr("votefor");
var PostID = $(this).attr("pid");
var ValThis = "/_helper/validate.php?callflags=1&pid="+PostID+"&votefor="+VoteFor;
callflags(ValThis);
$('#theflags').show();
$('#vote-wrapper').hide();
EffectBlink('#tit_comment');
});});



// Click Tracking
$(function(){$('#clicktrack_gfc a,#singlesamples a').click(function(){$.get($(this).attr("goto"));return true;});});

// Click Tracking v2
$(function(){$('a[linktoaff="socialbookmark"],a[linktoaff="affout"],a[linktoaff="randtradeout"],a[linktoaff="vidz"],a[linktoaff="wfw"],a[linktoaff="motd"],a[linktoaff="vidzidxsb"],a[linktoaff="pictotrade"],a[linktoaff="texttotrade"],a[linktoaff="carolcox"],a[linktoaff="atk"],a[linktoaff="fem"],a[linktoaff="sim"],a[linktoaff="sap"]').click(function(){
var Fetch1 = $(this).attr("linktoaff");
var SaveTo = "http://www.dressed-undressed.com/_helper/validate.php?linktoaff=" + Fetch1;
window.location.href = $(this).attr("href");
$.get(SaveTo); return false;
});});