function writeHTML(html)
{
	document.write(html);
}
//Generating Pop-up Print Preview page
function getPrint(print_area)
{
    //Creating new page
    var pp = window.open();
    //Adding HTML opening tag with <HEAD> … </HEAD> portion 
    pp.document.writeln('<HTML><HEAD><title>Print Preview</title>')
    pp.document.writeln('<LINK href=Styles.css type="text/css" rel="stylesheet">')
    pp.document.writeln('<LINK href=PrintStyle.css ' + 
                        'type="text/css" rel="stylesheet" media="print">')
    pp.document.writeln('<style>'+
    'body2'+
'{'+
	'margin: 0px;'+
	'background-color: white;'+
	'color: black;'+
	'font-family: Arial;'+
	'font-size: 18px;'+
'}'+
 '   .inText'+
'{	'+
 '   border-left-width: 0px; '+
  '  border-right-width: 0px; '+
   ' border-top-width: 0px; '+
   ' border-bottom-width: 1px;'+
   ' border-bottom-color: Black;'+
'}'+
 '   .inTextL'+
'{'+	
'	width: 60px;'+
 '   border-left-width: 0px; '+
  '  border-right-width: 0px; '+
   ' border-top-width: 0px; '+
   ' border-bottom-width: 1px;'+
   ' border-bottom-color: Black;'+
'}'+
 '   .TitleBold'+
'{'+
'font-size:22px; '+
'font-family:Arial; '+
'font-weight:bold;'+
'}'+
 '   </style>')
    pp.document.writeln('<base target="_self"></HEAD>')

    //Adding Body Tag
    pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0"');
    pp.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
    //Adding form Tag
    pp.document.writeln('<form method="post">');

    //Creating two buttons Print and Close within a HTML table
    pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right>');
    pp.document.writeln('<INPUT ID="PRINT" type="button" value="Print" ');
    pp.document.writeln('onclick="javascript:location.reload(true);window.print();">');
    pp.document.writeln('<INPUT ID="CLOSE" type="button" ' + 
                        'value="Close" onclick="window.close();">');
    pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');

    //Writing print area of the calling page
    pp.document.writeln(document.getElementById(print_area).innerHTML);
    //Ending Tag of </form>, </body> and </HTML>
    pp.document.writeln('</form></body></HTML>'); 
}
function confirmation() 
{
    if(document.getElementById('alertEUText') != null)
    {
	    var answer = confirm(document.getElementById('alertEUText').innerHTML)
	    if (answer)
	    {
//    	    alert('ahidden = 1');
            document.getElementById('ahidden').value = '1';
	    }
	    else
	    {
//    	    alert('ahidden = 0');
	        document.getElementById('ahidden').value = '0';
	    }
	}
}

var jpyOption = null;

function getQueryStringValue(key) 
{
    queryString = window.location.search.substring(1);
    keyValue = queryString.split("&");
    for (i=0;i<keyValue.length;i++) 
    {
        ft = keyValue[i].split("=");
        if (ft[0] == key) 
        {
            return ft[1];
        }
    }
}

