var img = new Image(); 
var gic;

	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_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_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];}
			}
			
function bodyscroll(){
	var F=document.forms[0];
	F.ScrollTop.value=Body.scrollTop;
} 

function refreshChart(s, p, i, w, h,u){
	var ds = document.getElementById(s);
	var dp = document.getElementById(p);
	var ic = document.getElementById(i);
	var pid = ds.value;
	var tid = dp.value;
	var url = u + "?w=" + w + "&h=" + h + "&p=" + pid + "&t=" + tid; ic.src = url;
} 
function confirmDelete(){if (confirm("Are you sure to delete this record?")) return true;else {window.event.returnValue = false;return false;}} 

function doHourglass(){document.body.style.cursor = 'wait';}
function undoHourglass(){document.body.style.cursor = 'default';} 
 
function refreshChart2(s, p, i, w, h,u,ic){ 
			try{
			gic = ic;
			var l = document.getElementById(ic);
			l.style.display = "inline";  

			var ds = document.getElementById(s);
			var dp = document.getElementById(p);
			var ich = document.getElementById(i);
			var pid = ds.value;
			var tid = dp.value; 
			img.onreadystatechange  = done;	

			var url= "http://www.everforex.ca/ratechart/EverforexWebChartEngine.aspx?w=" + w + "&h=" + h + "&p=" + pid + "&t=" + tid; 

			img.src = url;
			ich.src = img.src;
			}
			catch(Exception){}
	}
	
function refreshChartSmall(s, p, i, w, h,u,ic){ 
			try{
			/*gic = ic;
			var l = document.getElementById(ic);
			l.style.display = "inline";  */

			var ds = document.getElementById(s);
			var dp = document.getElementById(p);
			var ich = document.getElementById(i);
			var pid = ds.value;
			var tid = dp.value; 
			/*img.onreadystatechange  = done;	*/

			var url= "http://www.everforex.ca/ratechart/EverforexWebChart.aspx?w=" + w + "&h=" + h + "&p=" + pid + "&t=" + tid; 

			img.src = url;
			ich.src = img.src;
			}
			catch(Exception){}
	} 

function done(){
	if (img.readyState == "complete"){
		var l = document.getElementById(gic);l.style.display = "none";
	}
} 

function TrimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}
  
function isValidEmail(clientId) {
	var objEmail = document.getElementById(clientId);
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
     if (regex.test(objEmail.value))
		return true;
	else
	{
		alert("Please enter a valid email address.");
		objEmail.focus();
		return false;
	}
  }


function clickButton(e, buttonid){ 
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
      } 
} 

function OpenLiveSupport()
{ 
	var url="http://www.everforex.ca/onlinesupport/cutesoft_client/cutechat/SupportRedirect.aspx?Referrer="+escape(document.referrer)+"&Url="+escape(location.href)+"&_time="+(new Date().getTime());
	var win;
	try
	{
		win=window.open(url,'','status=1,width=500,height=400,resizable=1');
	}
	catch(x)
	{
	}
	
	if(win==null)
	{
		alert("Pop-up Blocker Detected.");
	}
}

function loadPage(url, target){ 
	var d = new Date();
	var name = d.getTime();

	var x = (screen.availWidth-800)/2; 
	var y = (screen.availHeight - 800)/2;

	if(url.length > 0){
		if(target == "new"){
			var mywin = window.open(url,name,'width=800,height=800,status=0,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1,top='+y + ',left=' + x);	
			if (!mywin)
				alert("A pop-up blocker was detected for your browser. To view the page properly you need turn off the pop-up blocker for this site. Please refer to Technical Support section in www.everforex.ca for how to do this.");
		} 
		else if(target == "top"){
			top.location.href = url;	
		} 
		else if (target == "frame") {	
			parent.location.href = url;
		}  
		else {	
			window.location.href = url;	
		}
	}
}	 
function loadPageNormal(url){ 	  
			window.open(url);	 
}
function callASPX(url){ 
	var d = new Date();
	var name = d.getTime();

	var x = 10000;
	var y = 10000;
			 
	window.open(url,name,'width=0,height=0,status=0,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1,top='+y + ',left=' + x);	
}	 

