/* this function is used for created a drop box that lets you jump to a particular
URL. The form_reference parameter represents a reference to the current form in case
 there is more than one form defined in a document
 
 example: 
 <select name="example_select" size="1" onChange="dropDownLink(this.form, ARRAY_REFERNCE)">
 
- NOTE: pass the corret array name refernce 
- an option is set to a value of false if no action should be taken. 
 
 */

function dropDownLink(form_reference, select_tag_name) //PARAMETER: select_tag_name is the <select name=""> attribute value
{
	var url = form_reference[select_tag_name].options[form_reference[select_tag_name].selectedIndex].value;
	if(url != "false")
	{
		window.top.location.href=url;
	}
}
/* 

USAGE:
<select NAME="dropDown" onChange="dropDownLink(this.form, url_array_object_name)" >




original (old) sybtax
<select NAME="TestForm" 
onChange="GoURL(form.TestForm.options[form.TestForm.selectedIndex].value)">

*/

/* this function is used for rollover changing images for hardware spec & pop up window*/
function newImage(arg) 
{
	if (document.images) 
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() 
{
	if (document.images && (preloadFlag == true)) 
	{
		for (var i=0; i<changeImages.arguments.length; i+=2) 
		{
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() 
{
	if (document.images) 
	{
		rollovertitle_tapedeck_over = newImage("contents/images/rollovertitle-tapedeck_over.gif");
		rollovertitle_computer_over = newImage("contents/images/rollovertitle-computer_over.gif");
		rollovertitle_triton_over = newImage("contents/images/rollovertitle-triton_over.gif");
		rollovertitle_headphone_over = newImage("contents/images/rollovertitle-headphone_ove.gif");
		rollovertitle_monitor_over = newImage("contents/images/rollovertitle-monitor_over.gif");
		rollovertitle_mixer_over = newImage("contents/images/rollovertitle-mixer_over.gif");
		b_medialab_hard_01_mzipdriver_over = newImage("contents/images/b_medialab_hard_01-mzipdriv.gif");
		b_medialab_hard_01_msimac_over = newImage("contents/images/b_medialab_hard_01-msimac_o.gif");
		name_utapedeck_over = newImage("contents/images/name-utapedeck_over.gif");
		name_utriton_over = newImage("contents/images/name-utriton_over.gif");
		name_umixer_over = newImage("contents/images/name-umixer_over.gif");
		name_uzip_over = newImage("contents/images/name-uzip_over.gif");
		name_uimac_over = newImage("contents/images/name-uimac_over.gif");
		name_uheadphone_over = newImage("contents/images/name-uheadphone_over.gif");
		preloadFlag = true;
	}
}



function MM_goToURL() 
	{ 
	  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	}

function myWindow(theURL,winName,features) 
	{ 
	  window.open(theURL,winName,features);
	}



/* BEGIN - Open New window in the center of screen */
function NewWindow(mypage, myname, w, h, scroll) 
	{
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
/* END - Open New window in the center of screen */


/* BEGIN - Scroll message */
/*
			// change this to where you store the blank.gif image
			var blank = "images/blank.gif";
			
			topedge = 1;  // location of news box from top of page
			leftedge = 0;  // location of news box from left edge
			boxheight = 48;  // height of news box
			boxwidth = 150;  // width of news box
			scrollheight = 106; // total height of all data to be scrolled
			
			function scrollnews(cliptop) 
				{
					if (document.layers) 
						{
							newsDiv = document.news;
							newsDiv.clip.top = cliptop;
							newsDiv.clip.bottom = cliptop + boxheight;
							newsDiv.clip.left = 0;
							newsDiv.clip.right = boxwidth + leftedge;
							newsDiv.left = leftedge;
							newsDiv.top = topedge - cliptop;
						}
					else 
						{
							newsDiv = news.style;
							newsDiv.clip = "rect(" + cliptop + "px " + (boxwidth + leftedge) + "px " + (cliptop + boxheight) + "px 0px)";
							newsDiv.pixelLeft = leftedge;
							newsDiv.pixelTop = topedge - cliptop;
						}
					cliptop = (cliptop + 1) % (scrollheight + boxheight);
					newsDiv.visibility='visible';
					setTimeout("scrollnews(" + cliptop + ")", 100);
				}
*/
/* END - Scroll message */// JavaScript Document