function changed(f)
                {
                    var chosen;
                    chosen=document.getElementById('country').options[document.getElementById('country').selectedIndex].value;
                    if((chosen == 6)||(chosen == 15)||(chosen == 22)||(chosen == 34)||(chosen == 55)||(chosen == 57)
                    ||(chosen == 58)||(chosen == 59)||(chosen == 68)||(chosen == 73)||(chosen == 74)||(chosen == 81)
                    ||(chosen == 84)||(chosen == 98)||(chosen == 99)||(chosen == 104)||(chosen == 106)||(chosen == 118)
                    ||(chosen == 123)||(chosen == 124)||(chosen == 125)||(chosen == 133)||(chosen == 151)||(chosen == 161)
                    ||(chosen == 172)||(chosen == 173)||(chosen == 177)||(chosen == 194)||(chosen == 195)
                    ||(chosen == 200)||(chosen == 206)||(chosen == 225)||(chosen == 76)||(chosen == 75)||(chosen == 87)
                    ||(chosen == 135)||(chosen == 176))
                    {
                    
                        queryString = window.location.search.toLowerCase();
//                        if(queryString.indexOf('autotrading') >= 0)
//                        {
//                            alert(document.getElementById('alertautotradingEUText').innerHTML);
//                            window.location = "";
//                        }
//                        if(queryString.indexOf('tradingplatform') >= 0)
//                        {
//                            if(getQueryStringValue("tradingplatform") == '2')
//                            {
//                                alert(document.getElementById('alerttradingplatformEUText').innerHTML);
//                                window.location = "";
//                            }
//                        }
                        
                        document.getElementById('hiddenDiv0').style.display = 'inline';
                        document.getElementById('hiddenDiv9').style.display = 'none';
                        document.getElementById('hiddenDiv8').style.display = 'block';
                        document.getElementById('hiddenDiv1').style.display = 'block';
                        document.getElementById('hiddenDiv2').style.display = 'block';
                        document.getElementById('hiddenDiv3').style.display = 'none';
                        document.getElementById('hiddenDiv4').style.display = 'none';
                        document.getElementById('hiddenDiv5').style.display = 'block';
                        document.getElementById('hiddenDiv6').style.display = 'none';
                        document.getElementById('hiddenDiv7').style.display = 'none';
                        document.getElementById('europe').value = 'yes';
//                        alert("EU yes");
                        $("option.nonEurope").each(
                                                      function()
                                                      {
                                                      
                                                          var sel = document.getElementById('currencybase');
                                                          var i;
                                                          for (i = sel.length - 1; i>=0; i--) {
                                                            
                                                            if (sel.options[i] == this) {
                                                              jpyOption = this;
                                                              sel.remove(i);
                                                            }
                                                          }
                                                      }
                                                   );
						document.getElementById('nonEuropeTermsLink').style.display = 'none';
						document.getElementById('EuropeTermsLink').style.display = 'block';
						document.getElementById('nonEuropeRiskLink').style.display = 'none';
						document.getElementById('EuropeRiskLink').style.display = 'block';
						document.getElementById('nonEuropeEULALink').style.display = 'none';
						document.getElementById('EuropeEULALink').style.display = 'block';
						document.getElementById('nonEuropePOALink').style.display = 'none';
						document.getElementById('EuropePOALink').style.display = 'block';
                        document.getElementById('hiddenDiv12').style.display = 'block';
                    } 
                    else
                    {
                        
                        document.getElementById('hiddenDiv0').style.display = 'none';
                        document.getElementById('hiddenDiv9').style.display = 'inline';
                        document.getElementById('hiddenDiv8').style.display = 'none';
                        document.getElementById('hiddenDiv1').style.display = 'none';
                        document.getElementById('hiddenDiv2').style.display = 'none';
                        document.getElementById('hiddenDiv3').style.display = 'block';
                        document.getElementById('hiddenDiv4').style.display = 'block';
                        document.getElementById('hiddenDiv5').style.display = 'none';
                        document.getElementById('hiddenDiv6').style.display = 'block';
                        document.getElementById('hiddenDiv7').style.display = 'block'; 
                        document.getElementById('europe').value = 'no';
//                        alert("EU no");
						if(jpyOption != null)
						{
							var sel = document.getElementById('currencybase');
							var elOptOld = sel.options[sel.selectedIndex]; 							
							try {
							  sel.add(jpyOption, elOptOld); // standards compliant; doesn't work in IE
							}
							catch(ex) {
							  sel.add(jpyOption, sel.selectedIndex); // IE only
							}
						}
						document.getElementById('nonEuropeTermsLink').style.display = 'block';
						document.getElementById('EuropeTermsLink').style.display = 'none';
						document.getElementById('nonEuropeRiskLink').style.display = 'block';
						document.getElementById('EuropeRiskLink').style.display = 'none';
						document.getElementById('nonEuropeEULALink').style.display = 'block';
						document.getElementById('EuropeEULALink').style.display = 'none';
						document.getElementById('nonEuropePOALink').style.display = 'block';
						document.getElementById('EuropePOALink').style.display = 'none';
                        document.getElementById('hiddenDiv12').style.display = 'none';
                    } 
                    
                } 
