var valueObject	= "";
var url = "http://marketdata.nyse.com/JTic?id=NYA&app=QUOT&rf=JS&type=NYQUOTE&cred="+dckey;
document.write('<scr'+'ipt LANGUAGE="JavaScript" src='+ url +'>');
document.write('</scr'+'ipt>');

function getAsOfDate()
{
	try 
	{
		if (tick0 != null && typeof(tick0) != 'undefined')
		{
			var noOfTicSym = tick0.length;		

			if (tick0 != null && tick0 != "")
			{
				if (noOfTicSym > 0)
				{
					
					var currentDate = "";
					var previousDate = "";
					var timeValue = "";
					var formatedDate = "";
					var dateValue = "";

					currentDate = tick0[3];
					previousDate = tick0[41];
					timeValue = tick0[11];

					if (timeValue != "00:00")
					{
						dateValue = currentDate;
					}
					else {
						dateValue = previousDate;
					}

					formatedDate = formatDate(dateValue);
					
					if(formatedDate != "" && timeValue != "")	
					{
						if (timeValue != "00:00")
						{
							valueObject = "as of " + timeValue + " ET " + formatedDate;
						}
						else {
							valueObject = "as of " + formatedDate;
						}
					}

					//document.write("var valueObject = " + valueObject);
					//alert(valueObject);
				}
			}
		}
	} catch (exception) { }
}

function formatDate(dateVariable)	
{
	// The below Date format - DD Mon YYYY

	var dateValue = dateVariable;
	var arrMonth	= ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

	try
	{ 
	  if (dateValue != null && typeof(dateValue) != 'undefined' && dateValue != "''")
	  {
		  dateValue =  dateValue.substring(6) +" "+ arrMonth[eval(dateValue.substring(4, 6)-1)]+" "+ dateValue.substring(0, 4) ;
	  }
	  return dateValue;
	}
	catch (exception ) { dateValue = ""; }

	return dateValue;
}
