/**
 * @author Alexander Farkas
 * v. 1.21
 */

function adjustStyle(width) {

	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) 
	{ 
		$("#size-stylesheet").attr("href", "/css/iphone.css");
	}
	else
	{
	    width = parseInt(width);
	    if (width < 760) {
	        $("#size-stylesheet").attr("href", "/css/narrow.css");
	    } else if ((width >= 760) && (width < 1050)) {
        	$("#size-stylesheet").attr("href", "/css/medium.css");
    	} else {
       		$("#size-stylesheet").attr("href", "/css/wide.css");
    	}
    }
}

$(function() {
    adjustStyle($(this).width());
    $(window).resize(function() {
        adjustStyle($(this).width());
    });
});

$(document).ready(function() {
	/* Apply fancybox to multiple items */
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) 
	{ 
	}
	else
	{
		$("a.fancyBox").fancybox({
		'hideOnContentClick': true,
		'overlayOpacity':0.8,
		'overlayColor':'#000',
		'showCloseButton': true,
		'margin':50
		});

		$("#twitter").tweet({
		            username: "teamsolutionz",
		            join_text: "auto",
		            avatar_size: 32,
		            count: 2,
		            auto_join_text_default: "", 
		            auto_join_text_ed: "We",
		            auto_join_text_ing: "We were",
		            auto_join_text_reply: "We replied to",
		            auto_join_text_url: "We were checking out",
		            loading_text: "loading tweets..."
		        });
	}	
	
		
});


