
$(document).ready(function(){

	// Show Hide
	$(".slidingDiv").hide();
	$(".show_hide").show();
	$('.show_hide').click(function(){
	$(".slidingDiv").slideToggle();
	});

	$(".slidingDivTorrent").hide();
	$(".show_hideTorrent").show();
	$('.show_hideTorrent').click(function(){
	$(".slidingDivTorrent").slideToggle();
	});


	$(".slidingDivTracker").hide();
	$(".show_hideTracker").show();
	$('.show_hideTracker').click(function(){
	$(".slidingDivTracker").slideToggle();
	});


	// Search Form
	$("#query").attr("value", "Torrent Search ...");
	var text = "Torrent Search ...";

	$("#query").focus(function() {
	$(this).addClass("active");
	if($(this).attr("value") == text) $(this).attr("value", "");
	});
		
	$("#query").blur(function() {
	$(this).removeClass("active");
	if($(this).attr("value") == "") $(this).attr("value", text);
	});

	// Query SEO
	$('#query').friendurl({id : 'link1'});

	$('#searchform').submit(function() {
		var seo_text = $('#link1').val();

		if (seo_text == "") { 
			alert("Please write atleat one keyword in search field.");
			return false;
		} else {
			goUrl = 'http://www.torrentspy.biz/search/' + seo_text + '/1/';
			window.location = goUrl;
			return false;
		}

	});
	$('#searchform').submit( function() {
		return false;
	});

	// ZEBRA TABLES
	$('.r0,.r1').hover(function(){
		$(this).children().addClass('datahighlight');
	},function(){
		$(this).children().removeClass('datahighlight');
	});

	$(".stripeMe tr").mouseover(function() {
		$(this).addClass("over");
	}).mouseout(function() {
		$(this).removeClass("over");
	});
	$(".stripeMe tr:even").addClass("alt");


	// HOME TABS
	$(".tab_content").hide();
	$("ul.tabs li:first").addClass("active").show();
	$(".tab_content:first").show();

	$("ul.tabs li").click(function()
       {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab_content").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn();
		return false;
	});



});

var profiles =
{
	windowCenter:
	{
		height:440,
		width:550,
		center:1
	}
};

function unloadcallback(){
	alert("unloaded");
};

$(function() {
	$(".popupwindow").popupwindow(profiles);
});



jQuery(function() {
	jQuery.support.borderRadius = false;
	jQuery.each(['BorderRadius','MozBorderRadius','WebkitBorderRadius','OBorderRadius','KhtmlBorderRadius'], function() {
		if(document.body.style[this] !== undefined) jQuery.support.borderRadius = true;
		return (!jQuery.support.borderRadius);
	});
});
$(function() {
	if(!$.support.borderRadius) {
		$('.button').each(function() {
			$(this).wrap('<div class="buttonwrap"></div>')
			.before('<div class="corner tl"></div><div class="corner tr"></div>')
			.after('<div class="corner bl"></div><div class="corner br"></div>');
		});
	}
});

