Hi,

I know I am new, but I would like to know if anyone can help me with my JavaScript. I have a very small knowledge of it since I am self taught.

I have managed to write the script so that my 2 items (1xDiv, 1xLink) out of the 8 (4xDivs, 4xLinks) move properly around the page. However I just realised I may need to be able to launch directly to certain pages not just the home page every time. I am a PHP coder and normally I would use $GET to ascertain which page to load but since everything on this site runs through JavaScript I am not sure how.

Here is a previed of what the page looks like with the content area open.


So my questions is: Can you help me with a script to redirect to a specified page from variable in the URL?

If you need any other information let me know and I will post it ASAP...

My JavaScript (wrote it my self - so probably quite bad).
I am limiting the code to the first 2 sections out of 4 since I think you will understand what is happening from those...

Code:
$(function() {
//Home Link
	$("#home_link").click(function() {
		if ($("#home_link").hasClass('center_link')) {
			$(".content").fadeToggle("slow");
		}
		if ($("#home_link").hasClass('left_link')) {
				$("#home_link").removeClass().addClass('button').addClass('center_link');
				$("#contact_link").removeClass().addClass('dead_left_link');
				$("#repix_link").removeClass().addClass('button').addClass('dead_right_link');
				$("#video_link").removeClass().addClass('button').addClass('right_link');
					$("#home_div").removeClass().addClass('dead_left_div');
					$("#contact_div").removeClass().addClass('hidden');
					$("#repix_div").removeClass().addClass('hidden');
					$("#video_div").removeClass().addClass('dead_right_div').addClass('background_div');
			var delay = setTimeout(function(){
				$("#contact_link").removeClass('dead_left_link').addClass('button').addClass('left_link');
					$("#home_div").removeClass('dead_left_div').addClass('background_div').addClass('center_div');
			}, 1)
		}
		if ($("#home_link").hasClass('right_link')) {
				$("#home_link").removeClass().addClass('button').addClass('center_link');
				$("#contact_link").removeClass().addClass('button').addClass('left_link');
				$("#repix_link").removeClass().addClass('button').addClass('dead_left_link');
				$("#video_link").removeClass().addClass('dead_right_link');
					$("#home_div").removeClass().addClass('dead_right_div');
					$("#contact_div").removeClass().addClass('dead_left_div').addClass('background_div');
					$("#repix_div").removeClass().addClass('hidden');
					$("#video_div").removeClass().addClass('hidden');
			var delay = setTimeout(function(){
				$("#video_link").removeClass('dead_right_link').addClass('button').addClass('right_link');
					$("#home_div").removeClass('dead_right_div').addClass('background_div').addClass('center_div');
			}, 1)
		}
	});
});
//Repix Link
	$("#repix_link").click(function() {
		if ($("#repix_link").hasClass('center_link')) {
			$(".content").fadeToggle("slow");
		}
		if ($("#repix_link").hasClass('left_link')) {
				$("#home_link").removeClass().addClass('button').addClass('dead_right_link');
				$("#contact_link").removeClass().addClass('button').addClass('right_link');
				$("#repix_link").removeClass().addClass('button').addClass('center_link');
				$("#video_link").removeClass().addClass('dead_left_link');
					$("#home_div").removeClass().addClass('hidden');
					$("#contact_div").removeClass().addClass('dead_right_div').addClass('background_div');
					$("#repix_div").removeClass().addClass('dead_left_div');
					$("#video_div").removeClass().addClass('hidden');
			var delay = setTimeout(function(){
				$("#video_link").removeClass('dead_left_link').addClass('button').addClass('left_link');
					$("#repix_div").removeClass('dead_left_div').addClass('background_div').addClass('center_div');
			}, 1)
		}
		if ($("#repix_link").hasClass('right_link')) {
				$("#home_link").removeClass().addClass('button').addClass('dead_left_link');
				$("#contact_link").removeClass().addClass('dead_right_link');
				$("#repix_link").removeClass().addClass('button').addClass('center_link');
				$("#video_link").removeClass().addClass('button').addClass('left_link');
					$("#home_div").removeClass().addClass('hidden');
					$("#contact_div").removeClass().addClass('hidden');
					$("#repix_div").removeClass().addClass('dead_right_div');
					$("#video_div").removeClass().addClass('dead_left_div').addClass('background_div');
			var delay = setTimeout(function(){
				$("#contact_link").removeClass('dead_right_link').addClass('button').addClass('right_link');
					$("#repix_div").removeClass('dead_right_div').addClass('background_div').addClass('center_div');
			}, 1)
		}
	});