// JavaScript Document

function roll(imgName, imgSrc)
   {
   document[imgName].src = imgSrc;
   }

var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {
   browserType= "gecko"
}

function navSwitch(ID1, ID2) {
  var navOne = document.getElementById(ID1);
  var navTwo = document.getElementById(ID2);
  if (navOne.className=='hidden') {
    navOne.className='unhidden';
    navTwo.className='hidden';
  }
}

var preloaded = new Array();
function preload_images() {
    for (var i = 0; i < arguments.length; i++){
        preloaded[i] = document.createElement('img');
        preloaded[i].setAttribute('src',arguments[i]);
    };
};

preload_images(
    'images/splashOver.gif',
	'images/workOver.gif',
	'images/infoOver.gif',
	'images/workLorealOver.gif',
	'images/workCotyOver.gif',
	'images/workLimitedOver.gif',
	'images/workShiseidoOver.gif',
	'images/workRodaleOver.gif',
	'images/workVerinoOver.gif',
	'images/workEditorialOver.gif',
	'images/infoBioOver.gif',
	'images/infoPressOver.gif',
	'images/infoContactOver.gif',
	'images/workLorealSelected.gif',
	'images/workCotySelected.gif',
	'images/workLimitedSelected.gif',
	'images/workShiseidoSelected.gif',
	'images/workRodaleSelected.gif',
	'images/workVerinoSelected.gif',
	'images/workEditorialSelected.gif',
	'images/infoBioSelected.gif',
	'images/infoPressSelected.gif',
	'images/infoContactSelected.gif'
);


function openPopUp(linkURL) {
window.open(linkURL,'popup','width=355,height=310,scrollbars=1,location=0,menubar=0,status=0,resizable=1,left=5,top=5')
}

function openExternal(linkURL) {
window.open(linkURL,'popup','width=800,height=600,scrollbars=1,location=0,menubar=0,status=0,resizable=1,left=5,top=5')
}

function sizeCheck() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  if( myWidth < 1120) {
  	//window.alert( 'Width = ' + myWidth );
  	window.resizeTo(1150,myHeight);
  }
}