/* Resolution Dependant Style Switcher

   This javascript by Cameron Adams
   http://www.themaninblue.com/writing/perspective/2006/01/19/
   ------------------------------------------------------------------------------------------------------------------------*/
   
function addLoadListener(fn)
{
	if (typeof window.addEventListener != 'undefined') {
		window.addEventListener('load', fn, false);
	}
	else if (typeof document.addEventListener != 'undefined')	{
		document.addEventListener('load', fn, false);
	}
	else if (typeof window.attachEvent != 'undefined') {
		window.attachEvent('onload', fn);
	}
	else {
		return false;
	}
	
	return true;
};

function attachEventListener(target, eventType, functionRef, capture) 
{
    if (typeof target.addEventListener != "undefined") {
        target.addEventListener(eventType, functionRef, capture);
    }
    else if (typeof target.attachEvent != "undefined") {
        target.attachEvent("on" + eventType, functionRef);
    }
    else {
        return false;
    }

    return true;
};

function jumpFromFrames()
{
    
    if (parent.frames.length > 0) {
        parent.location.href = self.document.location;
    }
}

function toggleLoginForm()
{
   
    if(document.getElementById("signintofund") && document.getElementById("signintofundform"))
    {
        
        var signintofund = document.getElementById("signintofund");
        var signintofundform = document.getElementById("signintofundform");
        
        if(signintofundform.style.display == 'block' || signintofundform.style.display=="")
          {
             signintofundform.style.display = 'none';						
          }
          
          signintofund.onclick = function(){
            var signintofundform = document.getElementById("signintofundform");
              if(signintofundform.style.display == 'block' || signintofundform.style.display=="")
              {
                  signintofundform.style.display = 'none';						
              }
              else
              {
                  signintofundform.style.display = 'block'; 
              }
            
            return false;
          };
         
    }
}
addLoadListener(toggleLoginForm);
addLoadListener(jumpFromFrames);

