
var imgname ;
//To open a popup window for the print preview.
function pageprint(pgtitle)
{
	var winURL = "printer.php?pgtitle=" + pgtitle ;
	var winName = "PrinterFriendly";
	var winOptions = "width=630,height=562,toolbar=no,location=no,menu=no,status=no,scrollbars=yes";
	
	window.open(winURL, winName, winOptions);
	
}

function wopen()
{
	var winURL = 'email_friend.php';
	var winName = "Emailafriend";	
	var winOptions = "width=850,height=400,toolbar=no,location=no,menu=no,status=no,scrollbars=yes";
	window.open(winURL, winName, winOptions);
}
//To access the printable content from the main window.
function generatePrinterFriendly(dest_div)
{
	
	var s = opener.document.getElementById(dest_div);
	var t = document.getElementById("PrinterBody");
	t.innerHTML = s.innerHTML;
	hideImages();
	imgname = t.innerHTML;
}

//To hide images for print 
function hideImages()
{
	var img_arr = new Array();
	img_arr = document.getElementsByTagName("img");
	var i;
	
	for(i=2;i<img_arr.length-1;i++)
	{
		img_arr[i].style.display = "none";
		
	}
	
	
}

function loadXMLDoc(dname)
{
	var xmlDoc;
	// code for IE
	if (window.ActiveXObject)
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	}
	else if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc=document.implementation.createDocument("","",null);
	}
	else
	{
		alert('Your browser cannot handle this script');
	}

	xmlDoc.async=false;
	xmlDoc.load(dname);
	return(xmlDoc);
}


function yconnect(url,frm)
	{
	alert(url);
	//show the result in this content
		var responseSuccess = function(o){ 
			//document.getElementById(cnt).innerHTML=o.responseText;
			alert(o.responseText);
			
			// code for IE
			var doc;
doc = loadXMLDoc(url);

var x=doc.documentElement;
			//var x = o.responseXML.documentElement;
			
	var txt = '<table class="share_content" cellspacing="0" cellpadding="2">';
	for (i=0;i<x.childNodes.length;i++)
	{
		//alert(x.childNodes[i].nodeName+"----------"+x.childNodes[i].childNodes[0].nodeValue);
		
		if(x.childNodes[i].nodeName == "Open" || x.childNodes[i].nodeName == "Low" || x.childNodes[i].nodeName == "Close" )
		{
			txt += '<tr><td >' + (x.childNodes[i].nodeName) + '</td>';
			txt += '<td><strong>';
			txt += (x.childNodes[i].childNodes[0].nodeValue);
			txt += '</strong></td></tr>';
		}
	
	}
	txt += '<tr><td align="center" colspan="2" class="padding_top_12 padding_bottom_15"><a href="http://www.boursedata.com.au/?ref=MVP"><img border="0" src="images/POWEREDBY.gif" /></a></td></tr></table>';
  document.getElementById('copy').innerHTML=txt;
		}
	
	//if any failure show msg 
		var responseFailure = function(o){ 
			alert("XMLHTTPRequest Failure");
		}
	
	//used to handle call back events     
		var callback =
		{
			success:responseSuccess,
			failure:responseFailure
		}
	
	
	
	// Create object and intiate connection. 
	
	if(frm != ''){
	// set the from where you need to get the data 
	YAHOO.util.Connect.setForm(frm);
	var cObj = YAHOO.util.Connect.asyncRequest('POST', url, callback,null);
	}else{
	var cObj = YAHOO.util.Connect.asyncRequest('GET', url, callback,null);
	}
	
	
	
	
	//This is to check the connection status 
	var callStatus = YAHOO.util.Connect.isCallInProgress(cObj);
	//alert(loading);
	// check for the status and show loading information 
	
	
	}
	function loadFeed(){
	
	//yconnect('asx_feed.php','','asx_feed','no');
	 yconnect("http://www.bourseinvestor.com/wraps/mvp/",'');
	 
	 setTimeout('loadFeed()',1200000);
	

	}
	
	