


/************************************************************************************************************
(C) www.dhtmlgoodies.com, November 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/

var dhtmlgoodies_slideSpeed = 20;	// Higher value = faster
var dhtmlgoodies_timer = 10;	// Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;
function showHideContent(e,inputId)
{
	if(dhtmlgoodies_slideInProgress)return;
	dhtmlgoodies_slideInProgress = true;
	if(!inputId)inputId = this.id;
	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');
	var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);

	objectIdToSlideDown = false;
	
	if(!answerDiv.style.display || answerDiv.style.display=='none'){		
		if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId){			
			objectIdToSlideDown = numericId;
			slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
		}else{
			
			answerDiv.style.display='block';
			answerDiv.style.visibility = 'visible';
			
			slideContent(numericId,dhtmlgoodies_slideSpeed);
		}
	}else{
		slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
		dhtmlgoodies_activeId = false;
	}	
}

function slideContent(inputId,direction)
{
	
	var obj =document.getElementById('dhtmlgoodies_a' + inputId);
	var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
	height = obj.clientHeight;
	if(height==0)height = obj.offsetHeight;
	height = height + direction;
	rerunFunction = true;
	if(height>contentObj.offsetHeight){
		height = contentObj.offsetHeight;
		rerunFunction = false;
	}
	if(height<=1){
		height = 1;
		rerunFunction = false;
	}

	obj.style.height = height + 'px';
	var topPos = height - contentObj.offsetHeight;
	if(topPos>0)topPos=0;
	contentObj.style.top = topPos + 'px';
	if(rerunFunction){
		setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
	}else{
		if(height<=1){
			obj.style.display='none'; 
			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
				slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);				
			}else{
				dhtmlgoodies_slideInProgress = false;
			}
		}else{
			dhtmlgoodies_activeId = inputId;
			dhtmlgoodies_slideInProgress = false;
		}
	}
}



function initShowHideDivs()
{
	var divs = document.getElementsByTagName('DIV');
	var divCounter = 1;
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='NewsItemHeader'){
			divs[no].onclick = showHideContent;
			divs[no].id = 'dhtmlgoodies_q'+divCounter;
			var answer = divs[no].nextSibling;
			while(answer && answer.tagName!='DIV'){
				answer = answer.nextSibling;
			}
			answer.id = 'dhtmlgoodies_a'+divCounter;	
			contentDiv = answer.getElementsByTagName('DIV')[0];
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	
			contentDiv.className='NewsItem_content';
			contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
			answer.style.display='none';
			answer.style.height='1px';
			divCounter++;
		}		
	}	
}

function P7_colH(){ //v1.6 by PVII-www.projectseven.com
 var i,oh,hh,h=0,dA=document.p7eqc,an=document.p7eqa;if(dA&&dA.length){
 for(i=0;i<dA.length;i++){dA[i].style.height='auto';}for(i=0;i<dA.length;i++){
 oh=dA[i].offsetHeight;h=(oh>h)?oh:h;}for(i=0;i<dA.length;i++){if(an){
 dA[i].style.height=h+'px';}else{P7_eqA(dA[i].id,dA[i].offsetHeight,h);}}if(an){
 for(i=0;i<dA.length;i++){hh=dA[i].offsetHeight;if(hh>h){
 dA[i].style.height=(h-(hh-h))+'px';}}}else{document.p7eqa=1;}
 document.p7eqth=document.body.offsetHeight;
 document.p7eqtw=document.body.offsetWidth;}
}
function P7_eqT(){ //v1.6 by PVII-www.projectseven.com
 if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){
 P7_colH();}
}
function P7_equalCols(){ //v1.6 by PVII-www.projectseven.com
 if(document.getElementById){document.p7eqc=new Array;for(var i=0;i<arguments.length;i++){
 document.p7eqc[i]=document.getElementById(arguments[i]);}setInterval("P7_eqT()",10);}
}
function P7_eqA(el,h,ht){ //v1.6 by PVII-www.projectseven.com
 var sp=10,inc=20,nh=h,g=document.getElementById(el),oh=g.offsetHeight,ch=parseInt(g.style.height);
 ch=(ch)?ch:h;var ad=oh-ch,adT=ht-ad;nh+=inc;nh=(nh>adT)?adT:nh;g.style.height=nh+'px';
 oh=g.offsetHeight;if(oh>ht){nh=(ht-(oh-ht));g.style.height=nh+'px';}
 if(nh<adT){setTimeout("P7_eqA('"+el+"',"+nh+","+ht+")",sp);}
}

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

//
// Text-resize javascript, let your users resize your text 
//
// by John Mueller, http://johnmu.com/
// Reuse and modification allowed provided above attribution remains intact.
// no link necessary :-)
//
// v1.0 - 2007-July-22 
//

var ts_sizeSmall=80;  // adjust this for the SMALL size in percent
var ts_sizeLarge=130; //    "                LARGE
var ts_styleElement="#contentSection"; // the ID of the content DIV that you want to resize

function ts_setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
    document.cookie = curCookie;
}

function ts_getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1) return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1) cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function showReadabilityMenu (myTitle) {
	document.write('<div id="fontsizemenu">' + myTitle + '&nbsp;<span style="font-size:'+ts_sizeSmall+'%">');
	if (ts_fontsize!=ts_sizeSmall) 
    	document.write('<a href="#" onclick="changeFontSize('+ts_sizeSmall+');return false;" title="Display smaller text">A</a>');
    else document.write('A');
	document.write('</span>&nbsp;<span>');
	if (ts_fontsize!=100) 
    	document.write('<a href="#" onclick="changeFontSize(100);return false;" title="Display normal text size">A</a>');
    else document.write('A');
	document.write('</span>&nbsp;<span  style="font-size:'+ts_sizeLarge+'%">');
	if (ts_fontsize!=ts_sizeLarge) 
    	document.write('<a href="#" onclick="changeFontSize('+ts_sizeLarge+');return false;" title="Display larger text size">A</a>');
    else document.write('A');
	document.write('</span></div>');
}

function changeFontSize (fontsize) {
    var untilDate = new Date();
    untilDate.setTime( untilDate.getTime() + 365 * 24 * 60 * 60 * 1000); // valid for 1 year
    ts_setCookie('ts_fontsize', fontsize, untilDate, '/');
    self.location.href = self.location.href;
}

var ts_fontsize = ts_getCookie('ts_fontsize');
if (!ts_fontsize) var ts_fontsize = 100;

document.write('<style type="text/css">' + ts_styleElement + '{font-size:'+ts_fontsize+'%;}<\/style>');

function registration()
{
    var url = "../registration/default.asp";
    openScrollingWin(url,"Registration",820,680);
}
function sharedealingpop()
{
    var url = "../On-Line-Share-Dealing-Pop/default.asp";
    openScrollingWin(url,"Registration",820,680);
}
function contractdetails()
{
    var url = "/CFD-Files/pop-up.asp";
    openScrollingWin(url,"ContractDetails",800,680);
}
function pdfpop()
{
    var url = "ADS_Online_Account.pdf";
    openScrollingWin(url,"ADSOnlineAccount",800,680);
}

function privacy()
{
    var url = "../registration/privacy.asp";
    openScrollingWin(url,"Privacy",520,400);
}
function terms()
{
    var url = "../doc_uploads/ADS_TOB_Jan08.pdf";
    openScrollingWin(url,"Terms",520,400);
}
function conflicts_of_interest_policy()
{
    var url = "../doc_uploads/conflicts_of_interest_policy.pdf";
    openScrollingWin(url,"conflicts",520,400);
}
function order_execution_policy()
{
    var url = "../doc_uploads/order_execution_policy.pdf";
    openScrollingWin(url,"Execution_Policy",520,400);
}
function homeTerms()
{
    var url = "doc_uploads/ADS_TOB_Jan08.pdf";
    openScrollingWin(url,"Terms of Business",520,400);
}
function demo()
{
    var url = "https://demo.marketdatasystems.com/prospects4/controller?action=demo_account&processId=demo&webSiteId=ads&locale=en_GB&noqas";
    openScrollingWin(url,"Demo",580,560);
}
function openWin(strFile, strName, intWidth, intHeight)
{

    var strProperties = 'toolbar=no,width=' + Math.round(intWidth) + ',height=' + Math.round(intHeight) + ',left=30,top=150,' + 'status=no,scrollbars=auto,resizable=no,menubar=no';
    tmpWin = window.open(strFile,strName,strProperties);
    tmpWin.focus();

}

function openScrollingWin(strFile, strName, intWidth, intHeight)
{

    var strProperties = 'toolbar=no,width=' + Math.round(intWidth) + ',height=' + Math.round(intHeight) + ',left=30,top=150,' + 'status=yes,scrollbars=yes,resizable=yes,menubar=no';
    tmpWin = window.open(strFile,strName,strProperties);
    tmpWin.focus();

}
// done!
// eat pizza