function changedA()
                {
                    var SumVal;
                    var AAAvar;
                    var AVal;
                    AAAvar=document.getElementById('experienceD').options[document.getElementById('experienceD').selectedIndex].value;
                    document.getElementById('ahidden').value = '1';
                    
                    if(AAAvar == 1)
                    {
                        AVal = 0;
                    } 
                    else if (AAAvar == 2)
                    {
                        AVal = 1;
                    } 
                    else if (AAAvar == 3)
                    {
                        AVal = 1.5;
                    } 
                    else if (AAAvar == 4)
                    {
                        AVal = 2;
                    } 
                    else if (AAAvar == 5)
                    {
                        AVal = 2;
                        
                    } 
                    else if (AAAvar == -1)
                    {
                        return;
                    } 
//                    alert('AAAvar = ' + AVal);
      /////////////////////////////////////////////              
       var BBBvar;
       var BVal;
                    BBBvar=document.getElementById('experienceA').options[document.getElementById('experienceA').selectedIndex].value;
                    if(BBBvar == 1)
                    {
                        BVal = 1;
                    } 
                    else if (BBBvar == 2)
                    {
                        BVal = 1.5;
                    } 
                    else if (BBBvar == 3)
                    {
                        BVal = 2;
                    } 
                    else if (BBBvar == 4)
                    {
                        BVal = 2;
                    } 
                    else if (BBBvar == 5)
                    {
                        BVal = 2;
                    } 
                    else if (BBBvar == -1)
                    {
                        return;
                    } 
//                    alert('BBBvar = ' + BVal);
                   
      /////////////////////////////////////////////              
       var CCCvar;
       var CVal;
                    CCCvar=document.getElementById('experienceB').options[document.getElementById('experienceB').selectedIndex].value;
                    if(CCCvar == 1)
                    {
                        CVal = 1;
                    } 
                    else if (CCCvar == 2)
                    {
                        CVal = 1.5;
                    } 
                    else if (CCCvar == 3)
                    {
                        CVal = 2;
                    } 
                    else if (CCCvar == 4)
                    {
                        CVal = 2;
                    } 
                    else if (CCCvar == 5)
                    {
                        CVal = 2;
                    } 
                    else if (CCCvar == -1)
                    {
                        return;
                    } 
//                     alert('CCCvar = '  + CVal)
      /////////////////////////////////////////////              
       var CFDvar;
       var CFDVal;
                    CFDvar=document.getElementById('experienceC').options[document.getElementById('experienceC').selectedIndex].value;
                    if(CFDvar == 1)
                    {
                        CFDVal = 2;
                    } 
                    else if (CFDvar == 2)
                    {
                        CFDVal = 0;
                    } 
                    else if (CFDvar == -1)
                    {
                        return;
                    } 
//                   alert('DDDvar= '+ CFDVal)
      /////////////////////////////////////////////    
                        SumVal = 0;          
                     SumVal = BVal + AVal + CVal + CFDVal;
//                    alert('Sum = ' + SumVal)
                    if((SumVal <= 4)&(SumVal !=0))
                    {
                        confirmation();
                    }
                } 

function matchKey(e, re)
{
	var keyCode;
	if (e.which)
		keyCode = e.which;
	else
		keyCode = e.keyCode;
	return re.test(String.fromCharCode(keyCode));
}


//<a href="/Forex/">English</a></td><td><a href="/jp//">日本語</a></td><td><a href="/ar//">العربية </a></td><td><a href="/es//">Español</a></td><td><a href="/fr//">français</a></td><td><a href="/it//">Italiano</a></td><td><a href="/pt//">Português</a></td><td><a href="/de//">deutsch</a></td><td><a href="/ID//">Indonesian</a></td></tr></table></TD></TR></TBODY></TABLE></TD></TR>

var menu2=new Array()
menu2[0]='<a href="/Forex/"> <img src="res/Flags%20gif/f0-uk.gif"> English</a>'
menu2[1]='<a href="/jp//"> <img src="res/Flags%20gif/f0-jp.gif"> 日本語</a>'
menu2[2]='<a href="/ar//"> <img src="res/Flags%20gif/f0-ch.gif"> العربية</a>'
menu2[3]='<a href="/es//"> <img src="res/Flags%20gif/f0-es.gif"> Español</a>'
menu2[4]='<a href="/es//"> <img src="res/Flags%20gif/f0-fr.gif"> français</a>'
menu2[5]='<a href="/es//"> <img src="res/Flags%20gif/f0-it.gif"> Italiano</a>'
menu2[6]='<a href="/es//"> <img src="res/Flags%20gif/f0-dn.gif"> deutsch</a>'
menu2[7]='<a href="/es//"> <img src="res/Flags%20gif/f0-ch.gif"> Indonesian</a>'
menu2[8]='<a href="/es//"> <img src="res/Flags%20gif/f0-au.gif"> Português</a>'

		
var menuwidth='110px' //default menu width
var menubgcolor='White'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu





function tabview_aux(TabViewId, id)
{
  var TabView = document.getElementById(TabViewId);

  // ----- Tabs -----

  var Tabs = TabView.firstChild;
  while (Tabs.className != "Tabs" ) Tabs = Tabs.nextSibling;

  var Tab = Tabs.firstChild;
  var i   = 0;

  do
  {
    if (Tab.tagName == "A")
    {
      i++;
      Tab.href      = "javascript:tabview_switch('"+TabViewId+"', "+i+");";
      Tab.className = (i == id) ? "Active" : "";
      Tab.blur();
    }
  }
  while (Tab = Tab.nextSibling);

  // ----- Pages -----

  var Pages = TabView.firstChild;
  while (Pages.className != 'Pages') Pages = Pages.nextSibling;

  var Page = Pages.firstChild;
  var i    = 0;

  do
  {
    if (Page.className == 'Page')
    {
      i++;
      if (Pages.offsetHeight) Page.style.height = (Pages.offsetHeight-2)+"px";
      Page.style.overflow = "auto";
      Page.style.display  = (i == id) ? 'block' : 'none';
    }
  }
  while (Page = Page.nextSibling);
}

// ----- Functions -------------------------------------------------------------

function tabview_switch(TabViewId, id) { tabview_aux(TabViewId, id); }

function tabview_initialize(TabViewId) { tabview_aux(TabViewId,  1); }


