// Global Variables
var newWindowUrls = new Array();
newWindowUrls[newWindowUrls.length] = '/common/login/authenticate.saba';	//saba
newWindowUrls[newWindowUrls.length] = 'www.alcatelventures.com/';	//ventures
newWindowUrls[newWindowUrls.length] = 'www.eu.home.alcatel.com/university';	//training
// additonal: newWindowUrls[newWindowUrls.length] = 'new url';
var framed = false;

// Generic Window Popper
function requiresNewWindow(thisurl) {
	for (var a=0; a < newWindowUrls.length; a++) {
	    if (thisurl.indexOf(newWindowUrls[a])!=-1) {		
			return true;
		}
	}
}

// Page Frame check
if (parent.frames.length > 0) { framed=true; }

// Statusbar Writer
function statusbar(element) {
	if (framed != true) {
		top.window.status=element;
		return true;
	}
}

// Static Link Writer: checks to see if new window required
function linkwriter(href_url, href_label, href_class) {
	if (requiresNewWindow(href_url)) { document.write('<a href="'+href_url+'" '+'class="'+href_class+'" target="_blank">'+href_label+'</a>'); }
	else { document.write('<a href="'+href_url+'" '+'class="'+href_class+'" target="_self">'+href_label+'</a>'); }
}

// Open Link in Window
function linkwindow(href_url) {
	window.open(href_url,'','menubar,toolbar,location,directories,status,scrollbars,resizable,width=800,height=600,left=0,top=0')
}	