// JavaScript Document

// switches the image when mouse is over
function imgToggle(image, sel)
{
	img = image.src;
	
	if(/_off./.test(img))
		img = img.replace(/_off./, "_on.");
	else if(/_sel./.test(img))
		img = img.replace(/_sel./, "_on.");
	else
		if(sel)
			img = img.replace(/_on./, "_sel.");
		else
			img = img.replace(/_on./, "_off.");
	
	image.src = img;
}

function rotateCube( x, y, z)
{
	if($('#cube')[0])
		$('#cube')[0].style.webkitTransform = "rotateX("+x+"deg) rotateY("+y+"deg) rotateZ("+z+"deg)";
}

function bindWindowResize(){

	// Window resize used to track the social links position. When the window gets too
	// small, to prevent an overlap their position is adjusted.
	
	/*var footer = $('#footer');
	
	$(window).bind('resize', function(e){
		
		var winHeight = $(this).height();
		
		var docHeight = $(document).height();
		
		if( winHeight < 700 ){
			footer.css({ position:'absolute', top: (docHeight+10)+'px', bottom: 'auto' });
		
		} else {
			footer.css({ top: 'auto', bottom: '0px' });
			
		}
		
		$(window).trigger('scroll');
	});
	
	// Trigger resize at load, in case the default window size it too small
	
	$(window).trigger('resize');*/
}