// staging check
function loadEfoPublicContent(page)
{
	var efoUrl = "https://www.everforex.ca/online/" + page;
	//var efoUrl = "http://localhost/everforexonlinecanada/" + page;
	loadPage(efoUrl,'new','efo_public','0','0','0')
}

function loadPage(url, target, name, width, height, isFullWindow){  
	if (name==""){
		var d = new Date();
		name = d.getTime();
	}
	
	var x = 0;
	var y = 0; 
	if (width=="0"){
		width = screen.availWidth-10;
		height = screen.availHeight-50; 
	} else {
		x = (screen.availWidth-width)/2; 
		y = (screen.availHeight - height)/2;
	}

	var feature = 0;
	if (isFullWindow=="1"){
		feature = "width=" + width + ",height=" + height + ",status=1,toolbar=1,menubar=1,location=1,resizable=1,scrollbars=1,top=" + y + ",left=" + x;
	} else {
		feature = "width=" + width + ",height=" + height + ",status=1,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1,top=" + y + ",left=" + x;
	} 
	
	if(url.length > 0){
		if(target == "new"){
			var mywin = window.open(url,name,feature);	
			if (!mywin)
				alert("A pop-up blocker was detected for your browser. To view the page properly you need turn off the pop-up blocker for this site. Please refer to Technical Support section in www.everforex.ca for how to do this.");

		} 
		else if(target == "top"){
			top.location.href = url;	
		} 
		else if (target == "frame") {	
			parent.location.href = url;
		} 
		else {	
			window.location.href = url;	
		}
	}
}	 



//
// montage.js
//

var monBlock	= null;
var monImg		= null;
var monIdx		= 0;
var monContainer= null;
var monTimeout	= 7000;
var monEffect	= 2;
var monHref;
var monSrc;
var monCaption;

function montage( href, src, caption, width, animate )
{autoconfig();
	if( monBlock )
	{
		return;
	}

	monHref		= href;
	monSrc		= src;
	monCaption	= caption;

	// this is the case for browsers that don't support filters...
	var cycle	= Math.floor( Math.random() * href.length );

	// switch off animation if we're not on broadband
	var m_montage	= ( typeof(animate) != "undefined" ? animate : hasBroadband() );
	 
 	 if( m_montage == false || src.length <= 1 || !( isIE4 || isW3C ) )
	{
		document.writeln( montagePicker( cycle ) );
		return;
	}
	
	// go build all of the nested DIVs out
	monIdx		= cycle;
	
	var nextImage	= (monIdx + 1) % src.length;

	document.writeln( "<div id=\"container\" style=\"width:" + width +"px;height:149px\">" );

	for( i = 0; i < src.length; i++ )
	{
		// set up a placeholder
		document.write( "<div id=\"montage" + i + "\" style=\"display:none\">" );
		
		if( i == nextImage )
		{
			// only prefetch the first image we will display
			document.write( montagePicker( i ) );
		}
		
		document.write( "</div>" );
	}

	document.writeln( "</div>" );

	// pull the images out
	monBlock	= new Array( src.length );
	monImg		= new Array( src.length );

	for( i = 0; i < src.length; i++ )
	{
		monBlock[i]	= document.getElementById( "montage" + i );
		
		if( i == nextImage )
		{
			monImg[i] = document.getElementById( "monimg" + i );
		}
		else
		{
			monImg[i] = null;
		}
	}

	monContainer = document.getElementById("container");
	
	montageEffects();
}

