/*
Scripts for Prismatic Productions
*/
//Main Promo Rollover
$(document).ready(function(){	
    var offset = $('#container').offset();
	if (offset) {
	  $("#footer").offset({left: offset.left+10 });
	}
	$("#homeimage").bind('mouseover', function(e){
	  var tPosX = e.pageX - 15;
      var tPosY = e.pageY + 10;
      $('#promoinfo').show('slow');
	  $('#promoinfo').bind('click', function(event){
		 $('#promoinfo').hide('slow')
		 $(this).unbind(event);
	   });	  
	   									
	})
	//TO DO: put images in array from server
	var linkarray=new Array(
	 	 'showsnow',
		 'showspast',
		 'summer');
	var imgarray=new Array(
		 ['/Images/portal4x6.jpg', '/onstage/current.php', '458', '299'],
		 ['/onstage/productions/MUD/MUDpostcardfront.jpg', '/onstage/productions/past.php', '400', '575'],
		 ['/onstage/workshops/summerintensive/FrontImage2010.jpg', '/onstage/workshops/summerintensive/Prismatic10PrintFinalWEB.pdf', '345', '496']);
	
	
	//jquery solution to for loop problem trying to loop through array of values and last value being used for all assignments!
	$.each(linkarray, function(i, v) {
		$("."+v).mouseover(function() {
			$("#himg").attr("src", imgarray[i][0]);
	    	$("a.primelink").attr("href", imgarray[i][1]);
		 	$("#himg").attr("height", imgarray[i][3]);
		 	$("#himg").attr("width", imgarray[i][2]);
		})
	});
	
	
	
});//end 
//use the resize to reposition elements or resize images
/*size for handheld, ipad, small screen, medium, large*/
$(window).resize(function() {
	 var offset = $('#container').offset();
	$("#footer").offset({left: offset.left });
});
