<!--
/*
 * CSB
 * Solution by EFutures®.
 * Author Mohan Wickramasinghe
 * mohan@ceylonit.com
 * Version 1.0
 * Page Name mm_windowCSB.js
 * Created 07-Oct-2007 4:05 PM
*/

var timeSet, timeUp; // Set the TIME interval when page loading.  Check timedMsg() function and SendDataToFlashMovie() function.
var tickerStr;

var newUpdated = false;

var myArray=new Array(); // Set the values of the ticker.
var allArray=new Array(); // Set the values of the Symbols.
var tempMyArray = new Array(); // Used for keeping Array value temporaly.
var deletedArray = new Array(); // Used for keeping Array value which is deleted.

var updatedArray = new Array();



/*
-----------------------------------------------------------------------------------------------
	This function is used for returning the array value to flash object. This function is calling in the flash code.
	Start getArrayVal() function
-----------------------------------------------------------------------------------------------
*/
function getArrayVal() {
	var tempArray = new Array(); ;
	if (newUpdated==true){
		for(i=0; i<myArray.length; i++){
			tempArray[i] = myArray[i];
		}
		//empty myArray
		for(x in myArray){
			myArray.splice(x,myArray.length);
		}
		newUpdated = false;
		//document.getElementById("testMyArray").innerHTML="NO DATA";
	}
	return tempArray;
}
/*
-----------------------------------------------------------------------------------------------
	End getArrayVal() function
-----------------------------------------------------------------------------------------------
*/


/*
-----------------------------------------------------------------------------------------------
	This function is used for setting value to flash variable "testLoad". This is calling from timedMsg() function.
	Start SendDataToFlashMovie() function
-----------------------------------------------------------------------------------------------
*/
function SendDataToFlashMovie()
{
	clearTimeout(timeSet);
	getTicker("str");
}
/*
-----------------------------------------------------------------------------------------------
	End SendDataToFlashMovie() function
-----------------------------------------------------------------------------------------------
*/

/*
-----------------------------------------------------------------------------------------------
	This function is used for clear timeSet.
        Start clearTime() function
-----------------------------------------------------------------------------------------------
*/
function clearTime(){
    clearTimeout(timeSet);
}

/*
-----------------------------------------------------------------------------------------------
	End clearTime() function
-----------------------------------------------------------------------------------------------
*/








/*
-----------------------------------------------------------------------------------------------
	This function is used for restart the ticker moving.
	Start timedMsg() function
-----------------------------------------------------------------------------------------------
*/
function timedMsg()
{
	timeSet=setTimeout("SendDataToFlashMovie()",200);
}
/*
-----------------------------------------------------------------------------------------------
	End timedMsg() function
-----------------------------------------------------------------------------------------------
*/



/*
-----------------------------------------------------------------------------------------------
	This function is used for return the flash object.
	Start thisMovie() function
-----------------------------------------------------------------------------------------------
*/
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}
/*
-----------------------------------------------------------------------------------------------
	End thisMovie() function
-----------------------------------------------------------------------------------------------
*/



var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function test1_DoFSCommand(command, args) {
	var test1Obj = isInternetExplorer ? document.all.test1 : document.test1;
}

// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub test1_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call test1_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

function TrimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}