$(document).ready(function(){
	$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 15000, true);
	
	$('a[rel*=external]').click( function() {
		this.target = "_blank";
	});
	
	$('.newDCContentSwitched').hide(); // Hide the content divs
	
	$('a#switched').click( //When a tab is clicked...
		function() { 
			$('div.newDCContentDefault').hide()
			$('div.newDCContentSwitched').show();
			return false; 
		}
	);
	
	$('a#default').click( //When a tab is clicked...
		function() { 
			$('div.newDCContentDefault').show();
			$('div.newDCContentSwitched').hide()
			return false; 
		}
	);
	
	$('#gallery a').lightBox();
	
	//Close button:
	
	$(".close").click(
		function () {
			$(this).parent().fadeTo(400, 0, function () { // Links with the class "close" will close parent
				$(this).slideUp(600);
			});
			return false;
		}
	);
	
	$("form.validate").validate();
	
	$("input#anonymous").click(
		function() {
			var n = $("input#anonymous:checked").length;
			if( n == 0) {
				$("div.notAnon").show();
			} else {
				$("div.notAnon").hide();
			}
		}
	);
	
	$("input.referrerOther").hide();
	
	$(".referrer").change(
		function() {
			if($(".referrer").val() == 'oo') {
				$("input.referrerOther").show();
			} else {
				$("input.referrerOther").hide();
			}
		}
	);
	
	//for WWYR on homepage
	$("img#Cameras").hide(); $("img#Ipods").hide(); $("img#Laptops").hide(); $("img#PDAs").hide();
	$("p#wwyrCamerasDesc").hide(); $("p#wwyrIpodsDesc").hide(); $("p#wwyrLaptopsDesc").hide(); $("p#wwyrPDAsDesc").hide();
	$("a#wwyrCamerasLink").click(
		function() {
			$("img#Phones").hide(); $("img#Ipods").hide(); $("img#Laptops").hide(); $("img#PDAs").hide();
			$("p#wwyrPhonesDesc").hide(); $("p#wwyrIpodsDesc").hide(); $("p#wwyrLaptopsDesc").hide(); $("p#wwyrPDAsDesc").hide();
			$("img#Cameras").show(); $("p#wwyrCamerasDesc").show();
			return false;
		}
	);
	$("a#wwyrPhonesLink").click(
		function() {
			$("img#Cameras").hide(); $("img#Ipods").hide(); $("img#Laptops").hide(); $("img#PDAs").hide();
			$("p#wwyrCamerasDesc").hide(); $("p#wwyrIpodsDesc").hide(); $("p#wwyrLaptopsDesc").hide(); $("p#wwyrPDAsDesc").hide();
			$("img#Phones").show(); $("p#wwyrPhonesDesc").show();
			return false;
		}
	);
	$("a#wwyrIpodsLink").click(
		function() {
			$("img#Cameras").hide(); $("img#Phones").hide(); $("img#Laptops").hide(); $("img#PDAs").hide();
			$("p#wwyrCamerasDesc").hide(); $("p#wwyrPhonesDesc").hide(); $("p#wwyrLaptopsDesc").hide(); $("p#wwyrPDAsDesc").hide();
			$("img#Ipods").show(); $("p#wwyrIpodsDesc").show();
			return false;
		}
	);
	$("a#wwyrLaptopsLink").click(
		function() {
			$("img#Cameras").hide(); $("img#Phones").hide(); $("img#Ipods").hide(); $("img#PDAs").hide();
			$("p#wwyrCamerasDesc").hide(); $("p#wwyrPhonesDesc").hide(); $("p#wwyrIpodsDesc").hide(); $("p#wwyrPDAsDesc").hide();
			$("img#Laptops").show(); $("p#wwyrLaptopsDesc").show();
			return false;
		}
	);
	$("a#wwyrPDAsLink").click(
		function() {
			$("img#Cameras").hide(); $("img#Phones").hide(); $("img#Ipods").hide(); $("img#Laptops").hide();
			$("p#wwyrCamerasDesc").hide(); $("p#wwyrPhonesDesc").hide(); $("p#wwyrIpodsDesc").hide(); $("p#wwyrLaptopsDesc").hide();
			$("img#PDAs").show(); $("p#wwyrPDAsDesc").show();
			return false;
		}
	);
});
  
  
  