$(document).ready(function() {
    
    $('#typekit-badge-mhv0cxd').hide();
    
    setTimeout(function(){
		var navWidth = $('#primaryNavigation ul').width();
		var logoWidth = 981 - navWidth;
		$('#headerLogo').css({"width": logoWidth});
		$('#headerLogo').show();
    }, 200);
    
    setTimeout(function(){
		 $('#content').css({"visibility":"visible"});
		 $('#pageFooter').css({"visibility":"visible"});
		 $('.centerSection').css({"visibility":"visible"});
		 $('#teamMemberWrapper').css({"visibility":"visible"});
		 $('#aboutBottomSection').css({"visibility":"visible"});
    }, 1200);
        
    var agent=navigator.userAgent.toLowerCase();
	var is_iphone = ((agent.indexOf('iphone')!=-1));
	var is_ipad = ((agent.indexOf('ipad')!=-1));
	
	if (is_iphone) { 
		$("#page").css({"padding":"0px 40px"});
		if($('.portfolioProbonoPage').length) {
		    $('.portfolioProbonoPage').css({'padding-bottom': 100 });
		}
		$(".centerSection").css({"padding":"0px 40px"});
		$("#aboutBottomSection .centerSection").css({"padding-top":"20px", "border":"0px"});
		$(".portfolioProbono").css({"width":"1060px"});
		$('#teamMemberWrapper').css({"width":"1060px"});
		$('#teamMemberPicket').css({"background-position":"center 80px"});
		$('#aboutBottomSection').css({"width":"1060px"});
		$(".portfolioSetItemHolderProbono").css({"margin-top":"30px","margin-bottom":"0px"});
		$(".portfolioSetItemHolderProbonoLast").css({"margin-top":"30px","margin-bottom":"0px"});
		$("#teamMemberSetTitle").css({"left":"0px"});
		$(".portfolioProbonoOverlayHeading").css({"left":"40px"});
		$(".portfolioProbono").css({"top":"-100px"});
		//$('#blocksCanvas').css({'padding-bottom' : '550px'});
		$('#headerLogo a').attr("href", "index.php")
		//$('#page').css({'min-height': '1224px'});
	}	
	
	if (is_ipad) { 
		$("#page").css({"padding":"0px 40px"});
		if($('.portfolioProbonoPage').length) {
		    $('.portfolioProbonoPage').css({'padding-bottom': 100 });
		}
		$(".centerSection").css({"padding":"0px 40px"});
		$("#aboutBottomSection .centerSection").css({"padding-top":"20px", "border":"0px"});
		$(".portfolioProbono").css({"width":"1060px"});
		$('#teamMemberWrapper').css({"width":"1060px"});
		$('#teamMemberPicket').css({"background-position":"center 80px"});
		$('#aboutBottomSection').css({"width":"1060px"});
		$(".portfolioSetItemHolderProbono").css({"margin-top":"30px","margin-bottom":"0px"});
		$(".portfolioSetItemHolderProbonoLast").css({"margin-top":"30px","margin-bottom":"0px"});
		$("#teamMemberSetTitle").css({"left":"0px"});
		$(".portfolioProbonoOverlayHeading").css({"left":"40px"});
		$(".portfolioProbono").css({"top":"-100px"});
		
		
        //$('#page').css({'min-height': '1224px'});
		
		/*window.onorientationchange = function() {
    		if (window.orientation == 0 || window.orientation == 180) {  
         	}  
    		
    		window.onorientationchange = function() {
        		if (window.orientation == 0 || window.orientation == 180) {  
                  	$('#page').css({'min-height': '1224px'});
                  	$(window).css({'zoom': 'reset'});
                 }  
            }     	
    		if (window.orientation == 0 ) {  
	      		$('#blocksCanvas').css({'padding-bottom' : '550px'});
	     	}
	     	else if (window.orientation == 90 ) {  
	      		//alert ('Landscape Mode, Home Button right');  
	      		$('#blocksCanvas').css({'padding-bottom' : '0px'});
	     	}  
	     	else if (window.orientation == -90 ) {  
	      		//alert ('Landscape Mode, Home Button left'); 
	      		$('#blocksCanvas').css({'padding-bottom' : '0px'}); 
	     	}  
	     	else if (window.orientation == 180 ) {  
	      		//alert ('Portrait Mode, Home Button top');  
	      		$('#blocksCanvas').css({'padding-bottom' : '550px'});
	     	}
		}
		
		if (window.orientation == 0 ) {  
      		$('#blocksCanvas').css({'padding-bottom' : '550px'});
     	}
     	else if (window.orientation == 90 ) {  
      		//alert ('Landscape Mode, Home Button right');  
      		$('#blocksCanvas').css({'padding-bottom' : '0px'});
     	}  
     	else if (window.orientation == -90 ) {  
      		//alert ('Landscape Mode, Home Button left'); 
      		$('#blocksCanvas').css({'padding-bottom' : '0px'}); 
     	}  
     	else if (window.orientation == 180 ) {  
      		//alert ('Portrait Mode, Home Button top');  
     	}*/  
		
  		//$('#blocksCanvas').css({'padding-bottom' : '550px'});
	}
	
    /*init();*/
    
});

/*
function init() {
    $('a.popupLink').bind('click', function(e) { popupWindow($(this).attr('href'), $(this).attr('title').replace(/[^A-z]/ig, ''),'width=600, height=800, scrollbars'); e.preventDefault(); });
}

function popupWindow(url, name, attributes){
	// Append popup to the URL if it does not already exist
	var queryStringExists = false;
	if(url.match(/\?/)) {
		queryStringExists = true;
	}
	
	if(queryStringExists) {
		// Only append if we haven't already got the parameter popup defined
		if(!url.match(/(\?|&)popup=/)) {
			url = url + '&popup=true';
		}
	} else {
		url = url + '?popup=true';
	}
	
	var baseTags = document.getElementsByTagName('base');
	if(baseTags != undefined && baseTags.length > 0) {
		url = baseTags[0].href + url;
	}
	
	var newWindow = window.open(url, name.replace(/[^A-z]/ig, ''), attributes);
	newWindow.focus();
}
*/
