﻿
var jsReady = false;

function LitiumFlashLoadProperty(ParameterString) {
    // Used to store data to return
    var PropertyData;
    // Get the path to the PageProperty page
    var Path = window.location.pathname.toString();
    var FlashParameterPagePath = "Templates/Flash/PageProperty.aspx?";
	
	while(Path.indexOf("/") != -1) {
        Path = Path.substr(Path.indexOf("/")+1);
        FlashParameterPagePath = "../" + FlashParameterPagePath;
    }
    
    $.ajaxSetup({
        async: false
    });
    
    $.getJSON(FlashParameterPagePath + ParameterString, 
        function(json){
          PropertyData = json["PropertyValue"];
        }
    );
    
    return PropertyData;
}

function LitiumFlashLoadPageChildren(ParameterString) {
    // Used to store data to return
    var PropertyData;
    // Get the path to the PageProperty page
    var Path = window.location.pathname.toString();
    var FlashParameterPagePath = "Templates/Flash/PageChildren.aspx?";
	
	while(Path.indexOf("/") != -1) {
        Path = Path.substr(Path.indexOf("/")+1);
        FlashParameterPagePath = "../" + FlashParameterPagePath;
    }
    
    $.ajaxSetup({
        async: false
    });
    
    $.getJSON(FlashParameterPagePath + ParameterString, 
        function(json){
          PropertyData = json["ChildID"];
        }
    );
    
    return PropertyData;
}

// Function called by flash to determine if javascript is ready
function LitiumFlashJavascriptReady () 
{
    return jsReady;
}

// Function used to set javascript as ready when document has loaded
$(document).ready(function() {
    jsReady = true;
});
