﻿function getWindowSize() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    generalWindowWidth = window.innerWidth;
    generalWindowHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    generalWindowWidth = document.documentElement.clientWidth;
    generalWindowHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    generalWindowWidth = document.body.clientWidth;
    generalWindowHeight = document.body.clientHeight;
  } else {
    generalWindowWidth = screen.width;
    generalWindowHeight = screen.height;
  }
  
  if(generalWindowWidth <= generalMinWindowWidth){
    generalWindowWidth = generalMinWindowWidth;
  }
  
  if(generalWindowHeight <= generalMinWindowHeight){
    generalWindowHeight = generalMinWindowHeight;
  }
  
}

function getScreenSize(){

    generalScreenWidth = screen.width;
    generalScreenHeight = screen.height;
  
}

function setBorder(which){
    if (document.all||document.getElementById){
        if(which.className == "noborder"){
            which.className = "border";
        } else {
           which.className = "noborder";
        }
    }
}

function setColor(which){
    if (document.all||document.getElementById){
        if(which.className == "linkgray"){
           which.className = "linkblack";
        } else {
           which.className = "linkgray";
        }
    }
}

function setDarkColor(which){

    var imageSrc;
    
    if (document.all||document.getElementById){
        
        
        imageSrc = which.getAttribute('src');
        
        if(imageSrc.indexOf('salon') != -1){
            which.setAttribute('src', '../images/salon.gif');
        } else if(imageSrc.indexOf('us') != -1){
            which.setAttribute('src', '../images/us.gif');
        } else if(imageSrc.indexOf('pictures') != -1){
            which.setAttribute('src', '../images/pictures.gif');
        } else if(imageSrc.indexOf('products') != -1){
            which.setAttribute('src', '../images/products.gif');
        } else if(imageSrc.indexOf('reservation') != -1){
            which.setAttribute('src', '../images/reservation.gif');
        } else if(imageSrc.indexOf('rightnow') != -1){
            which.setAttribute('src', '../images/rightnow.gif');
        } else if(imageSrc.indexOf('prices') != -1){
            which.setAttribute('src', '../images/prices.gif');
        } else if(imageSrc.indexOf('contact') != -1){
            which.setAttribute('src', '../images/contact.gif');
        }
        
    }
}

function setLightColor(which){
    
    var imageSrc;
    
    if (document.all||document.getElementById){
        
        
        imageSrc = which.getAttribute('src');
        
        if(imageSrc.indexOf('salon') != -1){
            which.setAttribute('src', '../images/salon_light.gif');
        } else if(imageSrc.indexOf('us') != -1){
            which.setAttribute('src', '../images/us_light.gif');
        } else if(imageSrc.indexOf('pictures') != -1){
            which.setAttribute('src', '../images/pictures_light.gif');
        } else if(imageSrc.indexOf('products') != -1){
            which.setAttribute('src', '../images/products_light.gif');
        } else if(imageSrc.indexOf('reservation') != -1){
            which.setAttribute('src', '../images/reservation_light.gif');
        } else if(imageSrc.indexOf('rightnow') != -1){
            which.setAttribute('src', '../images/rightnow_light.gif');
        } else if(imageSrc.indexOf('prices') != -1){
            which.setAttribute('src', '../images/prices_light.gif');
        } else if(imageSrc.indexOf('contact') != -1){
            which.setAttribute('src', '../images/contact_light.gif');
        }
    }
}


function redirect(url){
    window.location = url;
}

function openwindow(url){

    getScreenSize();

    window.open(url,"site","width=" + generalScreenWidth + ",height=" + generalScreenHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=0, left=0");
   
   
}
