﻿// JScript File

function loadPattern(){

	var sSelectedBg;
	var objDate = new Date();
	
	
	
	if (objDate.getHours() >= 6 && objDate.getHours() < 11){
		sSelectedBg = 'morningBg';
		
	} else if (objDate.getHours() >= 11 && objDate.getHours() < 17){
		sSelectedBg = 'afternoonBg';
	} else {
		sSelectedBg = 'nightBg';
	}
	
	
	var objDivPattern = document.getElementById('patternBg');	
	objDivPattern.style.backgroundImage = 'url(../images/' + sSelectedBg + '.jpg)';
	
	resizeDivHeight();
		
}


function resizeDivHeight(){
	var iBodyHeight 				= document.body.clientHeight;
	var iBodyWidth 					= document.body.clientWidth;
	var iFlashMovieHeight 			= 563;
	var objTopDiv 					= document.getElementById('divTopBg');
	var objBottomDiv 				= document.getElementById('divBottomBg');
	var objFlashDiv					= document.getElementById('flashGeneralContainer');
	var objTableFlash				= document.getElementById('tableFlash');
	var iDivHeight					= (iBodyHeight - iFlashMovieHeight)/2;
	
	//objTopDiv.style.height 			= iDivHeight + 30;
	objBottomDiv.style.height 		= iDivHeight + 100;	
	objFlashDiv.style.height		= 135 + 610 > iBodyHeight ? 135 + 610 : iBodyHeight;
	objFlashDiv.style.width			= 886 > iBodyWidth ? 886 : 100+'%';
	objTableFlash.style.width		= 886 > iBodyWidth ? 886 : 100+'%';
	
}

function displayWindow (url, width, height){
		var Win = window.open (url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no,status=no');
		Win.focus();
	}
