function truesize()
	{
		h=screenHeight();
		cc=$('#content').height() - 120;
		ll=$('#left').height() - 120;
		rr=$('#right').height() - 120;
		if ( h > cc && h>ll && h>rr  ) 
			{
				console.log(h);
				$('#content').height( h-120 );
			}
		if (screenWidth() <1100) 
			{ $('body').addClass('minw'); }
			else {
				$('body').removeClass('minw');
			}
	}

$(window).resize(  function()
	{	
	truesize()  ;
	
	}); 
	
$(document).ready(function()
	{
		truesize();
	
	});
	
	
function screenHeight(){

return $.browser.opera? window.innerHeight : $(window).height();

}

function screenWidth(){

return  $(window).width();

//return $.browser.opera? window.innerWidth : $(window).width();

}

/*cssw('#container1','background-position',{  990:-70,1280:0},'px top') ;  
cssw('#left','padding-left',{990:17,1280:87},'px') ;
cssw('#center','margin-left',{990:240,1280:310},'px') ;

//cssw('#h5','left',{990:-144,1280:-50,1500:0},'px');
  


cssw('#c2','margin-left',{990:-70,1280:0},'px') ;

//cssw('#footer','margin-left',{990:120,1280:10},'px');

//cssw('#c1','min-width',{  990:1060,1280:1280,9000:9000},'px') ; 


cssw('#h4','background-position',{  990:-70,1280:87},'px') ;  

cssw('#container1','margin-right',{  990:-240,1280:-310},'px') ;  

cssw('#container2','margin-right',{  990:240,1280:310},'px') ;  



//cssw('#right','background-position',{990:200,1280:200},'px top') ;
cssw('#right','padding-right',{990:17,1280:87},'px') ;

cssw('#c3','background-position',{990:1033,1280:1184,9000:8904},'px bottom') ;
*/


function cssw(selector,cssName, arrVals,syfix)
	{
		//arrVals={1024:100,1280:200};
		
		correct=function(selector,cssName, arrVals,syfix)
			{
				arrVals[100000]=true;		
				
				var x=0;
				
				wid=screenWidth();
				//console.log(wid);
				for(var k in arrVals)  
					{
					x++;
					vl=arrVals[k];					
					if ( x==1 )
						{ 
							//console.log('x1',vl);
							if ( wid <= k ) 	{
								out=  vl ;  
								
								break;
							}
						}
					else 
						{
							if ( k==100000 ) { 										
									out= old; 	
								
									break;
								}											
								
							if ( wid <= k  ) 	{
									out= Math.round( old + (vl-old)*(wid-kold)/(k-kold) );
									//console.log('out',out,'vl',vl,'old',old,'wid',wid,'k',k,'kold',kold);
									break;						 
								}				
							
						}
						
					old=vl;
					kold=k;			
					}	
				
				$(selector).css(cssName, out+syfix);
			}
		
		$(document).ready( function(){ correct(selector,cssName, arrVals,syfix); });
		
		$(window).resize( function(){
			correct(selector,cssName, arrVals,syfix);
			}); 
		
	}

	



