// vLib

// vTrack Implement
$().ready( function() {
	p = location.href.split('/');
	k = "http://" + p[2] + "/vTracker/?u=" + window.location.pathname + "|" + document.referrer;
	$("#vT").load(k);
});
// Tagger Implementer
$( function() {
	i = 0;
	$('#iMain img').each( function() {
		i++;

		s = $(this).attr("src");
		$(this).after("<div class='i020' id='Tag_" + i + "D'><form><input title='Enter TAG word, use [,] as seperator' type='text' class='tagge' id='Tag_" + i + "T' name='Tag_" + i + "T' /><input type='submit' id='Tag_" + i + "' class='taggeB' name='Tag_" + i + "' value='!Tag'><input type='hidden' id='Tag_" + i + "H' name='Tag_" + i + "H' value='" + s + "'></form></div>");
	});
	var data = "Bikini Beach Hot Sexy Cute Model Gorgeous Oops Fashion Lingerie Girls".split(" ");
	$(".tagge").autocomplete(data, {
		multiple: true,
		mustMatch: false,
		autoFill: true
	});

})
// Banner Placer
$( function() {
	$('#iMain img').each( function() {
		s = $(this).attr("src").split('/');
		s = s[s.length - 1].replace('/-/g', ' ').replace('.jpg', '').replace('.png', '').replace('/-/g', ' ').replace('/_/g', ' ');
		$(this).attr('alt', s);
		$(this).wrap("<div class='i010' />");
		$(this).after("<h5><span>" + s + "</span></h5>");
		$(this).attr('alt', s);
		$(this).wrap('<a href="' + $(this).attr("src") + '" title="' + s + '" class="lightbox" />');
	});
	$('a.lightbox').lightBox();
	$('#iMain img').removeAttr('height')
})
// Tagger Handler
$( function() {
	$(".taggeB").click( function() {

		t1 = $("#" + this.name + "T").val().trim();
		$("#" + this.name + "T").val(t1);
		if (t1 == "") {
			alert("Please enter the keyword, before submitting.");
			$("#" + this.name + "T").focus();
		} else {
			alert('Thanks you for !TAGing this image.');
			p = location.href.split('/');
			k = "http://" + p[2] + "/vTagger/?t=" + t1 + "&i=" + $("#" + this.name + "H").val() + "&p=" + window.location.pathname;

			$("#vT").load(k);
			$("#" + this.name + "D").html(t1);
		}
		return false;
	})
})
// Grid row color highlighter
$( function() {
	$('.vTableLi ul').hover( function() {
		$(this).children().addClass('vRowHLight');
	}, function() {
		$(this).children().removeClass('vRowHLight');
	});
});

