var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));

/* apply the varios functions to the document */
$(document).ready(function() 
{ 
	initPage(); 
	if ( mobile )
		$('.scroll-pane').jScrollPane({showArrows: true}); 
});
$(window).resize(function() { initPage(); });

/* calculate the right position and dimensions of the container */
function initPage() {

  var wWidth = $(window).width(), wHeight = $(window).height();

  if ( wHeight > 1400 )
  	wHeight = 400;
	
  if ( wHeight < 560 )
  {
    $("#container").css("top","0px");
    $("#container").css("marginTop","0px");
  } 
  else 
  {
    $("#container").css("top","50%");
    $("#container").css("marginTop","-297px");  
  }
  
  if ( wWidth < 980 )
  {
    $("#container").css("width","994px");
    wWidth = 994;
  } 
  else 
  {
    $("#container").css("width","100%");
  }
  
  var col1_w = Math.round((wWidth -980)/2);
  $("#col1").css( "width" , (col1_w + 340) + "px" );
  $("#col3").css( "width" , (wWidth -980 - col1_w + 52) + "px" );
  
}

function adjustFrame( elm ) {
	if ( !mobile )
		elm.style.height =  "360px";  
}
