$(document).ready(function() {

	/* Cufon.replace('h3', {hover: true});	 */

	/* Small Screen Fix */

	navposition = function() {
		if( $(window).height() < 600 || $(window).width() < 900 ) {
			$("#sidebar").css("position", "absolute");
		} else {
			if( $.browser.msie ) {
				// IF IE
				if( $.browser.version.substr(0,1) == "6") {
					// IF IE 6
					$("#sidebar").css("position", "absolute"); }
				else {
					// IF OTHER THAN IE 6
					$("#sidebar").css("position", "fixed");
				}
			} else {
				// IF NOT IE
				$("#sidebar").css("position", "fixed");
			}
		}				
	}
				
	$(window).resize( function() {
		navposition();
	});

	navposition();

	
	/* FancyBox */
	
	$("a.fancybox").fancybox();
	
/*
	$("a.fancybox").fancybox({
		'zoomSpeedIn':500,
		'zoomSpeedOut':500,
		'overlayShow':true,
	  	easingIn:'easeInOutCirc', 
		easingOut:'easeInOutCirc', 
		easingChange:'easeInOutCirc',
		hideOnContentClick:true,
		zoomOpacity:true,
		imageScale:true
	});
*/

	$("a#fancybox_penta").fancybox({
		hideOnContentClick:false,
		'frameWidth': 480, 
        'frameHeight': 380
	});
	
	$("a#fancybox_connected").fancybox({
		hideOnContentClick:false,
		'frameWidth': 725, 
        'frameHeight': 325
	});
	
	$("a#fancybox_mobile").fancybox({
		hideOnContentClick:false,
		'frameWidth': 807, 
        'frameHeight': 350
	});

	$("a#fancybox_spectroniq").fancybox({
		hideOnContentClick:false,
		'frameWidth': 526, 
        'frameHeight': 208
	});
	
$("img").lazyload({ 
    placeholder : "images/grey.gif",
    effect : "fadeIn"
});
	
	/* Page Scroll */
	
$('.scrollPage').click(function() {
   var elementClicked = $(this).attr("href");
   var destination = $(elementClicked).offset().top;
   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
   return false;
});
});

