// javascript code (replace "myMovie" with the name of your flash element in the embed

function checkForDeepLink()
{
	var fullURL = parent.document.url;
	var qPointer = fullURL.indexOf('?');
	if(qPointer!=-1)
	{
		var queryString = fullURL.substring(qPointer, fullURL.length);
		var qPairs = queryString.split("&");
		for(var i=0;i<qPairs.length;i++)
		{
			var qVals = qPairs[i].split("=");
			if(qVals[0]=="d")
			{
				var targetSection = qVals[1];
				flashName.js_targetSection(targetSection);
				
				getMovieName("swf/photo_shell.swf").js_loadSection(targetSection); 

			}
		}
	}
}

function getMovieName(movieName) 
{
	if (navigator.appName.indexOf("Microsoft") != -1) 
	{
		return window[movieName]
	}
	else
	{
		return document[movieName]
	}
}

var login = 0;
function toggleLogin(){
	if (login == 0){
		document.getElementById("login_box").style.visibility = "visible";
		login = 1;
	}else{
		document.getElementById("login_box").style.visibility = "hidden";
		login = 0;
	}
}


var currentDropDown = null;
var dropDownFrozen = null;


function toggleDropDown(obj) {
    //originalClass = $('#navItem1')[0].className;
    //orignalClass = obj.className;
    //if (originalClass = null) originalClass = "mainnav_item_on";
    var theClass = obj.className;
    if (theClass == null) theClass = "mainnav_item_on";
    if (theClass.indexOf("_sub") == -1)
    {
        originalClass = obj.className;
        obj.className = originalClass + "_sub";
    }
        
    
	$('#subnav').slideDown('fast')

	currentDropDown = obj;
	
}

function closeDropDown(originalClass) {


    if (currentDropDown != null) {
        if (originalClass != 'mainnav_item_on') {
            $('#subnav').slideUp('fast')
            currentDropDown.className = originalClass;
            currentDropDown = null;
        }
    }

	
}

function closeDropDownMenuHover() {
    //currentDropDown.className = "mainnav_item";
    //if (dropDownFrozen) {
    //}
    //else {
        $('#subnav').slideUp('fast')
    //}
    //currentDropDown = null;
}

function freezeDropDown() {
    dropDownFrozen = true;
}

function unfreezeDropDown() {
    dropDownFrozen = false;
}
