// JavaScript Document

function addClass(element,value) { 
	if(!element.className){ 
		element.className = value; 
	}else{ 
		newClassName = element.className; 
		newClassName+= " "; 
   		newClassName+= value; 
    	element.className = newClassName; 
	} 
}

function init_win()
{
	//adjust the background to fit the browser window
	bg = document.getElementById("background");
	switch(screen.width)   
	{
		case 800: 
			bg.src = "images/bg_800_600.jpg";
			break;   
		case 1024: 
			bg.src = "images/bg_1024_768.jpg";
			break;   
		case 1280:
			if(screen.height == 800)
			{
				bg.src = "images/bg_1280_1024.jpg";
				break;  
			}
			if(screen.height == 1024)
			{
				bg.src = "images/bg_1280_1024.jpg";
				break; 
			}
		case 1440:
			bg.src = "images/bg_1440_900.jpg";
			break;
		default:
			bg.src = "images/bg_1280_1024.jpg";
			addClass(bg,"adjust_bg");
	}

    //If it's IE 6.0,then use the 
	if(navigator.userAgent.indexOf("MSIE 6.0")>0) {
		document.getElementById("win_left_top").className = "win_left_top_ie6";
		document.getElementById("win_center_top").className = "win_center_top_ie6";
		document.getElementById("win_right_top").className = "win_right_top_ie6";
		document.getElementById("win_left_body").className = "win_left_body_ie6";
		document.getElementById("win_right_body").className = "win_right_body_ie6";
		document.getElementById("win_left_footer").className = "win_left_footer_ie6";
		document.getElementById("win_center_footer").className = "win_center_footer_ie6";
		document.getElementById("win_right_footer").className = "win_right_footer_ie6";
    }
}
