﻿// JavaScript File for MTE Website....


/** Code to show enlarged Map of MTE HO in new custom-sized window **/
var newWindow;
function showPopUp(url,winName)
{ 
    newWindow = window.open(url,winName); //,'height=350,width=660'top=200,left=300
    if (window.focus)
        newWindow.focus()
} 
/* End ****************************************************************************************************************/


/** Code to remove gray border around flash object in IE **/
function fixFlash()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="454px" height="205px%" id="mteIntro" VIEWASTEXT>\n');
    document.write('<param name="movie" value="images/mtequick.swf" />\n');
    document.write('<param name="quality" value="best" />\n');
    document.write('<param name="menu" value="false" />\n');
    document.write('<param name="border" value="0px" />\n');
    document.write('<param name="bgcolor" value="#172E72"\n');
    document.write('<param name="flashvars" value="init=yes&check=true" />\n');
    document.write('<embed src="images/mtequick.swf" flashvars="init=yes&check=true" quality="best" bgcolor="#172E72" border="0px" width="454px" height="205px" name="mteIntro" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>\n');
    document.write('</object>\n');
}
/* End ****************************************************************************************************************/

function goToPage(url){window.location = url;}






//*************************************************************
//****** FOLLOWING JAVASCRIPT FUNCTIONS NO LONGER IN USE ******
//*************************************************************


/*************************************
* Start of Code for "Search" TextBox *
**************************************/

// Clear Default Text: functions for clearing and replacing default text in <input> elements. Courtesy of Ross Shannon

//addEvent(window, 'load', init, false);

//function init() 
//{
//	var formInputs = document.getElementsByTagName('input');
//	
//	for (var i = 0; i < formInputs.length; i++)
//	{
//		var theInput = formInputs[i];  
//        if (theInput.type == 'text' && theInput.className.match(/\bclearDefault\b/))
//		{
//			/* Add event handlers */
//			addEvent(theInput, 'focus', clearDefaultText, false);
//			addEvent(theInput, 'blur', replaceDefaultText, false);
//			
//			/* Save the current value */
//			if (theInput.value != '')
//			{
//				theInput.defaultText = theInput.value;
//			}
//        }
//	}
//}

//function clearDefaultText(e)
//{
//	var target = window.event ? window.event.srcElement : e ? e.target : null;
//	if (!target) return;
//    if (target.value == target.defaultText)
//	{
//		target.value = '';
//		target.className = "clearDefaultActive";
//	}
//}

//function replaceDefaultText(e)
//{
//	var target = window.event ? window.event.srcElement : e ? e.target : null;
//	if (!target) return;    
//    if (target.value == '' && target.defaultText)
//	{
//		target.value = target.defaultText;
//		target.className = "clearDefault";
//	}
//}

////Cross-browser event handling
//function addEvent(element, eventType, lamdaFunction, useCapture)
//{
//    if (element.addEventListener) 
//	{
//        element.addEventListener(eventType, lamdaFunction, useCapture);
//        return true;
//	} 
//	else if (element.attachEvent) 
//	{
//		var r = element.attachEvent('on' + eventType, lamdaFunction);
//		return r;
//	}
//	else
//	{
//        return false;
//	}
//}
/* End ****************************************************************************************************************/




/********************************************************
* Start of Code for "Search" button mouse event effects *
*********************************************************/
//function loginButtonMouseOver() {document.loginButton.src = "/images/loginButtonMO.gif"; alert("mouseOver event");} //magnaMO.gif //"Page.ResolveClientUrl('../images/magnaMO.gif')"
//function loginButtonMouseOut() {document.loginButton.src ="/images/loginButton.gif";} //magna.gif
//function loginButtonMouseDown() {document.loginButton.src ="/images/loginButtonMD.gif";} //magnaMD.gif
//function loginButtonMouseUp() {document.loginButton.src ="/images/loginButton.gif";} //magnaMO.gif
/* End ****************************************************************************************************************/



//////////******************************************************************************
//////////* Alternative JS for pop-up window.  Test stuff... doesn't function properly *
//////////******************************************************************************
//////////var newWindow = null;
//////////function showPopUp(url,winName)
//////////{  
////////////    if (newWindow == 'undefined' || newWindow == null || newWindow.closed)
////////////    {
////////////        alert("new window");
////////////        newWindow = window.open(url, winName);
////////////    }
////////////    else
////////////    {
////////////        alert("opened window");
////////////        //newWindow.focus();
////////////        
////////////    }
//////////    
//////////    if (newWindow && newWindow.open && !newWindow.closed)
////////////        alert("existing window!" + window.name);
//////////        //alert('The name of this window is: "' + newWindow.name + '"');

//////////    else
//////////    {
//////////        alert("new window!");
//////////        newWindow = window.open(url, winName);
//////////        //newWindow.refresh();
//////////    }
//////////   alert(newWindow.name);
//////////    newWindow.focus();
//////////} *************************************************************************************************************






