var MCMSConsoleLoad = false;
var PageLoad = false;

// Main function, Call in every page.
function main()	{
	initlayers();
	if(MCMSConsoleLoad) MCMSConsoleInit();

	PageLoad = true;
	window.name = "main";
	}

// Section Roll Over 
function RollNavHome(obj,id,imgVertical,state) {
	if(state) {
		if(imgVertical != "") {
			html = '<img src="'+imgVertical+'" border="0">'
	    	VerticalRollOver.html(html);
			VerticalRollOver.show();
			}
	} else {
		html = ''
	    VerticalRollOver.html(html);
		VerticalRollOver.show();	
		}
		

	state = (state) ? "_On" : "_Off";
	document.images[id].src = "/PlatformComputingWebSite/_Static/Images/NavLeft/" + id + state + ".gif";
	}		
	
// Section Roll Over 
function RollNav(obj,id,state) {
	if(!document.images[id].state) {
		document.images[id].state = document.images[id].src.indexOf("_On");
		}
	state = (state) ? "_On" : "_Off";
	if(document.images[id].state != -1) state = "_On";
	else if((obj) && (obj.href == "")) state = "_Off";
	document.images[id].src = "/PlatformComputingWebSite/_Static/Images/NavLeft/" + id + state + ".gif";
	}	
	
// Section Roll Over 
function RollNavBul(obj,id,level,isVertical,state) {
	if(!document.images[id].state) {
		document.images[id].state = document.images[id].src.indexOf("_On");
		}
	state = (state) ? "_On" : "_Off";
	if(document.images[id].state != -1) state = "_On";
	if((obj) && (obj.href == "")) state = "_Off";
	vertical = (isVertical == 'True') ? "V" : "";
	document.images[id].src = "/PlatformComputingWebSite/_Static/Images/NavLeft/BtBul_"+vertical+"L"+level+state+".gif";
	}	
	
// Generic Popup window Function
// Set URL, Window Name, ...
function popWin(url,w,h,scroll,tools,name,center) {
	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((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();
	}
	
// Some page use this code.. (popUp window)
function PopUpArchives(url, nom, top, left, width, height){		
	windowReference = window.open(webSiteUrl + "/_Static" + url,nom,"width="+width+",height="+height+",top="+top+",left="+left+",scrollbars=no");
	if (!windowReference.opener) windowReference.opener = self;
	}	
	
// 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))      
			}    
		}
	}	
	
// Pull-down menu Faq Template
function setFaqCategory (newAddress) {
	if(newAddress!="") {
		window.top.location.href=newAddress;
		}
	}
	
/* DHTML Roll Over  */
function showAbstract(current,e,text){
	str = '<table width="150" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td class="t4Sml">'+text+'</td></tr></table>'
    objAbstract.html(str);
    objAbstract.setxy(event.clientX+document.body.scrollLeft-150,event.clientY+document.body.scrollTop+10);
    objAbstract.show();
	}

function hideAbstract(){
   objAbstract.hide();
	}
document.write('<div id="objAbstract" class="abstract"> </div>')
/* // DHTML Roll Over  */