$(window).load(function() {
 	setpos();
	$('#wrapper').css('display','block');
	//$('#wrapper:not(.home) #main,#wrapper:not(.home)').height($(document).height());
	
	//$('#main:not(.imagetop) #content').css('padding-top','67px');	
   if($('#content').hasClass('imagetop')){
	   //do nothing
	  
   }else{
	   
   }
  $('#wrapper:not(.home) #main,#wrapper:not(.home)').height($(document).height());
});
$(window).resize(function() {
   setpos();
  //$('#wrapper:not(.home) #main,#wrapper:not(.home)').height($(document).height());
  //$('.home #main').height($(window).height());
  //$('#wrapper.home').height($('#main').height());
  if($(window).height() > $('#main').height()){
	 $('#wrapper:not(.home) #main,#wrapper:not(.home)').height($(window).height()); 
  }else{
	  $('#wrapper:not(.home) #main,#wrapper:not(.home)').height($('#main').height());
  }
  
});

function setpos(){
	var xx = 0;	
	/*var theline = ($(window).width()/2 - ($('#header').width()+100));*/
	
	var xy = ($(window).width()/2 - ($('#header').width()+100));
	if(	xy > 0){
		xx = xy;
	}
	/*if(theline<38){
		theline = 38;	
	}
	
	$('#header').css('margin-left',theline);
   	$('#main').css('margin-left',(theline+$('#header').width()));	
	*/
	
	$('#frame').css('margin-left',xx);
}
