var demosrc_mini = "https://secure2.fxcorporate.com/fxtr/demo/?ib=FXCMASIA&DB=U10d9&req=fn,ln,co,em"; 
var demosrc_eng = "https://secure2.fxcorporate.com/fxtr/demo/?ib=FXCMASIAEN&DB=U10D9";

 
// I only have the mini demo URL for fxcm-chinese, so I'm aliasing it to all other possibilities
var demosrc_100k = demosrc_mini; 
var demosrc_active = demosrc_mini;
var demosrc_active_trader = demosrc_mini;
 
function iframeLoad_100k() {	 
	iframeLoad( demosrc_100k );	 
} 
function iframeLoad_mini() {	 
	iframeLoad( demosrc_mini );
}
function iframeLoad_100k_dep() {	 
	iframeLoad( demosrc_100k );
}
function iframeLoad_mini_dep() {	 
	iframeLoad( demosrc_mini );
}
function iframeLoad_active() {	 
	iframeLoad( demosrc_active );
}
function iframeLoad_active_trader() {	 
	iframeLoad( demosrc_active_trader );
}

function iframeLoad( name ) {   
		var demosrc = name;		  
		var theCookie = "";
		var theCookie2 = "";
		var theCookie3 = "";
		var theDate = "";	 	 
		
		if ( window.document.cookie != null ) {
			theCookie = getMyCookie( "JSESSIONID" ); 
			if (CampaignString = getMyCookie("s_cpm"))
			{
			  eval("var CampaignArray = " + CampaignString);
			  var CurrentCampaign = CampaignArray[CampaignArray.length - 1][0];
			}
			theCookie2 = CurrentCampaign;
			theCookie3 = getMyCookie( "keyword" );
			theDate = getMyCookie( "tid" );			 	    
		} 
		if ( theCookie  == null ){
			theCookie = getCookie2( "jsessionid" );
		}	
		if ( theDate == null ) {
			theDate = getDate();
			if ( theCookie == null ) {
				theDate = theDate + "_" + Math.random()*100000000000000000;
			} else {
				theDate = theDate + "_" + theCookie;
			}		 
			createMyCookie( "tid", theDate, 365 );
		}
		demosrc = demosrc + "&tid=" + theDate;
			 		 			 	 
		if ( theCookie2 != null ) {		
			demosrc = demosrc + "&cmp=" + theCookie2;
		}
		if ( theCookie3 != null ) {
			demosrc = demosrc + "&keyword=" + theCookie3;
		}
		//alert( demosrc );		 
		document.getElementById( "demo_reg" ).src = demosrc;		 
} 
function cutSFS( cookie ){
	var ret = cookie;	 
	if ( cookie.indexOf( "SFS-" ) > -1 ) {
		ret = ret.substring( 4 );	
	}	 	
	return ret;
} 