var width = screen.width;
var height = screen.height;
var sTyyli,toPhp,wHeight,wWidth,figureFade=true;

wHeight = $(window).height();
wWidth= $(window).width();

if (parseInt(navigator.appVersion)>3){
	if (navigator.appName.indexOf("Microsoft")!=-1)
		figureFade=false;
}

if((width<=1000) && (height<=700))
{
	sTyyli = "/tyyli800x600.css";
	toPhp = "600";
}
else if((width<=1200) && (height<=700))
{
	sTyyli = "/tyyli1152x648.css";
	toPhp = "648";
}
else if((width<=1200) && (height<800))
{
	sTyyli = "/tyyli1024x768.css";
	toPhp = "768";
}
else if((width>=1280) && (width<=1360) && (height==1024))
{
	sTyyli = "/tyyli1280x1024.css";
	toPhp = "1024";
}
else if((width<1440) && (height<750) || (width==1360) && (height==768) || (width==1366) && (height==768) || (width==1600) && (height==900))
{
	sTyyli = "/tyyli1280x720.css";
	toPhp = "720";
}
else if((width<1440) && (height<900))
{
	sTyyli = "/tyyli1280x800.css";
	toPhp = "800";
}
else if((width<1680) && (height<1050))
{
	sTyyli = "/tyyli1440x900.css";
	toPhp = "900";
}
else if((width>=1680) && (height>=1050))
{
	sTyyli = "/tyyli1680x1050.css";
	toPhp = "1050";
}
else
{
	sTyyli = "/tyyli1440x900.css";
	toPhp = "900";
}

var headID = document.getElementsByTagName("head")[0];         
var cssNode = document.createElement('link');
cssNode.setAttribute('rel','stylesheet');
cssNode.setAttribute('type','text/css');
cssNode.setAttribute('href',sTyyli);
cssNode.setAttribute('media','all');
headID.appendChild(cssNode);

