
var uri = new Object();
 
startList = function() {
	if (document.all&&document.getElementById&&document.getElementById("nav")) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
	getURL( uri );
	setKeyword( "keyword" );
}
window.onload=startList; 
 
function getURL( uri ) { 
	uri.dir = location.href.substring( 0, location.href.lastIndexOf( '\/' )); 
	return uri;	 
}
function poponload() {	 
	var holiday_window = window.open ('/live_help/popup.html','holiday','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=578,height=362,top=300,left=300,right=0');
	if(holiday_window) holiday_window.focus();
}
function setKeyword( name ) { 
    parm = new Array;
	value = new Array;
	var beg = "" + location.href; 	 
	beg = beg.substring( beg.indexOf( name ) );
	parm = beg.split( '&' );
	for ( i = 0; i < parm.length; i++ ) {
	   value[ i ] = parm[ i ].split( '=' ); 
	   	if ( value[ i ][ 0 ] == name ) {                
 		createMyCookie( "keyword", value[ i ][ 1 ] ); 
		}
	}
}
function createMyCookie( name, value, days ) {
	if ( days )	{
		var date = new Date();
		date.setTime( date.getTime() + ( days*24*60*60*1000 ));
		var expires = "; expires=" + date.toGMTString();
	} else {
		var expires = "";
	}
	document.cookie = name + "=" + value + expires + "; path=/";
} 
function getDate() {
	var d = new Date();
	var year = "" + d.getFullYear();		 
	year = year.substring(( year.length - 2 ), year.length ); 
	var month = "" + ( d.getMonth() + 1 );
	if ( month.length == 1 ) {
		month = "0" + month;
	}
	var data = "" + d.getDate();
	if ( data.length == 1 ) {
		data = "0" + data;
	}		 
	return ( year + month + data );
}
function getMyCookie( name ) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf( "; " + prefix );
    if ( begin == -1 ) {
        begin = dc.indexOf( prefix );
        if ( begin != 0 ) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf( ";", begin );
    if ( end == -1 ) {
        end = dc.length;
    }    
    return unescape( dc.substring( begin + prefix.length, end ));
}
function getCookie2( name ) {
    parm = new Array;
	value = new Array;
	var beg = "" + location.href; 
	 
	beg = beg.substring( beg.indexOf( name ) );
	parm = beg.split( '&' );
	for ( i = 0; i < parm.length; i++ ) {
	   value[ i ] = parm[ i ].split( '=' ); 
	   if ( value[ i ][ 0 ] == name )  return value[ i ][ 1 ];
	}
	return null;
}   
function openForceClick() {
var b = window.open('http://server.iad.liveperson.net/hc/17621448/?cmd=file&file=visitorWantsToChat&site=17621448&byhref=1&SESSIONVAR!skill=Options','chatw','width=472,height=420', 'menubar=no,status=no,toolbar=no,dependent=yes,alwaysRaised=yes');
b.focus();
}
function openForceClick2() {
// alert ( "uri.dir" + uri.dir );   
var b = window.open('http://server.iad.liveperson.net/hc/17621448/?cmd=file&file=visitorWantsToChat&site=17621448&SESSIONVAR!skill=FXCM_Russia&referrer='+escape(document.location) + '/live_help/prechat_survey_body.html&site=17621448','chatw','width=650,height=425', 'menubar=no,status=no,toolbar=no,dependent=yes,alwaysRaised=yes');
b.focus();
}
function openForceClick3() {
// alert ( "uri.dir" + uri.dir );              
var b = window.open('http://server.iad.liveperson.net/hc/17621448/?cmd=file&file=visitorWantsToChat&site=17621448&byhref=1&SESSIONVAR!skill=Course','chatw','width=472,height=320', 'menubar=no,status=no,toolbar=no,dependent=yes,alwaysRaised=yes');
b.focus();
}
 
function openOptionTrading( src ) {	 
	var b = window.open("http://www.forex-options.com");	 
	b.focus();	 
}
 
function check_tou_box( src )
{	
	if (src.yes.checked)
	{
		var toolbar_window = window.open("http://www.fxcm-toolbar.com/html/fxcm_toolbar_v1_9.exe");
		return true;
	}
	else
	{
		alert("You must agree to the \"Terms of Use\" to download the FXCM Toolbar.");
		return false;
	}
}
function track_atdmt( action, tag ) { 
	if ( tag != null && tag.length > 0 && action != null && action.length > 0 && document.getElementById( "trakingImage" ) != null ) {	 

		document.getElementById( "trakingImage" ).src = "http://switch.atdmt.com/" + action + "/" + tag;
    }
	//alert( tag.length + "  " + document.getElementById( "trakingImage" ).src );    
} 