// Setup files load here.
var MCMSConsoleLoad = false;
var CssHTMLToolsLoad = false;
var PageLoad = false;


// Main function, Call in every page.
function main()	{
	initlayers();
	// add any Include INIT file here.

	if(MCMSConsoleLoad) ajustPositionCSSAttribute();
	
	
	if(MCMSConsoleLoad) MCMSConsoleInit();
	if(CssHTMLToolsLoad) initCssHTMLTools();
	
	
	PageLoad = true;
	}

// Main function, Call in every page.
function main2()	{
	initlayers();
	// add any Include INIT file here.

	if(MCMSConsoleLoad) ajustPositionCSSAttribute();
	
	
	if(MCMSConsoleLoad) MCMSConsoleInit();
	if(CssHTMLToolsLoad) initCssHTMLTools();
	
	
	PageLoad = true;
	}
	
// Section Roll Over 
function swImg(id,state) {
	state = (state) ? "_On" : "_Off";
	document.images[id].src = webSiteUrl + "../_Static/" + cultureID + "/Images/" + id + state + ".gif";
	}	

// Generic Popup window Function
// Set URL, Window Name, ...
function popWin(url,w,h,scroll,tools,name,center,baseUrl) {
	var str = "height=" + h + ",innerHeight=" + h;
	str += ",width=" + w + ",innerWidth=" + w;
	if(!center) var center = false;
	if(!scroll) scroll = 0;
	if(!tools) tools = 0;
	if(!name) name = "pop";
	if(baseUrl) url = webSiteCMSUrl + url;
	if((window.screen) && (center)) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		var xc = (aw - w) / 2;
		var yc = (ah - h) / 2;
		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
		}
	pop = window.open(url,name,'toolbar=' + tools + ',location=0,directories=0,status=0,menubar=0,scrollbars=' + scroll + ',resizable=1,' + str).focus();
	}

// Fix the the DHTML page after a Resize <body onresize=fix();>
function fix() { 
	bVer=''; 
	bName = navigator.appName.toLowerCase(); 
	bVer = navigator.appVersion.substring(0,3); 
	// alert(bName+"\n"+bVer);
	if(bName == "netscape" && bVer< '4.08') { return false; } 
	else { document.location = document.location; }
	}	
	
// JavaScript Cooking Handle
var now = new Date();
var expires = now.getTime() + 365 * 24 * 60 * 60 * 1000;
var expires = new Date(expires)
function WriteCookie(name, value) {
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
	}

function ReadCookie(Name) {   
	var search = Name + "="   
	if (document.cookie.length > 0) { 					// if there are any cookies      
		offset = document.cookie.indexOf(search)       
		if (offset != -1) { 							// if cookie exists          
			offset += search.length  					// set index of beginning of value         
			end = document.cookie.indexOf(";", offset)	// set index of end of cookie value         
			if (end == -1) end = document.cookie.length         
			return unescape(document.cookie.substring(offset, end))      
			}    
		}
	}	

// ...