$(document).ready(function() {	

	$("select").selectbox();
	$("li").click(function() {
		doSort();
	});

	$("div.contest").hover(function() {
		$(this).addClass("conteston");
	},function() {
		$(this).removeClass("conteston");
	});
	
	$("div.contest").click(function() {
		var url = $(this).attr("rel");
		if ($(this).hasClass('featuredad')) {
			window.open(url);
			return false;
		} else {
			window.location.href="http://www.onlinevideocontests.com/contest/"+url;
			return false;
		}
	});
	
	$("#nonadcontent").bind('click',function(e) {
		if (!e) var e = window.event;
		e.cancelBubble = true;
		if (e.stopPropagation) e.stopPropagation();
	});

	$("div.options").click(function() {
		return false;
	});
	
	$("img.pgbutton").hover(function() {
		var wht = $(this).attr("rel");
		
		if (wht == "prev") {
			$(this).attr("src","/images/button_prev10_over.png");
		} else {
			$(this).attr("src","/images/button_next10_over.png");
		}
	}, function() {
		var wht = $(this).attr("rel");
		
		if (wht == "prev") {
			$(this).attr("src","/images/button_prev10.png");
		} else {
			$(this).attr("src","/images/button_next10.png");
		}
	});
	
	$("img.pgbutton").click(function() {
		var wht = $(this).attr("rel");
		
		if (wht == "prev") {
			$(this).attr("src","/images/button_prev10_on.png");
		} else {
			$(this).attr("src","/images/button_next10_on.png");
		}
	});
	
});

function StopPropagation(e)
{
	if (window.event) {
		e.cancelBubble=true; // IE
	} else {
		e.stopPropagation(); // Others
	}
}


