window.onresize = selectWidthClass;
window.onload = selectWidthClass; 

function selectWidthClass(){
	var wdt = document.documentElement.clientWidth;
	var newWidth =(wdt<=950)?'w800':(wdt>950 && wdt<=1200)?'w930':(wdt>1200&&wdt<=1440)?'w1120':(wdt>1440&&wdt<=1680)?'w1310':(wdt>1680&&wdt<=1920)?'w1500':(wdt>1920&&wdt<=2160)?'w1690':'w1690';
	var newWidthProd = (wdt<=950)?'p800':(wdt>950 && wdt<=1200)?'p930':(wdt>1200&&wdt<=1440)?'p1120':(wdt>1440&&wdt<=1680)?'p1310':(wdt>1680&&wdt<=1920)?'p1500':(wdt>1920&&wdt<=2160)?'p1690':'p1690';
	var newWidthBlog = (wdt<=950)?'b800':(wdt>950 && wdt<=1200)?'b930':(wdt>1200&&wdt<=1440)?'b1120':(wdt>1440&&wdt<=1680)?'b1310':(wdt>1680&&wdt<=1920)?'b1500':(wdt>1920&&wdt<=2160)?'b1690':'b1690';
	if(document.body.className){
		if (document.body.className == 'body-list'){
			document.getElementById('header-container').className=newWidth;
			document.getElementById('footer-container').className=newWidth;
			if (document.getElementById('product-list')!= null){
				document.getElementById('product-list').className=newWidth;
				document.getElementById('product-container').className=newWidthProd;
			}
			document.getElementById('from-blog').className=newWidthBlog;
		}
	}else{
		document.getElementById('header-container').className='w930';
		document.getElementById('footer-container').className='w930';
		if (document.getElementById('product-list')!=null){
			document.getElementById('product-list').className='w930';
			if (document.getElementById('product-container')!=null){
				document.getElementById('product-container').className='p930';
			}
		}
		document.getElementById('from-blog').className='b930';
	}
	
};


