
var width_is = screen.width;
var heigh_is = screen.height;

var width_max = 1280;
var height_max = 1024;


jQuery(document).ready(function(){
   if(width_is < width_max || heigh_is < height_max) {
	 	// Smallscreenlulz
		
		// Smallscreen CSS
		var headID = document.getElementsByTagName("head")[0];         
		var cssNode = document.createElement('link');
		cssNode.type = 'text/css';
		cssNode.rel = 'stylesheet';
		cssNode.href = '/css/style_kl.css';
		cssNode.media = 'screen';
		headID.appendChild(cssNode);
		
		var replace = window.location.protocol+'//'+window.location.hostname;
		
		jQuery("img").each(function() {
		 	var src_gr  = this.src.substr(this.src.indexOf("/", 7)+1);
			var src_kl  = src_gr.replace(/^images/, 'images_kl');
			if(undefined!==window.small_images[src_kl]) {
				this.src = '/'+src_kl;
				this.width = window.small_images[src_kl]['width'];
				this.height = window.small_images[src_kl]['height'];
			}
		 });
	}	 
});
