var framehappy=0;

var IE4, NS4, ver4;

var vertMenu;
var horizMenu;

InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;


function init (hsel,vsel) {

    IE4 = (document.all) ? 1 : 0;       // initialize browser..
    NS4 = (document.layers) ? 1 : 0;    // identification and...
    ver4 = (IE4 || NS4) ? 1 : 0;        // DHTML variables

    if ((self != top) && (!top.ian))  {
	    // var debugloc=document.location+" ";
    	// alert(debugloc+" framehappy="+framehappy);
    	if (!framehappy) {
    		top.location=self.location;
    	}
    }

	vertMenu = getObj("vertmenu");
	horizMenu = getObj("horizmenu");


	if (InternetExplorer) {
 		horizMenu.SetVariable('hnavigation', hsel);	
 		vertMenu.SetVariable('hnavigation', hsel);
 		vertMenu.SetVariable('vnavigation', vsel.substr(1,1));	
	}

}

function verticalNav (nav){
	
	

	if (InternetExplorer) {

		switch(nav) {
			case "home":
				vertMenu.TGotoLabel ("_level0/","Preload Stop");
				break;
	
			case "personal":
				vertMenu.TGotoLabel ("_level0/","Personal Start");
				break;
	
			case "digital_art":
				vertMenu.TGotoLabel ("_level0/","Art Start");
				break;
	
			case "writing":
				vertMenu.TGotoLabel ("_level0/","Writing Start");
				break
	
			case "photos":
				vertMenu.TGotoLabel ("_level0/","Photos Start");
				break
		}

	}
}

// Handle all the the FSCommand messages in a Flash movie
function horizmenu_DoFSCommand(command, args) {
	if (command == "goto") {
		verticalNav (args);
	}

//	alert (command + ":" + args);
}

// 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 horizmenu_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call horizmenu_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

function setObject() {
	alert("bob");
	horizmenu = InternetExplorer ? horizmenu : document.horizmenu;
}

var UseFlash = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
	// Check for Flash version 5 or greater in Netscape
	var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
	if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=5)
		UseFlash = 1;
} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	// Assume any Windows IE except for Windows 3.1 supports the OBJECT tag
	UseFlash = 1;
}
// Allow the cookie to override
if (document.cookie && (document.cookie.indexOf("FlashRenderOption=P") >= 0)) {
	UseFlash = 1;
} else if (document.cookie && (document.cookie.indexOf("FlashRenderOption=I") >= 0)) {
	UseFlash = 0;
}

// Call this function to set the cookie for the media type
function SetCookieType(ctype)
{
	document.cookie='FlashRenderOption='+ctype+';path=/;'
	if ( navigator.appName.indexOf("Microsoft") != -1 )
		parent.history.go(0);
	else if ( navigator.userAgent.indexOf("Mozilla/2") != -1 )
		parent.location = parent.location;
	else
		parent.location.reload();
}



function getObj(name)
{
  if (document.getElementById)
  {
  	return document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	return document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	return document.layers[name];
   	this.style = document.layers[name];
  }
}
