(function($) {
	var objElement, arrImages;

	function startRotator() {
		objElement = this;
		arrImages = arguments[0];
		var intCurrent = Math.floor(Math.random() * arrImages.length);

		$.each(arrImages, function(intIndex, arrImageData) {
			$("<img />").attr("src", arrImageData[0]);

		});

		$(objElement).html('<img src="' + arrImages[intCurrent][0] + '" alt="' + arrImages[intCurrent][1] + '" title="' + arrImages[intCurrent][1] + '" />');
		$(objElement).data("intCurrent", intCurrent);
		$(objElement).data("intPrevious", null);
		setInterval(rotateImage, 8000);

	}

	function rotateImage() {
		var intImage;

		do {
			intImage = Math.floor(Math.random() * arrImages.length);

		} while (intImage == $(objElement).data("intCurrent") || intImage == $(objElement).data("intPrevious"));

		$(objElement).fadeOut("medium", function() {
			$(objElement).html('<img src="' + arrImages[intImage][0] + '" alt="' + arrImages[intImage][1] + '" title="' + arrImages[intImage][1] + '" />');

			$(objElement).fadeIn("medium", function() {
				$(objElement).data("intPrevious", $(Element).data("intCurrent"));
				$(objElement).data("intCurrent", intImage);

			});

		});

	}

	$.fn.extend({

		imageRotator : function() {
			var arrArguments = arguments;

			return $(this).each(function() {
				startRotator.apply($(this), arrArguments);

			});

		}

	});

})(jQuery);

jQuery(function($) {
	$("ul#Navigation").droppy();
	$("p#Signature").imageRotator(arrSignatures);
	$("strong#CountDown").setCountdown("I AM VIP&reg;", "2011", "05", "28", "12", "00", "00");
	$("ul#Scroller").simplyScroll();

	$("a.New").click(function(theEvent) {
		$(this).blur();
		theEvent.preventDefault();
		window.open($(this).attr("href"));

	});

	$("a[target], a[href^=mailto:]").click(function() {
		$(this).blur();
	});

	$("select#Job").ready(function() {

		$("select#Job").change(function() {

			if ($(this).val() == "P") {
				$("dt#DSLRlbl, dd#DSLRctl, dt#EXFGlbl, dd#EXFGctl").show("normal");

			} else {
				$("dt#DSLRlbl, dd#DSLRctl, dt#EXFGlbl, dd#EXFGctl").hide("normal");

			}

		})

	});

});

var arrSignatures = new Array(
	new Array("/pre-register/template/images/signatures/Aston-JLS.gif", "I am Aston from JLS, and i am vip - ASTON, JLS"),
	new Array("/pre-register/template/images/signatures/Carly-Desire.gif", "I am Carly from Desire, and i am vip - CARLY, DESIRE"),
	new Array("/pre-register/template/images/signatures/Diana-Vickers.gif", "I am Diana Vickers, and i am vip - DIANA VICKERS"),
	new Array("/pre-register/template/images/signatures/Emily-Bad-Lashes.gif", "I am Emily from Bad Lashes, and i am vip - EMILY, BAD LASHES"),
	new Array("/pre-register/template/images/signatures/Emily-Desire.gif", "I am Emily from Desire, and i am vip - EMILY, DESIRE"),
	new Array("/pre-register/template/images/signatures/Jamilah-Desire.gif", "I am Jamilah from Desire, and i am vip - JAMILAH, DESIRE"),
	new Array("/pre-register/template/images/signatures/JB-JLS.gif", "I am JB from JLS, and i am vip - JB, JLS"),
	new Array("/pre-register/template/images/signatures/Julie-Desire.gif", "I am Julie from Desire, and i am vip - JULIE, DESIRE"),
	new Array("/pre-register/template/images/signatures/Lemar.gif", "I am Lemar, and i am vip - LEMAR"),
	new Array("/pre-register/template/images/signatures/Marvin-JLS.gif", "I am Marvin from JLS, and i am vip - MARVIN, JLS"),
	new Array("/pre-register/template/images/signatures/Oritse-JLS.gif", "I am Oritsé from JLS, and i am vip - ORITSÉ, JLS"),
	new Array("/pre-register/template/images/signatures/Samantha-Bad-Lashes.gif", "I am Samantha from Bad Lashes, and i am vip - SAMANTHA, BAD LASHES"),
	new Array("/pre-register/template/images/signatures/Silver.gif", "I am Silver, and i am vip - SILVER"),
	new Array("/pre-register/template/images/signatures/Sophie-Bad-Lashes.gif", "I am Sophie from Bad Lashes, and i am vip - SOPHIE, BAD LASHES"),
	new Array("/pre-register/template/images/signatures/Stacey-Bad-Lashes.gif", "I am Stacey from Bad Lashes, and i am vip - STACEY, BAD LASHES")
);
var objTwitterSettings = {
	version : 2,
	type : "profile",
	rpp : 4,
	interval : 6000,
	width : 290,
	height : 216,
	theme : {
		shell : {
			background : "#18192c",
			color : "#ffffff"
		},
		tweets : {
			background : "#66a3cc",
			color : "#ffffff",
			links : "#970da1"
		}
	},
	features : {
		scrollbar : true,
		loop : false,
		live : false,
		hashtags : true,
		timestamp : true,
		avatars : false,
		behavior : "all"
	}
};
