/*

	-- -- -- -- -- -- --
	keys2drive v1: Javascript File
	last edit: 10 december 08
	-- -- -- -- -- -- --

	File Contents: JQuery Functions
	
*/


$(document).ready(function() {
						   
   
	$(function() {
			// load the flash version of the image
			var so = new SWFObject("http://users.on.net/~pirate.rabbit/swf/london.swf", "flash-background", "2000", "150", "6");
			so.addParam("movie", "http://users.on.net/~pirate.rabbit/swf/london.swf");
			so.addParam("quality", "high");
			so.addParam("scale", "noscale");
			so.addParam("wmode", "transparent");
			so.addParam("salign", "l");
			so.write("flash-container");
		});
	$(function() {
			// load the flash version of the image
			var so = new SWFObject("http://users.on.net/~pirate.rabbit/swf/london.swf", "flash-background", "2000", "150", "6");
			so.addParam("movie", "http://users.on.net/~pirate.rabbit/swf/london.swf");
			so.addParam("quality", "high");
			so.addParam("scale", "noscale");
			so.addParam("wmode", "transparent");
			so.addParam("salign", "l");
			so.write("flash-container2");
		});

	$(function() {
			// load the flash version of the image
			var so = new SWFObject("http://users.on.net/~pirate.rabbit/swf/london.swf", "flash-background", "2000", "150", "6");
			so.addParam("movie", "http://users.on.net/~pirate.rabbit/swf/london.swf");
			so.addParam("quality", "high");
			so.addParam("scale", "noscale");
			so.addParam("wmode", "transparent");
			so.addParam("salign", "l");
			so.write("flash-container3");
		});
	
	
	$('.nextArw1').pulse({
		opacity: [0,1]
	}, {
		duration: 1500, // duration of EACH individual animation
		times: 9999, // Will go three times through the pulse array [0,1]
		easing: 'linear', // easing function for each individual animation
	});
	
	$('.nextArw2').pulse({
		opacity: [0,1]
	}, {
		duration: 1500, // duration of EACH individual animation
		times: 9999, // Will go three times through the pulse array [0,1]
		easing: 'linear', // easing function for each individual animation
	});
	
	$('.nextArw3').pulse({
		opacity: [0,1]
	}, {
		duration: 1500, // duration of EACH individual animation
		times: 9999, // Will go three times through the pulse array [0,1]
		easing: 'linear', // easing function for each individual animation
	});
	
	
	hs.graphicsDir = 'http://users.on.net/~pirate.rabbit/projects/highslide/graphics/';
	hs.align = 'center';
	hs.outlineType = 'rounded-black';
	hs.transitions = ['expand', 'crossfade'];
	hs.wrapperClassName = 'dark borderless floating-caption';
	hs.fadeInOut = true;
	hs.dimmingOpacity = .1;
	hs.showCredits = false;

	// Add the controlbar
	if (hs.addSlideshow) hs.addSlideshow({
		slideshowGroup: 'group1',
		interval: 3000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .6,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	});
	
	if (hs.addSlideshow) hs.addSlideshow({
		slideshowGroup: 'group2',
		interval: 3000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .6,
			position: 'bottom right',
			hideOnMouseOut: true
		}
	});
	
	
	var $paneTarget = $('#pane-target');


	
	$('.homeLink').click(function(){
		$paneTarget.stop().scrollTo({top:0,left:0}, 800 );
	});
		
	$('#workLink').click(function(){
		$paneTarget.stop().scrollTo({top:0,left:2080}, 800 );
	});
	
	$('#zineLink').click(function(){
		$paneTarget.stop().scrollTo({top:0,left:3180}, 800 );
	});
	
	$('#flickrLink').click(function(){
		$paneTarget.stop().scrollTo( {top:0,left:4380}, 800 );
	});
	
	$('#profileLink').click(function(){
		$paneTarget.stop().scrollTo( {top:700,left:0}, 800 );
	});
	
	$('#goToWorkLink').click(function(){
		$paneTarget.stop().scrollTo({top:0,left:2080}, 4000 );
	});
	
	$('#goToZineLink').click(function(){
		$paneTarget.stop().scrollTo({top:0,left:3180}, 1000  );
	});
	
	$('#goToFlickr').click(function(){
		$paneTarget.stop().scrollTo({top:0,left:4380}, 1000  );
	});
	
	//$('#profile2').click(function(){
	//	$paneTarget.stop().scrollTo( '4380px', 2000 );
	//});
	
	if ((document.width<=1080)) {
		$("a.nextArw1").css('top',440);
		
		$('#flickrLink').click(function(){
		$paneTarget.stop().scrollTo( {top:200,left:4380}, 800 );
		});	
		
		$('#goToFlickr').click(function(){
		$paneTarget.stop().scrollTo({top:200,left:4380}, 1000  );
		});	
		
		$('#workLink').click(function(){
		$paneTarget.stop().scrollTo({top:60,left:2080}, 800 );
		});	
		
		$('#goToWorkLink').click(function(){
		$paneTarget.stop().scrollTo({top:60,left:2080}, 4000 );
		});	
	
	}
	if ((document.width>=1080)) {
		$("#content .rightCol").css('width',440);
	}
	
	/******************* =FLICKR FEED */
	
	//http://api.flickr.com/services/feeds/photos_public.gne?id=13507591@N05&lang=en-us&
	
	$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=36977408@N00&lang=en-us&size=s&format=json&jsoncallback=?", function(data){
	 $.each(data.items, function(i,item){
	$("<img/>").attr("src", item.media.m).appendTo("#images")
	  .wrap("<a href='" + item.link + "'></a>");
	  });
	});

	
	/******************* =NO CONFLICT 
	
	jQuery.noConflict(); var $j = jQuery;*/

});
