		function SetOpacity(object,opacityPct)
			{
			  // IE.
			  object.style.filter = 'alpha(opacity=' + opacityPct + ')';
			  // Old mozilla and firefox
			  object.style.MozOpacity = opacityPct/100;
			  // Everything else.
			  object.style.opacity = opacityPct/100;
			}
			
		function ChangeOpacity(id,msDuration,msStart,fromO,toO)
			{
			  var element=document.getElementById(id);
			  var opacity = element.style.opacity * 100;
			  var msNow = (new Date()).getTime();
			  opacity = fromO + (toO - fromO) * (msNow - msStart) / msDuration;
			  if (opacity<0) 
			    SetOpacity(element,0)
			  else if (opacity>100)
			    SetOpacity(element,100)
			  else
			  {
			    SetOpacity(element,opacity);
			    element.timer = window.setTimeout("ChangeOpacity('" + id + "'," + msDuration + "," + msStart + "," + fromO + "," + toO + ")",1);
			  }
			}
		
		function FadeInImage(foregroundID,newImage,backgroundID)
			{
			  var foreground=document.getElementById(foregroundID);
			  if (backgroundID)
			  {
			    var background=document.getElementById(backgroundID);
			    if (background)
			    {
			      background.style.backgroundImage = 'url(' + foreground.src + ')';
			      background.style.backgroundRepeat = 'no-repeat';
			    }
			  }
			  SetOpacity(foreground,0);
			  foreground.src = newImage;
			  if (foreground.timer) window.clearTimeout(foreground.timer); 
			  var startMS = (new Date()).getTime();
			  foreground.timer = window.setTimeout("ChangeOpacity('" + foregroundID + "',400," + startMS + ",0,100)",20);
			}


		function doForm(nextstepnum,varname,varvalue){
				<!--
					document.getElementById('varname').value = varname;
					document.getElementById('varvalue').value = varvalue;
					document.getElementById('nextstepnum').value = nextstepnum;
					document.designform.submit();
					return false;
				// -->
				};

		function doBrowseCheckBox(nextstepnum,vartopopulate,alerttext){
				<!--
					var dalist2 = '';
					var max2 = document.designform.ckbox2.length;
					if (max2 == undefined){
						if (eval("document.designform.ckbox2.checked") == true){
						dalist2 +=document.designform.ckbox2.value;}
					}
					{for (var idx2 = 0; idx2 < max2; idx2++) {
					if (eval("document.designform.ckbox2[idx2].checked") == true) {
						dalist2 +=document.designform.ckbox2[idx2].value;
						}
					}}
					//alert(dalist2);//
					document.designform.varvalue2.value=dalist2;
					document.designform.varname2.value='do_FixtureOrientation';

					if (dalist2 == ''){
					alert('Please select at least one fixture type to continue...');}
					else
					{doCheckBoxForm(nextstepnum,vartopopulate,alerttext);
					}
				// -->
					}

		function doCheckBoxForm(nextstepnum,vartopopulate,alerttext){
				<!--
					var dalist = '';
					var max = document.designform.ckbox.length;
					if (max == undefined){
						if (eval("document.designform.ckbox.checked") == true) {
						dalist +=document.designform.ckbox.value;
						}
					}
					{for (var idx = 0; idx < max; idx++) {
					if (eval("document.designform.ckbox[idx].checked") == true) {
						dalist +=document.designform.ckbox[idx].value;
						}
					}}
					//alert(dalist);//
					document.designform.varvalue.value=dalist;
					document.designform.varname.value=vartopopulate;
					document.designform.nextstepnum.value = nextstepnum;
					if (dalist == ''){
					alert('Please select at least one ' + alerttext + 'option to continue...');}
					else {
					document.designform.submit();}
					return false;
				// -->
				}
				
		function doBrowseCheckBoxFormWindow(vartopopulate,alerttext){
				<!--
					var dalist2 = '';
					var max2 = document.designform.ckbox2.length;
					if (max2 == undefined){
						if (eval("document.designform.ckbox2.checked") == true){
						dalist2 +=document.designform.ckbox2.value;}
					}
					{for (var idx2 = 0; idx2 < max2; idx2++) {
					if (eval("document.designform.ckbox2[idx2].checked") == true) {
						dalist2 +=document.designform.ckbox2[idx2].value;
						}
					}}
					//alert(dalist2);//
					document.designform.varvalue2.value=dalist2;
					document.designform.varname2.value='do_FixtureOrientation';

					if (dalist2 == ''){
					alert('Please select at least one fixture type to continue...');}
					else {
					document.designform.submit();}
					return false;					
				// -->
					}
				

		function movepic(img_name,img_src,link_name,link_ref){
				document[img_name].src=img_src;
				//document.links[link_name].href=link_ref;//
				}
				
		function openlarge(url,showtype){
				window.open('http://www.victorianlightingshop.com/viewlarge.asp?showtype='+showtype+'&url='+url,'ImageWindow','width=365,height=385');
				}				

		function dostems(nostemlist){
					var box=document.designform.varvalue;
					var selectedstandoffid=box.options[box.selectedIndex].value;
					var box2=document.designform.varvalue2;
					var selectedstemid=box2.options[box2.selectedIndex].value;
					if ((selectedstandoffid == '') && (nostemlist != '') && (nostemlist.indexOf(selectedstemid) == -1)) {
							alert('We do not recommend using fixtures with rigid stems on track mounted directly to sloped ceilings. To continue, either select a standoff from the top box which will allow the track or rail to hang parallel to the floor or choose the attach directly option from the bottom box.');
						}
					else {
						document.designform.submit();
						}
					return false;
				}
