/**
 * Javascript library for loading Share Price data
 * (c) 2010 Harmonic New Media 
 **/

var ajaxURLRequest = location.protocol +"//"+location.host+ "/sharePriceAjax.php";
var timeOutAjax = 10000000;

function trim(str)
{
    if(!str || typeof str != 'string')
        return null;

    return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
}

function isEmpty(elementValue)
{

	elementValue = trim(elementValue);


        if((elementValue == '') || (elementValue == null) || (elementValue == ' '))
	{

	   return true;

	}
	else
	{

	   return false;

	}


}


function displayData(eleID,eleValue)
{
    if(eleValue=="0.00")
    {
        $('.sharePriceUpdate').html('Not Available');
    }
    else
    {
        if(!isEmpty(eleValue) && !isEmpty(eleID))
        {
            if(document.getElementById(eleID)!=null)
            {
                document.getElementById(eleID).innerHTML = eleValue;
            }
        }
        else if(isEmpty(eleValue) && !isEmpty(eleID))
        {
            if(document.getElementById(eleID)!=null)
            {
                document.getElementById(eleID).innerHTML = "Not Available";
            }
        }
        else
        {
               $('.sharePriceUpdate').html("Not Available.");
        }
         
    }
}




