current_date = new Date();
current_year = current_date.getYear();

if (current_year < 1000)
current_year+=1900;

function writefooter()
{
	document.write('<div align="center"><table width="817" cellpadding="0" cellspacing="0" border="0" bgcolor="#99A0A8"><tr><td height="10"><img src="images/footer.gif" width="817" height="10" /></td></tr><tr><td valign="top" class="footer">Trading involves substantial risk of loss and is not suitable for all investors. <a href="risk.html">Read full disclosure.</a><br><br>&copy;Copyright ' + current_year + ' TRADE REAL-TIME. Trade Real-Time in association with IG Markets, authorized and regulated by the Financial Services Authority and member of the London Stock Exchange. Trade Real-Time is a division of GAIN Global Markets, Inc.  All rights reserved.<br><br>Your use of this website confirms your agreement to the Terms and Conditions of Use.<br><br><a href="about.html">About Us </a> | <a href="support.html">Contact Us </a> | <a href="faqs.html">FAQs</a> | <a href="map.html">Site Map</a> | <a href="privacy.html">Privacy Policy</a></td></tr></table></div>');
}

function writefooterlanding()
{
	document.write('<div align="left"><TABLE cellSpacing=0 cellPadding=0 width=700 border=0><tr><td height="10"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial, Helvetica, sans-serif;">By providing your email address on this form, you consent to receiving emails from Trade Real-Time. In the event you receive an email from Trade Real-Time and do not wish to receive similar emails in the future, simply follow the instructions to unsubscribe. Your information will never be shared with unaffiliated third parties. We respect your privacy; please read our <a href="privacy.html">Privacy Policy</a>.<br><br>rading involves substantial risk of loss and is not suitable for all investors. <a href="risk.html">Read full disclosure.</a><br>&copy;Copyright ' + current_year + ' TRADE REAL-TIME. Trade Real-Time in association with IG Markets, authorized and regulated by the Financial Services Authority and member of the London Stock Exchange. Trade Real-Time is a division of GAIN Global Markets, Inc.  All rights reserved.<br>Your use of this website confirms your agreement to the Terms and Conditions of Use.<br><br></span></td></tr></table></div>');
}

function checklogin()
{	
  params = 'top=0, left=0, location=1, status=1, resizable=1, scrollbars=1, menubar=1, toolbar=1';
  	
	if ((document.login.type[0].checked == false) && (document.login.type[1].checked == false))
	{
		alert("Please select an account type");
		return false;		
	}
	
	if (document.login.type[1].checked)	
	{	
		window.open('http://demo.efxnow.com/ggmi_demo/fxgui.html','platform', params);		
		return false;						
	}			
	if (document.login.type[0].checked)	
	{		
		window.open('http://applet.efxnow.com/ggmi_sys/fxgui.html','platform', params);
		return false;
	}			
	
	return false;
}

function Querystring(qs) { // optionally pass a querystring to parse
	this.params = new Object()
	this.get=Querystring_get
	
	if (qs == null)
		qs=location.search.substring(1,location.search.length)

	if (qs.length == 0) return

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ')
	var args = qs.split('&') // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=')
		var name = unescape(pair[0])

		if (pair.length == 2)
			value = unescape(pair[1])
		else
			value = name
		
		this.params[name] = value
	}
}

function Querystring_get(key, default_) {
	// This silly looking line changes UNDEFINED to NULL
	if (default_ == null) default_ = null;
	
	var value=this.params[key]
	if (value==null) value=default_;
	
	return value
}

var expDays = 365; // number of days the cookie should last
 
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

  var qs = new Querystring();
  
	var src = qs.get("src");
	
	if (src != null)
		SetCookie('adv', src, exp);	

function openTour() {
window.open("http://www.traderealtime.com/images/flash/tour/login.html","tour","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no,left=50,top=50,width=650, height=600");
}	
	
function writelinks()
{
	document.write('<table width="174" height=135 border="0" cellpadding="0" cellspacing="0" background="images/access_bg_short.gif"><tr><td height="98" valign="top" class="siderail"><br><ul><li style="padding-bottom: 7px;"><a href="openaccount.html">Open an Account</a></li><li style="padding-bottom: 7px;"><a href="trial.html">Free Practice Account</a></li><li style="padding-bottom: 7px;"><a href="support.html">Contact Us</a></li><li style="padding-bottom: 7px;"><a href="productdetails.html">Pricing</a></li></ul></td></tr></table>');
}

function writeproducts()
{
	document.write('<table width="173" height=269 border="0" cellpadding="0" cellspacing="0"  background="images/trading_pro_bg_long.gif"><tr><td height="98" valign="top" class="siderail"><br><ul><li style="padding-bottom: 8px;"><a href="shares.html">Shares</a></li><li style="padding-bottom: 8px;"><a href="bonds.html">Rates & Bonds</a></li><li style="padding-bottom: 8px;"><a href="indices.html">Indices</a></li><li style="padding-bottom: 8px;"><a href="metals.html">Metals</a></li><li style="padding-bottom: 8px;"><a href="energy.html">Energy</a></li><li style="padding-bottom: 8px;"><a href="forex.html">Forex</a></li><li style="padding-bottom: 8px;"><a href="commodities.html">Commodities</a></li><li style="padding-bottom: 8px;"><a href="binary-options.html">Binary Options</a></li><li style="padding-bottom: 8px;"><a href="dma-equities.html">DMA Equities</a></li></ul></td></tr></table>');
}
