var Julia = Julia ? Julia : new function()
{
    var XMLHttpMenuObj = null;
    var XMLHttpPageObj = null;
    
    var pageTitleText = null;
    
    function checkVer()
	{
			var version = 999;
			if (navigator.appVersion.indexOf("MSIE") != -1)
				version = parseFloat(navigator.appVersion.split("MSIE")[1]);
					
			return version;
	};
	
	function displayMenu()
	{
	    if (XMLHttpMenuObj.readyState != 4) return;
	    
	    obj = document.getElementById("pianoMenuContainer");
	    
	    obj.innerHTML = XMLHttpMenuObj.responseText;	    
	};
	
	function displayPage()
	{
	    if (XMLHttpPageObj.readyState != 4) return;
	    
	    document.body.style.cursor = "default";
	    
	    obj = document.getElementById("docContainer");
	    
	    obj.innerHTML = XMLHttpPageObj.responseText;	    
	    
	    if (document.getElementById("flashPicViewer") != null)
	    {
	        var fo = new SWFObject("other/viewer.swf", "viewer", "100%", "100%", "8", "#000000");
	        fo.write("flashPicViewer");
	    }
	    
	    else location.href="#placeMark";
	    
	    document.title = pageTitleText;
	};
		
    var public =
    {
        init: function()
        {
        	var s1 = new SWFObject('other/mediaplayer.swf','mediaplayer','350','20','7');
			s1.addParam('allowfullscreen','false');
			s1.addVariable('width','350');
			s1.addVariable('height','20');
			s1.addVariable('file','mp3/cadenza.mp3');
			s1.addVariable('autostart','true');
			s1.write('musPlayer');
				
            menuURL = "menu.dat?RandomKey=" + Math.random() * Date.parse(new Date());
			
			if (window.XMLHttpRequest)
			{
				XMLHttpMenuObj = new XMLHttpRequest();
			}
			
			else if (window.ActiveXObject)
			{
				XMLHttpMenuObj = new ActiveXObject("Microsoft.XMLHTTP");
			}
			
			if (XMLHttpMenuObj)
			{
				XMLHttpMenuObj.onreadystatechange = displayMenu;
				XMLHttpMenuObj.open("GET", menuURL, true);
				XMLHttpMenuObj.send(null);
			}
			
			Julia.loadPage('home.htm', 'Julia Mortyakova - Home');
        },
        
        showMenu : function(objID, show)
        {
            obj = document.getElementById(objID);
            
            if (null != obj)
            {
                switch (show)
                {
                    case 0:                    
                        obj.style.zIndex = -5;
                    break;
                    case 1:                    
                        obj.style.zIndex = 5;
                    break;
                }
            }
            
            obj2 = document.getElementById("touchScreen");
            
            if (null != obj2)
            {
                switch (show)
                {
                    case 0:
                        obj2.style.cursor = "default";
                        break;
                    case 1:
                        obj2.style.cursor = "pointer";
                        break;
                }
            }
        },
        
        loadPage : function(pageURL, pageTitle)
        {
            pageURL = pageURL + "?RandomKey=" + Math.random() * Date.parse(new Date());
            
            pageTitleText = pageTitle;
			
			if (window.XMLHttpRequest)
			{
				XMLHttpPageObj = new XMLHttpRequest();
			}
			
			else if (window.ActiveXObject)
			{
				XMLHttpPageObj = new ActiveXObject("Microsoft.XMLHTTP");
			}
			
			if (XMLHttpPageObj)
			{
			    document.body.style.cursor = "progress";
				XMLHttpPageObj.onreadystatechange = displayPage;
				XMLHttpPageObj.open("GET", pageURL, true);
				XMLHttpPageObj.send(null);
			}
        }
    }
    
    return public;
}();
