/*if (window.navigator.userAgent.indexOf("MSIE")>=1) { 
    var IE1920="/images/1920x1080bg.jpg";
    var IE1680="/images/1680x1050bg.jpg"; 
    var IE1440="/images/1440x900bg.jpg"; 
    var IE1280="/images/1280x800bg.jpg"; 
    var IE1024="/images/1024x768bg.jpg";  
    ScreenWidth(IE1920,IE1680,IE1440,IE1280,IE1024);
}else if (window.navigator.userAgent.indexOf("Firefox")>=1){ 
    var Firefox1920="/images/1920x1080bg.jpg";
    var Firefox1680="/images/1680x1050bg.jpg"; 
    var Firefox1440="/images/1440x900bg.jpg"; 
    var Firefox1280="/images/1280x800bg.jpg"; 
    var Firefox1024="/images/1024x768bg.jpg"; 
    ScreenWidth(Firefox1920,Firefox1680,Firefox1440,Firefox1280,Firefox1024);
}else{ 
    var Other1920="/images/1920x1080bg.jpg";
    var Other1680="/images/1680x1050bg.jpg"; 
    var Other1440="/images/1440x900bg.jpg"; 
    var Other1280="/images/1280x800bg.jpg"; 
    var Other1024="/images/1024x768bg.jpg"; 
    ScreenWidth(Other1920,Other1680,Other1440,Other1280,Other1024);
} 

function ScreenWidth(imageName1,imageName2,imageName3,imageName4,imageName5){ 
    if ((screen.width >= 1920) || (screen.height >= 1080)){ 
        setActiveStyleSheet(imageName1); 
    }else if ((screen.width >= 1680) || (screen.height >= 1050)){ 
        setActiveStyleSheet(imageName2); 
    }else if ((screen.width >= 1440) || (screen.height >= 900)){ 
        setActiveStyleSheet(imageName3); 
    }else if ((screen.width >= 1280) || (screen.height >= 800)){ 
        setActiveStyleSheet(imageName4); 
    }else if((screen.width >= 1024) || (screen.height >= 768)){ 
        setActiveStyleSheet(imageName5); 
    }
} 

function setActiveStyleSheet(imageSrc){
    document.body.background = imageSrc;
} */



var screenWidth = Number(screen.width);
var screenHeight = Number(screen.height);
var width = new Array(1920,1680,1440,1280,1024);
var height = new Array(1080,1050,900,800,760);
var x=0;
var y=0;
for(var i=0;i<width.length;i++){
    if(screenWidth>width[i]){
        x=i-1;
        break;
    }
}
for(i=0;i<height.length;i++){
    if(screenHeight>height[i]){
        y=i-1;
        break;
    }
}
if(x==-1) x=0;
if(y==-1) y=0;
if(x>y)
    x=y;
    
document.body.background = '/images/' + width[x] + 'x' + height[x] + 'bg.jpg';
//document.body.background = '/images/1920x1080bg.jpg';
