
function adjustStyle(width) {
    width = parseInt(width);
    if (width < 769) {
        $('html').removeClass();
        $('html').addClass('lt-768');
    } else if ((width >= 769) && (width < 1025)) {
        $('html').removeClass();
        $('html').addClass('lt-1024');
    } else if ((width >= 1025) && (width < 1140)) {
        $('html').removeClass();
        $('html').addClass('lt-1140');
    } else {
       $('html').removeClass();
       $('html').addClass('gt-1140');
    }
}

$(function(){
	var width = $(window).width()
	adjustStyle(width);
    $(window).resize(function() {
        adjustStyle($(this).width());
    });
	
	/*$('#tweets').tweetable({
		username : 'deeLyo',
		limit : 1
	});*/

	$('#copy').toggle(function(){
		$('#viewport').attr('content','');
	},function(){
		$('#viewport').attr('content','width=device-width');
	});

	Scroller.init();
	
	/*$('area[alt]').qtip({
        content: {
            attr: 'alt'
        },
        position: {
			my: 'bottom center',
			at: 'top center',
			target: 'mouse',
			adjust: { y:-10 }
		},
        style: {
            classes: 'ui-tooltip-tipsy ui-tooltip-shadow'
        }
    });*/
   
	$('#home4_clients').css( {backgroundPosition: '50% 100px'} ).hover(function(){
   		//$(this).attr('src', 'wp-content/uploads/2011/09/home3_big.png');
   		$('#seemore').fadeOut();
   		$('#home4_clients').stop().animate({
   			'backgroundPosition': '50% 0px'
   		}, 'slow');
   },function(){
   		//$(this).attr('src', 'wp-content/uploads/2011/09/home3.png');
   		$('#seemore').fadeIn();
   		$('#home4_clients').stop().animate({
   			'backgroundPosition': '50% 100px'
   		}, 'slow');
   });
   
	
	$('#screencast').click(function(){
		//$("#player").fancybox();
        $.fancybox('<div style="background-color: #000;"><embed src="../wp-content/uploads/2011/08/player.swf" width="400" height="300" wmode="transparent" flashvars="file=http://10.10.0.126:8888/wordpress/wp-content/uploads/2011/08/movie.flv&fs=true&autostart=true" /></div>', {
            'autoDimensions': false,
            'width': 'auto',
            'height': 'auto',
            'transitionIn': 'none',
            'transitionOut': 'none',
			'swf'			: {
				'wmode': 'transparent',
				'allowfullscreen': 'true'
			}
        });
	});
});

