// JavaScript Document
var fundoRes=null;
var dayNight='d';
//if (screen.width <= 1024)  {
//	fundoRes=1024;
//} else if (screen.width <= 1280) {
//	fundoRes=1280;
//} else if (screen.width <= 1366) {
//	fundoRes=1366;
//} else if (screen.width <= 1680) {
//	fundoRes=1680;
//} else if (screen.width <= 1920) {
//	fundoRes=1920;
//} else if (screen.width <= 2560) {
//	fundoRes=2560;
//}

fundoRes=1920;

var currentTime = new Date();
var hours = currentTime.getHours();
if (hours>=19 || hours<=6) {
	dayNight='n';
}

if (String(hours).length == 1) {
	hours='0'+hours;
}

var uri=document.URL;		
var svr = location.host;
var ht="http://";

if (uri==ht+svr+'/ga.asp' || uri==ht+svr+'/ga2.asp' || uri==ht+svr+'/ga3.asp' || uri==ht+svr+'/ga4.asp') {
	include_dom('../styles/ga.css');
} else if (uri==ht+svr+'/index.asp' || uri==ht+svr+'/en/index.asp' || uri==ht+svr+'/' || uri==ht+svr || uri==ht+svr+'/en' || uri==ht+svr+'/en/') {	
	include_dom('../fundos/'+dayNight+fundoRes+'.css');
} else {
	include_dom('../fundos/'+fundoRes+'/'+dayNight+hours+fundoRes+'.css');
}

//include_dom('../fundos/0.css');
//alert('../fundos/'+fundoRes+'/'+dayNight+hours+fundoRes+'.css');




function include_dom(file) {
	if (file.indexOf(".js")!=-1){ //If object is a js file
		fileref=document.createElement('script')
		fileref.setAttribute("type","text/javascript");
		fileref.setAttribute("src", file);
	}
	else if (file.indexOf(".css")!=-1){ //If object is a css file
		fileref=document.createElement("link")
		fileref.setAttribute("rel", "stylesheet");
		fileref.setAttribute("type", "text/css");
		fileref.setAttribute("href", file);
	}
	document.getElementsByTagName("head").item(0).appendChild(fileref)
}