function montageEffects()
{
	var nextImage	= (monIdx + 1) % monImg.length;
	
	// run the transition
	if( readIEVer() >= 4.0 && monEffect > 0 )
	{
		if( monEffect == 1 )
		{
			monContainer.style.filter = "blendTrans(duration=0.6)";
			monContainer.filters(0).apply();
 			montageSelect( nextImage );
			monContainer.filters(0).play();
		}
		else
		{
			monContainer.style.filter = "blendTrans(duration=1.5) revealTrans(duration=1.0,transition=7)";
			monContainer.filters(0).apply();
			monContainer.filters(1).apply();
 			montageSelect( nextImage );
			monContainer.filters(0).play();
			monContainer.filters(1).play();
		}
	}
	else
	{
		montageSelect( nextImage );
	}

	// asked to be called again a little later
	setTimeout( "montagePrep()", monTimeout - 1500 );
	setTimeout( "montageSwap()", monTimeout );
}

function montageSelect( nextImage )
{
	monBlock[monIdx].style.display = "none";
	monIdx = nextImage;
	monBlock[monIdx].style.display = "block";
}		

function montagePrep()
{
	// prefetch the next image if we don't already have it
	var nextImage	= (monIdx + 1) % monImg.length;

	if( !monImg[nextImage] )
	{
		monBlock[nextImage].innerHTML = montagePicker( nextImage );
		monImg[nextImage] = document.getElementById( "monimg" + nextImage );
	}
}

function montageSwap()
{
	if( monImg[monIdx].complete )
	{
		// move the image index along
		montageEffects();
	}
	else
	{
		// check again 3 seconds later
		setTimeout( "montageSwap()", 3000 );
	}
}

function montagePicker( cycle )
{
	var divHtml;

	if( monHref[cycle] != null ) 
	{
		divHtml = "<A href=\"" + monHref[cycle] + "\"><IMG src=\"" + monSrc[cycle] + "\" alt=\"" + monCaption[cycle] + "\" BORDER=\"0\" ID=\"monimg" + cycle + "\"></a>";
	}
	else
	{
		divHtml = "<IMG src=\"" + monSrc[cycle] + "\" ID=\"monimg" + cycle + "\">";
	}
	
	return divHtml;
}

function hasBroadband()
{
	if( readIEVer() < 5.0 )
	{
		return false;
	}
	
	try
	{
		document.body.addBehavior ("#default#clientCaps");
	
		return ( typeof(document.body.connectionType) != "undefined" && document.body.connectionType == "lan" );
	}
	catch( e )
	{
		return false;
	}
}

// -------------------------------------------------------------
// end of montage.js
// -------------------------------------------------------------



//
// home.js
//

// -------------------------------------------------------------
// cross-browser helper functions
// -------------------------------------------------------------

// Global variables
var isCSS 			= false;
var isW3C 			= false;
var isIE4 			= false;
var isNN4 			= false;
var isIE6 			= false;
var isGecko 		= false;
var isOpera 		= false;
var isDHTML 		= false;
var suppressMenus	= false;
var legacyMode		= false;
var timerID			= null;
var subtimerID		= null;

// Add a BookMark
function addBookMark()
{
	if ( window.external ) 
		{
			window.external.AddFavorite( document.location.href,document.title );
		} 
		else 
		{
			alert( "Sorry, your browser doesn't support bookmarking this page...\n\nPlease try pressing Control + D instead" );
		}
}

