var agt = navigator.userAgent.toLowerCase();
var versInt = parseInt(navigator.appVersion);
var is_ie	= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (versInt < 4));
var is_ie4    = (is_ie && (versInt == 4) && (agt.indexOf("msie 4")!=-1) );
var is_aol   = (agt.indexOf("aol") != -1);
var is_aol3  = (is_aol && is_ie3);
var is_aol4  = (is_aol && is_ie4);
var is_aol5  = (agt.indexOf("aol 5") != -1);
var is_aol6  = (agt.indexOf("aol 6") != -1);
var is_comp   = (agt.indexOf("compuserve") != -1);
var is_comp2000   = (agt.indexOf("cs") != -1);	 
var is_compie = (is_comp && is_ie);
var strCAP

function CAP_goTo( url ) {
	window.location.href = url;
}

function CAP_RepFR( url) {
	var CAP_str1 = url
	strCAP = CAP_str1.replace("FR","NL")
	window.location.href = strCAP;
}

function CAP_RepNL( url) {
	var CAP_str2 = url
	strCAP = CAP_str2.replace("NL","FR")
	window.location.href = strCAP;
}
	
function CAP_roofBar( tableCellRef, hoverFlag ) {
	if ( hoverFlag ) {
		tableCellRef.style.backgroundImage = 'url("http://i.CAP.net/CAP/.element/img/1.0/main/roofbar_bg2.gif")';
		if ( document.getElementsByTagName ) {
			tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
		}
	} else {
		tableCellRef.style.backgroundImage = 'url("http://i.CAP.net/CAP/.element/img/1.0/main/roofbar_bg.gif")';
		if ( document.getElementsByTagName ) {
			tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#333';
		}
	}
}

function CAP_roofBarClick( tableCellRef, url ) {
	CAP_roofBar( tableCellRef, 0 );
	CAP_goTo( url );
}

function CAP_navBar( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#9999ff';
				break;
			default:
//				tableCellRef.style.backgroundColor = '#ccc';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#339966';
				}
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#60609F';
				break;
			default:
//				tableCellRef.style.backgroundColor = '#ddd';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000';
				}
		}
	}
}

function CAP_navBarClick( tableCellRef, navStyle, url ) {
	CAP_navBar( tableCellRef, 0, navStyle );
	CAP_goTo( url );
}

function splitWindow(s) 
{
	window.name="_mainWindow";
	var w=127;h=153;
	var v=navigator.appVersion.substring(0,1);
	if (navigator.appName=="Netscape")
	{
		if ((v==3)||(v==4)) {w=127,h=168;} 
		else {w=132,h=179;}
	} 
	else {w=112,h=137;}
	if (!s) s="*itn/ord";
	else if (s.indexOf("*,")!=-1) 
	s = s.substring(0,s.indexOf("*"))+"*itn/ord"+s.substring(s.indexOf(","));
	var f="http://CAP.com/event.ng/Type=click&RunID=17006&ProfileID=749&AdID=11567&GroupID=313&FamilyID=2433&TagValues=4.8.435.487.1098&Redirect=http:%2F%2Fwww.itn.net%2Fcgi%2Fget%3Fjava%2FFlightTicker%2FsplitWindow.html&Stamp="+s;
	var win=window.open(f,"ticker","status=0,scrollbars=0,resizable=0,width="+w+",height="+h);
}

// _________________________________________________________________________
// The following code was added to launch the 'change editions' popup.
// It checks first if it's able to set a cookie before launching the window.

function browserAcceptsCookies() {
	var WM_acceptsCookies = false;
	if ( document.cookie == '' ) {
		document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
	    if ( document.cookie.indexOf( 'WM_acceptsCookies=yes' ) != -1 ) {
			WM_acceptsCookies = true;
	    } // If it succeeds, set variable
	} else { // there was already a cookie
	  WM_acceptsCookies = true;
	}
	return ( WM_acceptsCookies );
}









