	var int_Init_Start=0;
	var obj_Xml=false;
	var obj_Xml_Doc=null;
	var obj_HeadLine=null;
	var str_View_ID=null;
	var int_View_Index=0;
	var obj_Timer=null;
	
	function Load_House_Views()
	{	
		if(window.XMLHttpRequest) 
		{
			try{ obj_Xml = new XMLHttpRequest(); } 
			catch(e) { obj_Xml = false;}
		}
		else if(window.ActiveXObject) 
		{
			try { obj_Xml = new ActiveXObject("Msxml2.XMLHTTP");}
			catch(e){ try {	obj_Xml = new ActiveXObject("Microsoft.XMLHTTP");}
			catch(e) {	obj_Xml = false;}}
		}
		
		try
		{ 
			if(obj_Xml)
			{
				obj_Xml.open("GET","CFD_Latest_News.aspx", true);
				obj_Xml.onreadystatechange=function()
				{
					if(obj_Xml.readyState==4)
					{
						if(obj_Xml.status==200)
						{
							obj_Xml_Doc=obj_Xml.responseXML;
							int_View_Index=0;
							House_Views_Show();
						}
						else
						{
							if(int_Init_Start==0)
							{
								int_Init_Start=1;
								//alert("There was a problem retrieving the FX Market Data.    \r\n"+obj_Xml.statusText);
							}
						}
					}
				}
				obj_Xml.setRequestHeader('Content-Type', 'text/xml');
				obj_Xml.send(null);
			}
		}
		catch(e) {}
	}
	
/*<cfd>
<news>
<headline>wefwefwef wefwef</headline>
<modified>Fri, 23 Jul 2010 14:09:24 GMT</modified>
</news>
</cfd>
*/

	function House_Views_Show(strIndex)
	{
		if(null!=obj_Xml_Doc)
		{				
			var obj_Nodes=obj_Xml_Doc.selectNodes("cfd/news");
			for(var i=0;i<obj_Nodes.length;i++)
			{
				if((i==0)&&(null!=strIndex))
				{						
					int_View_Index+=strIndex;
				
					if(int_View_Index < 0)
						int_View_Index=obj_Nodes.length-1;
					else if(int_View_Index > obj_Nodes.length-1)
						int_View_Index=0;
				}

				//var str_ID=obj_Nodes[i].selectSingleNode("id").firstChild.nodeValue;
				//var str_Category_ID=obj_Nodes[i].selectSingleNode("categoryid").firstChild.nodeValue;
				var str_Headline=obj_Nodes[i].selectSingleNode("headline").firstChild.nodeValue;
				//var str_Content=obj_Nodes[i].selectSingleNode("content").firstChild.nodeValue;
				//var str_Authenticated=obj_Nodes[i].selectSingleNode("authenticated").firstChild.nodeValue;
				var str_Authenticated=null;
				var str_ID=null;
				var str_Content=null;
				var str_Category_ID=null;
				var str_Modified=obj_Nodes[i].selectSingleNode("modified").firstChild.nodeValue;

				str_Headline = escape(str_Headline);
				
				if(i==int_View_Index)
					Type_Headline(i,str_ID,str_Headline,1,obj_Nodes.length,str_Authenticated);

				//alert(str_ID+"\r\n"+str_Category_ID+"\r\n"+str_Headline+"\r\n"+str_Content+"\r\n"+str_Authenticated+"\r\n"+str_Modified);
			}
		}
	}
	
	function Type_Headline(strIndex,strId,strHeadline,strPos,strCount,strAuthenticated)
	{
	    strHeadline = unescape(strHeadline);
	    
		if(null!=obj_Timer)
			clearTimeout(obj_Timer);
			
		if(strPos==0)
			obj_HeadLine.innerHTML="";
		
		var str_Block="";
		
		//if(strPos<strHeadline.length)
		//	str_Block="<span style=\"background-color:#7F99AE;padding-top:10px;padding-left:2px\">&nbsp;</span>";
			
		//obj_HeadLine.innerHTML=strHeadline.substring(0,strPos)+str_Block;
		
		var obj_Link=document.createElement("DIV");
		obj_Link.style.cssText="text-transform:uppercase; text-decoration:none;font-weight:normal;font-family:Tahoma;font-size:1em;";
		
		if(strAuthenticated)
		{
			obj_Link.style.cursor="pointer";
			obj_Link.href="pcg_view_content_details.aspx?view_id="+strId;
			/*
			obj_Link.onmousedown=function()
			{
				return Dialog_Retrieve(null,"pcg_view_content_details.aspx?view_id="+strId);
			}*/
		}
		
		obj_Link.innerHTML=strHeadline.substring(0,strPos);		
		obj_HeadLine.replaceChild(obj_Link,obj_HeadLine.firstChild);
		
		if(strPos<strHeadline.length)
			obj_Timer=window.setTimeout("Type_Headline("+strIndex+","+strId+",'"+escape(strHeadline)+"',"+(strPos+1)+","+strCount+","+strAuthenticated+")",40);
		else
		{
			clearTimeout(obj_Timer);
			if(strIndex==strCount-1)
				obj_Timer=window.setTimeout("Load_House_Views()",2500);
			else
				obj_Timer=window.setTimeout("House_Views_Show(+1)",2500);
		}
	}
	
	function Init_Start()
	{
		obj_HeadLine=document.getElementById("House_Views_Headline");
		Load_House_Views()
	}
	
	
	function window_onload() 
			{
				if (forwardLogin()) {
					document.frmForward.submit();
				} else {
					window.open("edfdf",window.name);
				}
				return true;
			}

	function forwardLogin() {
				var wndLogin = self.opener;
				
				document.frmForward.u.value = document.frmForward.u.value;
				document.frmForward.p.value = document.frmForward.p.value;
	
				return true;
			}
			
			
			
			function openForgotPassword()
{
	//window.open('https://fxtrades.currenex.net/');
	l=(screen.width-420)/2;
	t=(screen.height-120)/2;		
	winName = (new Date()).getTime( );
	winOpts = 'width=420,height=120,top=0,left=0,resizable=no,toolbar=no,scrollbars=no,title=no,left = 450, top = 350';
	window.open('user_retrieve.aspx',winName,winOpts);
}


				function openRequirement()
{
	//window.open('https://fxtrades.currenex.net/');
	l=(screen.width-420)/2;
	t=(screen.height-120)/2;		
	winName = (new Date()).getTime( );
	winOpts = 'width=600,height=500,top=0,left=0,resizable=no,toolbar=no,scrollbars=yes,title=no,left = 450, top = 350';
	window.open('http://web.iress.com.au/info/requirements.htm',winName,winOpts);
}


				function openTroubleshooting()
{
	//window.open('https://fxtrades.currenex.net/');
	l=(screen.width-420)/2;
	t=(screen.height-120)/2;		
	winName = (new Date()).getTime( );
	winOpts = 'width=600,height=500,top=0,left=0,resizable=no,toolbar=no,scrollbars=yes,title=no,left = 450, top = 350';
	window.open('http://web.iress.com.au/info/troubleshooting.htm',winName,winOpts);
}
	