// initialize upon load to let all browsers establish content objects
function autoconfig()
{
    if( document && document.images )
    {
        isCSS		= (document.body && document.body.style) ? true : false;
        
        isW3C		= (isCSS && document.getElementById) ? true : false;
        isIE4		= (isCSS && document.all && readIEVer() >= 4.0) ? true : false;
        isNN4		= (document.layers) ? true : false;
        isGecko		= (isCSS && navigator && navigator.product && navigator.product == "Gecko");
        isOpera		= (isCSS && navigator.userAgent.indexOf( "Opera") != -1 );
		isIE6CSS	= (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
		isIE6		= ( isIE6CSS && readIEVer() >= 6.0 );
        isDHTML		= isCSS && ( isIE4 || isGecko || isOpera );
        
        if( suppressMenus || ( isOpera && readOperaVer() < 7 ) || ( isGecko && navigator.productSub <= 20011022 ) || ( isGecko && navigator.productSub == 20030107 ) )
        {
			// Opera 6.x doesn't seem to like the DHTML...
			// Netscape 6.2 puts the menus in the wrong place...
			// Safari, the menus don't go away... problem in ResetMenu
			isDHTML	= false;
        }  
	//fix up search params
		if( typeof(m_search) != "undefined" && m_search != null )
		{
			var r1			= /name=\"cat\"/g;
			var r2			= /value=\"all\"/g;
			m_search		= m_search.replace ( r1, "name=\"subcat\"" ).replace ( r2, "value=\"\"");;
		}      
    } 
    
}


function readIEVer()
{
	var agent	= navigator.userAgent;
	var offset	= agent.indexOf( "MSIE" );
	if( offset < 0 )
	{
		return 0;
	}
	return parseFloat( agent.substring( offset + 5, agent.indexOf( ";", offset ) ) );
}

function readOperaVer()
{
	var agent	= navigator.userAgent;
	var offset	= agent.indexOf( "Opera" );
	if( offset < 0 )
	{
		return 0;
	}
	return parseFloat( agent.substring( offset + 6 ) );
}

// -------------------------------------------------------------
// client-side masthead
// -------------------------------------------------------------

var m_pnlinks;
var m_crumbs;
var m_mhFixed		= false;
var m_isHome		= false;
var m_isSegHome		= false;
var m_mda			= null;
var m_printLink		= null;
var m_emailLink		= false;
var m_production	= true;
var m_menudef		= "/content/public/menu.aspx";

function mhFixupLink( href, extra )
{
	if( typeof(extra) == "undefined" )
	{
		extra = "&~ck=mn";
	}
	
	if( href )
	{
		var anchor		= null;
		var anchorix	= href.indexOf( "#" );
		
		if( anchorix != -1 )
		{
			anchor		= href.substr( anchorix );
			href		= href.substr( 0, anchorix );
		}
		
		if( href.indexOf( "?" ) == -1 )
		{
			extra = "?" + extra.substr( 1 );
		}

		if( href.toLowerCase().indexOf( "javascript:" ) == -1 )
		{
			href += extra;
		}
		else
		{
			start = href.indexOf( "?" );
			
			if( start != -1 )
			{
				ix = href.indexOf( "\'", start );
				
				if( ix == -1 )
				{
					ix = href.indexOf( "\\", start );

					if( ix == -1 )
					{
						ix = href.indexOf( "\"", start );
					}
				}
				
				if( ix != -1 )
				{
					href = href.substr( 0, ix ) + extra + href.substr( ix );
				}
			}
		}
		
		if( anchor )
		{
			href += anchor;
		}
	}
	
	return href;
}

function menuItem( text, href )
{
	this.Text			= text;
	this.Href			= mhFixupLink( href, "&~ck=mn" );
	this.IsSeparator	= false;
	this.IsCaption		= false;
	this.MenuItems		= null;
}

function writeMH( phoneTitle, phoneMsg, phoneTariff, segmentTitle, hasLocale, logoLink, pnmsg )
{
	autoconfig();

	if( !m_production && typeof(m_menuBar) == "undefined" )
	{
		document.write( "<div class=\"para\" style=\"color:red; font-weight:bold\">There is a problem with the menu definition. " );
		document.write( "<a href=\"" + m_menudef + "\">Click here to view</a></div>" );
		
		return;
	}
	
	m_mhFixed	= true;

	document.writeln( "<a name=\"mastheadtop\"></a>" );
	 /* pants
	if( m_search )
	{
		document.writeln( "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"728\"><tr><td>"  + m_localeSelector +  m_topLinks + "</td></tr></table>");
	}
	else
	{
		document.writeln( m_localeSelector );
	}
	*/
	// phone strip
	document.write( "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"728\" height=\"19\" ><tr>" );
 	
	if( m_mda )
	{
			document.write( "<td width=\"365\" align=\"left\" valign=\"bottom\"  style=\"padding-left:8px; padding-top:0px; padding-bottom:3px;padding-right:8px\">" );
			document.write( "<span class=\"mhTextNewMda\">" );
			document.write( m_mda );
			document.write( "</span>" );
			document.write( "</td>" );
	}	
	
	document.write( "<td align=\"right\" valign=\"bottom\" style=\"padding-bottom:3px;padding-right:4px;\" >" );
	if( phoneTitle || phoneMsg )
	{
		document.write( "<span class=\"mhTextNewPnMsg\">" );
		
		if( phoneTitle )
		{
			document.write( phoneTitle );
			document.write( " " );
		}

		if( phoneMsg )
		{
			document.write( phoneMsg );
		}
			
		document.write( "</span>" );
	}
	
	if( phoneTariff )
	{
		document.write( "<span class=\"mhTextNewTrf\"> " + phoneTariff + "</span>" );
	}	
	
	document.writeln( "</td></tr></table>" );

	// main section
	document.write( "<table class=\"mhbg\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"728\">" );
	document.write( "<tr><td width=\"123\" height=\"44\" valign=\"middle\">" );
	
	if( typeof( m_homelogo ) != "undefined" )
	{
		m_homelogo	= m_homelogo.replace ( "images/global/brand/ui/homelogo/en.gif" , "images/global/brand/ui/logo42.gif");
	}	
			
	document.write( "<img src=\"" + m_homelogo + "\" align=\"absmiddle\" border=\"0\" alt=\"\" />" );
	document.write( "</td><td valign=\"bottom\" nowrap=\"1\">");
	document.write( "<img src=\"" + m_ctryImg + "\" alt=\"" + m_ctryShort + "\" vspace=\"4\">" );

	if ( flag )
	{
		document.write( "&nbsp;<img src=\"" + m_imgPfx + "/images/global/masthead/smlflags/" + flag  + ".gif\" alt=\"" + m_ctryShort + "\" border=\"0\" vspace=\"9\" />");
	}

	document.write( "</td><td align=\"right\" valign=\"middle\" nowrap=\"1\">");
	
	if( m_search )
	{
		document.write( m_search );
	}
	else
	{
		renderSearchLinks();
	}
	
	document.write( "</tr>" );
	document.write( "</table>" );
	
	document.write( "<tr class=\"mhpnHomepage\"><td width=\"100%\">" );	
	document.write( "<img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"12\" width=\"1\"/>" );
	document.write( "</td></tr>" );
	
	// pn strip
	
	if( m_pnlinks )
	{
		document.writeln( "<table class=\"bcbg\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"728\">" );
		document.write( "<tr>");
		document.write( "<td align=\"right\" style=\"padding-right:3px\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" height=\"21\"><tr>" );
		
		for( var n = 0; n < m_pnlinks.length; n++ )
		{
			if( n > 0 )
			{
				document.write( "<td><img src=\"" + m_imgPfx + "/images/global/masthead/secondary_sep.gif\" alt=\"\"></td>" );
			}

			var href = m_pnlinks[n].Href;
			var icon = m_pnlinks[n].Icon;
			
			if( icon )
			{
				document.write( "<td valign=\"middle\"><a href=\"" + href + "\"><img src=\"" + m_imgPfx + "/images/global/brand/icons/" + icon + ".gif\" border=\"0\"  alt=\"\"></a></td>" );
			}
			
			document.write( "<td align=\"left\" valign=\"middle\" nowrap=\"true\"><a class=\"lnk_iconic\" href=\"" + href + "\">" + m_pnlinks[n].Text + "</a></td>" );
		}

		document.write( "</tr></table>" );
		document.write( "</tr></table>" );	
		
		 //Check this
	 document.writeln( "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"728\">" );
	 document.writeln( "<tr class=\"mhLine\"><td><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\"/></td></tr>" );	
	 document.write( "</table>" ); 		

	}
	 
}

function renderSearchLinks()
{
	if( m_searchLinks )
	{
		document.write( "<table cellspacing=\"0\" cellpadding=\"3\" border=\"0\"><tr>" );
		
		for( var n = 0; n < m_searchLinks.length; n++ )
		{
			if( n > 0 )
			{				
				document.write( "<td valign=\"middle\"><img src=\"" + m_imgPfx + "/images/global/brand/ui/mhlnksep.gif\" width=\"2\" height=\"24\" alt=\"\"></td>" );
			}
			
			var href = m_searchLinks[n].Href;
			var text = m_searchLinks[n].Text;

			document.write( "<td valign=\"middle\"><a href=\"" + href + "\"><img src=\"" + m_imgPfx + "/images/global/brand/ui/secondary.gif\" width=\"4\" height=\"17\" border=\"0\" alt=\"\"></a></td>" );
			document.write( "<td valign=\"middle\"><a href=\"" + href + "\" nowrap=\"1\" class=\"lnk_main_masthead_SE\">" + text + "</a></td>" );
		}

		document.write( "<td><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" width=\"10\" height=\"1\" width=\"1\"/></td></tr></table>" );
	}
	else
	{
		document.write( "&nbsp;" );
	}
}

function mhLink( text, href, icon, extra )
{
	href = mhFixupLink( href, extra );

	this.Text			= text;
	this.Href			= href;
	this.Icon			= icon;
}

function addPnLink( text, href, icon )
{
	if( !m_pnlinks )
	{
		m_pnlinks = new Array();
	}
	
	m_pnlinks[m_pnlinks.length] = new mhLink( text, href, icon );
}

function addCrumb( text, href )
{
	if( !m_crumbs )
	{
		m_crumbs = new Array();
	}
	
	m_crumbs[m_crumbs.length] = new mhLink( text, href, null );
}

// -------------------------------------------------------------
// client-side footer
// -------------------------------------------------------------

function writeFooterLine()
{
	//chk this
     //document.write( "<td nowrap=\"1\"><div class=\"mhsep\"></div></td>" );
   	document.writeln( "<tr><td nowrap=\"1\" class=\"mhLine\" height=\"1\" width=\"1\"></td></tr>" );
	//document.writeln( "<tr><td bgcolor=\"" + color + "\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" width=\"1\" height=\"1\" /></td></tr>" );
}

function writeFooterStart()
{
	var width = ( m_mhFixed ? "728" : "100%" );
	document.write( "<table style=\"width=\"" + width + "\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ededed\">" );
	document.write( "<tr><td bgcolor=\"white\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" border=\"0\" height=\"8\" width=\"1\" alt=\"\" /></td></tr>" );
	document.write( "</table>" );
}

function writeFooterMid()
{
	var width	= ( m_mhFixed ? "728" : "100%" );
	//chk this
	document.write( "<table width=\"" + width + "\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ededed\">" );
	
	//-- RW: Change to move country selector
	document.writeln( "<tr><td colspan=\"2\" style=\"background-color:#ffffff;border-top: 1px solid #efefef\"><div style=\"width:720px;position:relative;left:178px;padding:0px;\">" + m_localeSelector + "</div></td></tr>" );
	document.write( "<tr><td colspan=\"2\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" border=\"0\" height=\"1\" width=\"1\" alt=\"\" /></td></tr>" );	
	document.write( "<tr><td colspan=\"2\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" border=\"0\" height=\"5\" width=\"1\" alt=\"\" /></td></tr><tr><td width=\"" + width + "\" align=\"center\" valign=\"top\">" );
}

function writeFooterBegin()
{
	/*if( m_search )
	{	
		document.writeln( "<div style=\"width:728px;border-top: 1px solid #efefef;margin-top: 4px\"><div style=\"width:720px;position:relative;left:178px;padding-top:2px;\">" + m_localeSelector + "</div></div>" );
		//document.writeln( "<hr noshade=\"true\" size=\"1\" color=\"#efefef\" />" );		
		//document.writeln( "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"728\"><tr><td>"  + m_localeSelector + "</td></tr></table>");
	}
	else
	{
		document.writeln( "<div style=\"width:728px;border-top: 1px solid #efefef;margin-top: 4px\"><div style=\"border-top:1px solid #efefef;width:720px;\">" + m_localeSelector + "</div></div>" );
	}*/
	
    writeFooterStart();
    writeFooterMid();
  
}

function writeFooterClose()
{
	document.write( "</td><td><table><tr><td valign=\"middle\"><a href=\"#mastheadtop\"><img src=\"" + m_imgPfx + "/images/global/brand/ui/arrow_top.gif\" width=\"7\" height=\"4\" alt=\"\" border=\"0\"></a></td><td style=\"padding-right:6px;\" valign=\"middle\"><a href=\"#mastheadtop\"><span class=\"para\">" + m_gototop + "</span></a></td></tr></table></td></tr><TR><td colspan=\"2\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"5\" width=\"1\" /></td></tr><TR><td colspan=\"2\" bgcolor=\"#cdcdcd\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\" /></td></tr></table>" );
}

function writeFooterEnd()
{
	var width	= ( m_mhFixed ? "728" : "100%" );
	
	document.write( "<table width=\"" + width + "\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ededed\">" );
	document.write( "<tr><td colspan=\"2\" class=\"bcbg\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" border=\"0\" height=\"1\" width=\"1\" alt=\"\" /></td></tr>" );
	document.write( "<tr><td colspan=\"2\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" border=\"0\" height=\"5\" width=\"1\" alt=\"\" /></td></tr><tr><td width=\"" + width + "\" align=\"center\" valign=\"top\">" );
	document.write( m_birdseed );
	document.write( "</td><td><table><tr><td valign=\"middle\"><img src=\"" + m_imgPfx + "/images/global/brand/ui/arrow_top.gif\" width=\"7\" height=\"4\" alt=\"\" border=\"0\"></td><td style=\"padding-right:6px;\" valign=\"middle\"><a href=\"#mastheadtop\"><span class=\"para\">" + m_gototop + "</span></a></td></tr></table></td></tr><TR><td colspan=\"2\" ><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"5\" width=\"1\" /></td></tr><TR><td colspan=\"2\" bgcolor=\"#cdcdcd\"><img src=\"" + m_imgPfx + "/images/global/general/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"1\" /></td></tr></table>" );
}

function writeFooter()
{
	writeFooterStart();
	writeFooterEnd();
}


function Bandwidth()
{
	if( readIEVer() < 5.0 || isOpera || navigator.appVersion.toLowerCase().indexOf("win") == -1 )
	{
		return "NA";
	}
	
	document.body.addBehavior ("#default#clientCaps");
	
	if ( typeof( document.body.connectionType) != "undefined"  ) 
	{
		if ( document.body.connectionType == "modem" )
		{
			return "Modem";
		}
		return "Lan";
	}

}

function fixup_FragHeight()
{
}
 
 
 var LOOK = {
	// scroller box size: [width, height]
	'size': [350, 100]
},

BEHAVE = {
	// autoscroll - true, on-demand - false
	'auto': true,
	// vertical - true, horizontal - false
	'vertical': true,
	// scrolling speed, pixels per 40 milliseconds;
	// for auto mode use negative value to reverse scrolling direction
	'speed': 5
},

// a data to build scroll window content
ITEMS = [
	{	// file to get content for item from; if is set 'content' property doesn't matter
		// only body of HTML document is taken to become scroller item content
		// note: external files require time for loading 
		// it is RECOMMENDED to use content property to speed loading up
		// please, DON'T forget to set ALL IMAGE SIZES 
		// in either external file or in 'content' string for scroller script 
		// to be able to estimate item sizes
		'file': '',
		'content': 'Plain Text Iteaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaddddddddddm',
		'pause_b': 2,
		'pause_a': 0
	},
	{
		'file': '',
		'content' : '<b>Item with some <font color="red">HTML</font></b>',
		'pause_b': 2,
		'pause_a': 0
	},
	{
		'file': '',
		// note: image path is relative to the ts_files directory
		'content' : 'Item with image<br><img src="http://www.everforex.ca/images/logo.gif">',
		'pause_b': 2,
		'pause_a': 0
	}
// add as many items here as you need.
// don't forget to separate them with commas, make sure there is no comma after the last item
]
 
