$(document).ready(function(){
	$('a.colorbox').colorbox({
		maxWidth: "90%",
		photo: true
	});

	$(".youtube").colorbox({
		iframe:true, 
		innerWidth:425, 
		innerHeight:344
	});
	
	$("a[href^='http:']").not("[href*='winmodify.com']").attr('target','_blank');

	// Alternating row colors shoutbox
	$("div.shout_name:even").css("background-color", "#F7F7F7");
	$("div.shout_name:odd").css("background-color", "#FFFFFF");
	// Table rows
	$("tr.row:even").css("background-color", "#F7F7F7");
	$("tr.row:odd").css("background-color", "#FFFFFF");

	// Correct style for breadcrumbs
	$("div.blocklarge").addClass("blocksmall");
	$("div.blocklarge").removeClass("blocklarge");

	// Shoutbox
	$("#shout_show").click(function () {
		$("#shout_input").show("slow");
		$("#shout_button").hide("slow");
	});

	$("#shout_hide").click(function () {
		$("#shout_input").hide("slow");
		$("#shout_button").show("slow");
		// Erase field content
		var field = document.getElementsByName('shout')[0];
		field.value = '';
		textCounter(field, 100);
	});

	// Most hits
	$("div.mosthits_toggle").hover(
		function() {
			$("div.mosthits").show("slow");
		},
		function() {
			$("div.mosthits").hide("slow");
		}
	);
	
	//Skin in the Picture
	/*$("div.sitp_toggle").hover(		
		function() {
			$("div.sitp").show("slow");
		},
		function() {
			$("div.sitp").hide("slow");
		}
	);*/
});

$(function() {
	// Call stylesheet init so that all stylesheet changing functions
	// will work.
	$.stylesheetInit();

	// This code loops through the stylesheets when you click the link with
	// an ID of "toggler" below.
	$('#toggler').bind(
		'click',
		function(e) {
			$.stylesheetToggle();
			return false;
		}
	);

	// When one of the styleswitch links is clicked then switch the stylesheet to
	// the one matching the value of that links rel attribute.
	$('.styleswitch').bind(
		'click',
		function(e) {
			$.stylesheetSwitch(this.getAttribute('rel'));
			return false;
		}
	);
});

function showElement(id, displayStyle) {
	if(document.getElementById(id).style.display == displayStyle){
		document.getElementById(id).style.display = 'none';
	} else {
		document.getElementById(id).style.display = displayStyle;
	}
}
