/*******************************************************************/
/* Copyright South Dublin County                                   */
/* ROADMAP                                                         */
/* Frank Moran/Tom Leacy                                           */
/* 10-Nov-2003                                                     */
/*                                                                 */
/* All data, procedures and other components are the property of   */
/* South Dublin County Council, any publication, distribution or   */
/* recording there of is prohibited without the express permission */
/* of South Dublin County Council, Electrial & Utilties department.*/
/* The above text should not be modified in any way.               */
/*                                                                 */
/* *****************************************************************/

/* **********************************************************************/
/* Modification Details                                                 */
/* **********************************************************************/
/* Version | Date    | Person    | Description                          */
/* **********************************************************************/
/*                                                                      */
/* **********************************************************************/


/*******************************************************************************************/
/*     Menu And Row Mouse Overs															   */
/*******************************************************************************************/
	
	var hold_class_name;
	var hold_col_class_name;
	
	function row_mouseover(row_id) 
	{
		hold_class_name                = document.all(row_id).className;
		document.all(row_id).className = 'HighLightRow';
		windowstatus(document.all(row_id).onclick);
	}
	
	function row_mouseout(row_id) 
	{
		document.all(row_id).className = hold_class_name;
		windowstatus("");
	}

	function col_mouseover(col_id) 
	{
		hold_col_class_name            = document.all(col_id).className;
		document.all(col_id).className = 'HighLightCol';
		windowstatus(document.all(col_id).onclick);
	}
	
	function col_mouseout(col_id) 
	{
		document.all(col_id).className = hold_col_class_name;
		windowstatus("");
	}	

	function menuoption_mouseover(optionid) 
	{
		document.all('left_img_' + optionid).style.visibility = "visible";
		document.all('right_img_' + optionid).style.visibility = "visible";
		event.srcElement.className = 'menuitem_active';
		windowstatus(document.all(optionid).title);
	}

	function menuoption_mouseout(optionid)	
	{
		document.all('left_img_' + optionid).style.visibility = "hidden";
		document.all('right_img_' + optionid).style.visibility = "hidden";
		event.srcElement.className = 'menuitem_inactive';
		windowstatus("");
	}
	
	function menu_mouseover(optionid) 
	{
		windowstatus(document.all(optionid).title);
	}

	function menu_mouseout(optionid)	
	{
		windowstatus("");
	}	

	function toolbutton_mouseover(optionid) 
	{
		event.srcElement.className = 'ToolButton_active';
		windowstatus(document.all(optionid).title); 
	}

	function toolbutton_mouseout(optionid)	
	{
		event.srcElement.className = 'ToolButton_inactive';
		windowstatus("");
	}


	function HTMLControlMouseOverHelp()
		{
		  if (event.srcElement.title) windowstatus(event.srcElement.title); 
		}

	function HTMLControlMouseOutHelp()
		{
		  windowstatus("");
		}

	
	function toolbuttonmouse(bOver,sButtonId,sImage)
		{if (bOver=true)
			{ 
			 windowstatus(document.all(sButtonId).title)
			 playsound("rollover.wav")
			}
		 else
			windowstatus("")
		 document.all[sButtonId].src = sImage
		}
/*******************************************************************************************/
/*     Menu And Row Mouse Overs							           */
/*******************************************************************************************/




/*******************************************************************************************/
/*     Got And Lost Focus								   */
/*******************************************************************************************/
var hold_gotfocus_scontrol = "";
var hold_gotfocus_class = "";

function GotFocus(sFocusControl,sFocusClassName)
{
  LostFocus();
  hold_gotfocus_scontrol 	   = sFocusControl;
  hold_gotfocus_class    	   = document.all(sFocusControl).className
  document.all(sFocusControl).className = sFocusClassName;
}

function LostFocus()
{ if (Trim(hold_gotfocus_scontrol) != "")
     document.all(hold_gotfocus_scontrol).className = hold_gotfocus_class;
}

function ShowHTMLObject(HTMLObject,ShowHide)
	{if (ShowHide==2)
		{
		 if (document.all[HTMLObject].style.display=="none")
			document.all[HTMLObject].style.display=""
		 else
			document.all[HTMLObject].style.display="none";		 
		}
	 else
		{
		 if (ShowHide)
			{
			 document.all[HTMLObject].style.display   = "block"	 
			 document.all[HTMLObject].style.visibility= "visible"	 
			}
		 else
			{
			 document.all[HTMLObject].style.display   = "none";	 
			 document.all[HTMLObject].style.visibility= "hidden";	 
			}
		}
	}
	
function ShowMenu(MenuId)
	{
	 playsound("menuopen.wav")	 
	 if (document.all[MenuId].style.display=="none")
		{		 
		 document.all[MenuId].style.display=""
		 document.all[MenuId + '_Header_Image'].innerHTML="<FONT SIZE=2 FACE='Webdings'>&#53;</FONT>"
		 setCookie(MenuId,"OPEN")
		} 
	 else
		{
		 document.all[MenuId].style.display="none";	 
		 document.all[MenuId + '_Header_Image'].innerHTML="<FONT SIZE=2 FACE='Webdings'>&#54;</FONT>"
		 setCookie(MenuId,"none")
		}
	}	
	
	
function ChangeContractor()
	{
	 if (Trim(document.all("ContractorName").value) != '')
	    {
	     document.all("Label_ContractorName").className				= "RequiredField";
	     document.all("Label_ContractorContactName").className		= "RequiredField";
	     if (document.all("ContractorAddress")) document.all("Label_ContractorAddress").className = "RequiredField";
	     document.all("Label_ContractorPhoneDay").className			= "RequiredField";
         disablecontrol("ContractorName",false,false); 
         if (document.all("ContractorAddress")) disablecontrol("ContractorAddress",false,false);
         disablecontrol("ContractorContactName",false,false); 
         disablecontrol("ContractorPhoneDay",false,false); 
	     disablecontrol("ContractorPhoneNight",false,false);
	    }
     else
	    {
	     document.all("Label_ContractorName").className				= "Label";
	     document.all("Label_ContractorContactName").className		= "Label";
	     if (document.all("ContractorAddress")) document.all("Label_ContractorAddress").className = "Label";
	     document.all("Label_ContractorPhoneDay").className			= "Label";
         disablecontrol("ContractorName",true,true); 
         if (document.all("ContractorAddress")) disablecontrol("ContractorAddress",true,true); 
         disablecontrol("ContractorContactName",true,true); 
         disablecontrol("ContractorPhoneDay",true,true); 
	     disablecontrol("ContractorPhoneNight",true,true);
	    }
	}	
/*******************************************************************************************/
/*     Got And Lost Focus								   */
/*******************************************************************************************/



/*******************************************************************************************/
/*     Functions									   */
/*******************************************************************************************/

function addDays(myDate,days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
}

function playsound(soundfile)
{	/*if (document.all('menuitem_sound'))
	    document.all('menuitem_sound').src= ROOTURL + "/Sounds/" + soundfile*/
}	


function windowstatus(sstatustext)
{
 window.status=sstatustext  
}

function TrimRight( string ) {
	var i;
	for(i = (string.length-1); i>=0,string.charAt(i)==' ';i--)
		string = string.substring(0,string.length-1);
	return string;
}

function TrimLeft( string ) {
	var i;
	while (string.charAt(0) == ' ')
		string = string.substring(1,string.length);
	return string;
}

function Trim(string) 
{
	return TrimRight(TrimLeft(string));
}


function IsInteger(numStr)
{
	// Validate that its a valid integer. Valid characters are 0 to 9
	//
	inRetVal=true;
	inLen=numStr.length;
	DecPointCount=0;
	for (inX=0; inX < inLen; inX++) {
		inChar = numStr.charAt(inX);
		if (inChar != "0" && inChar != "1" && inChar != "2" && inChar != "3" && inChar != "4" && 
		    inChar != "5" && inChar != "6" && inChar != "7" && inChar != "8" && inChar != "9" )
			{
			inRetVal=false;
			inX=inLen;
			}
	}
	return inRetVal;
} 


function IsNumber(numStr,allowdecimals)
{
	// Validate that its a valid number. Characters are 0 to 9. minus(-) and Decimal place(.)
	//- and . can only occur once and the minus must be at start at string (if used)
	inRetVal=true;
	inLen=numStr.length;
	DecPointCount=0;
	for (inX=0; inX < inLen; inX++) {
		inChar = numStr.charAt(inX);
		if (inChar != "0" && inChar != "1" && inChar != "2" && inChar != "3" && inChar != "4" && 
		    inChar != "5" && inChar != "6" && inChar != "7" && inChar != "8" && inChar != "9" && 
			inChar != "." && inChar != "-")
			{
			inRetVal=false;
			break;
			}
		else {
			if (inChar == ".") {
				if (allowdecimals == 0) {
					// No decimals allowed
					inRetVal=false;
					break;
				}
				DecPointCount++;
				if (DecPointCount > 1) {
					// Cannot be more than one of these
					inRetVal=false;
					break;
				}
			}
			if (inChar == "-") {
				if (inX != 0) {
					// Negative sign only allowed at start of string
					inRetVal=false;
					break;
				}
			}
		}
	}
	return inRetVal;
}

function openpage(url)
{	
 	if (Trim(url) != "") 
           window.location = url;
	else
	   alert("Option Not Available Yet");
}

function deleterecord(url,DeletePrompt)
{
  /* TLeacy 1.3 15 July 
     Allow overriding of the delete prompt and just delete the records
  */
  if (DeletePrompt==true)
     {if (confirm("Delete Record? Click OK to Delete, Otherwise Click Cancel")==true) window.location = url}
  else
	 {window.location = url}
}

function Logout(url)
{
  window.location = url

}

function disablecontrol(scontrol,bdisable,bclear)
{
  document.all(scontrol).disabled = bdisable;
  if (bdisable==true) 
	  if (document.all(scontrol).type == "button")
	     document.all(scontrol).className = "commandbuttondisabled";
	  else	  
	     document.all(scontrol).className = "DisabledControl";
  switch (document.all(scontrol).type)
		{
		 case "text":       {if (bdisable==false) document.all(scontrol).className = "TextBox"; 
							 break;
							}
		 case "textarea":   {if (bdisable==false) document.all(scontrol).className = "TextBox";
		                     break;
		                    }
		 case "select-one": {if (bdisable==false) document.all(scontrol).className = "ComboBox" ;
		                     break;
		                    }	
		 case "button":  {if (bdisable==false) document.all(scontrol).className = "commandbutton" ;
		                     break;
		                    }                   		 
		}
		
  if (document.all(scontrol).type == "checkbox") 
	 document.all(scontrol).checked = bclear
  else
	if (bclear) document.all(scontrol).value = "" 
  
}

function TPrintPreview(url)
{
  w = window.open(url,"PrintPreview","toolbar=no,scrollbars=yes,resizable=yes");
  w.focus();
}

function UserInfo(ID)
{
  w = window.open(ROOTURL + "Common/UserInfo/UserInfo.Asp?Id=" + ID,"UserInfo","toolbar=no,scrollbars=no,resizable=no,width=700,height=300");
  w.focus();
}

function SetDHTML(HTML,sObject)
{
   if (document.all)
       document.all(sObject).innerHTML=HTML
   else if (document.getElementById)
           document.getElementById(sObject).innerHTML=HTML
}

var LastKeyCode = -1;

function CheckSpecialKeys(sControlName)
	{ //alert(window.event.keyCode)
	  switch (window.event.keyCode)
		{
			case 113: /* F2 */
				  {
				   DisplayHelp(sControlName,document.forms[0].name); 
				   break;
				  }
			case 84: /* T */
				  {
				   if ((LastKeyCode == 17) && document.all(sControlName).type == "text") /* Control Key + D  + Text Box*/
					  document.all(sControlName).value = GetDate(0)
				   break;
				  }
			case 89: /* Y */
				  {
				   if ((LastKeyCode == 17) && document.all(sControlName).type == "text") /* Control Key + Y  + Text Box*/
					  document.all(sControlName).value = GetDate(-1)
				   break;
				  }				  
			case 77: /* M */
				  {
				   if ((LastKeyCode == 17) && document.all(sControlName).type == "text") /* Control Key + M  + Text Box*/
					  document.all(sControlName).value = GetDate(1)
				   break;
				  }				  
		}
	  LastKeyCode = window.event.keyCode;
	}
	
function GetDate(DayCount)
	{ var d = new Date();
	
		if (DayCount!= 0)
			d.setDate(d.getDate()+DayCount);
						
		return [d.getDate(),d.getMonth()+1,d.getYear()].join('/')
	}	
	
	
function ShowTab(TabCard,NumberOfTabs)
	{ var simage
	 try
		{	
			NumberOfTabs = NumberOfTabs + 1;
			for (index=1; index <NumberOfTabs;++index)
				{if (document.all['tab' + index])
					{
					document.all['TabCardHeader' + index].className = "TabCardHeaderImageInActive"
					document.all['TabCardHeader' + index + '_tab_title'].className = "TabTitleInActive"
					document.all['tab' + index].style.visibility = "hidden"
					simage = ROOTURL + "images/TabCardImages/InActive_left.gif"
					document.all['TabCardHeader' + index + '_tab_left'].src = simage
					simage = ROOTURL + "images/TabCardImages/InActive_spacer.gif"
					document.all['TabCardHeader' + index + '_tab_middle'].style.backgroundImage = "url(" + simage + ")"
					simage = ROOTURL + "images/TabCardImages/InActive_right.gif"
					document.all['TabCardHeader' + index + '_tab_right'].src = simage	
					 
					document.all['tab' + index].style.display = "none"		 
					}
				}
			    
			document.all['tab' + TabCard].style.visibility ="visible" 	  
			document.all['TabCardHeader' + TabCard].className = "TabCardHeaderImageActive"
			document.all['TabCardHeader' + TabCard + '_tab_title'].className = "TabTitleActive"
			simage = ROOTURL + "images/TabCardImages/white_tab_left.gif"
			document.all['TabCardHeader' + TabCard + '_tab_left'].src = simage
			simage = ROOTURL + "images/TabCardImages/white_tab_spacer.gif"
			document.all['TabCardHeader' + TabCard + '_tab_middle'].style.backgroundImage = "url(" + simage + ")"
			simage = ROOTURL + "images/TabCardImages/white_tab_right.gif"
			document.all['TabCardHeader' + TabCard + '_tab_right'].src = simage
			document.all['tab' + TabCard].style.display ="" 
		}
	 catch(e)
		{DisplayError(e,"ShowTab")}			
	}	

function DisplayError(ErrorObject,ProcedureName)
	 {alert("Error In " + ProcedureName + " --> " + e.description)}		
	
function QuickSearch(sUrl)
{
	var QPrefix,QDocument,QYear,QMonth,QNumber
	
   QPrefix   = document.all("QPrefix").value
   if(Trim(QPrefix) == "") 
	  {
	   alert("A Prefix Must Be Entered")
	   document.all("QPrefix").focus()
	   return false
	  }
	  
   QDocument = document.all("QDocument").value
   
   QYear	 = document.all("QYear").value
   if(Trim(QYear) == "") 
	  {
	   alert("A Year Must Be Entered")
	   document.all("QYear").focus()
	   return false
	  }   
	  
   QMonth	 = document.all("QMonth").value   
   QNumber	 = document.all("QNumber").value   
   if(Trim(QNumber) == "") 
	   {
        setCookie("QNumber","")
        QNumber = -1
       }
   else
       setCookie("QNumber",QNumber)   
   setCookie("QPrefix",QPrefix)
   setCookie("QDocument",QDocument)
   setCookie("QYear",QYear)
   setCookie("QMonth",QMonth)

   sUrl	     = sUrl + "QuickSearch/QuickSearch.Asp?QPrefix=" + escape(QPrefix) + "&QDocument=" + QDocument + "&QYear=" + QYear + "&QMonth=" + QMonth + "&QNumber=" + QNumber 
   window.location = sUrl
}	

function QuickSearchRoad()
{
	var QRoadName,QRoadDocument,QRoadYear
	
   QRoadName   = document.all("QRoadName").value
   if(Trim(QRoadName) == "") 
	  {
	   alert("A Road Name Must Be Entered")
	   document.all("QRoadName").focus()
	   return false
	  }
	 
   QRoadDocument = document.all("QRoadDocument").value   
   QRoadYear	 = document.all("QRoadYear").value
   if(Trim(QRoadYear) == "") 
	  {
	   alert("A Year Must Be Entered")
	   document.all("QRoadYear").focus()
	   return false
	  } 	 
	  
   setCookie("QRoadName",QRoadName)
   setCookie("QRoadDocument",QRoadDocument)
   setCookie("QRoadYear",QRoadYear)

   sUrl	     = ROOTURL + "QuickSearch/QuickSearchRoad.Asp?QRoadName=" + QRoadName + "&QRoadDocument=" + QRoadDocument + "&QRoadYear=" + QRoadYear 
   window.location = sUrl
}	


function OpenApplication(sUrl,sTableName,TId)
{
    sUrl = sUrl + "Common/TDisplayApplication/TDisplayApplication.Asp?TableName=" + sTableName + "&TId=" + TId
	window.open(sUrl,'SDCCRoadOpeningApplication','status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes')  
}

function maximizeWin() 
{
  if (window.screen)
     {
      var aw = screen.availWidth;
      var ah = screen.availHeight;
      if ((aw <=1024) || (ah <=768))
		 {
		  aw = 1024
		  ah = 740
		  window.moveTo(0, 0);
		  window.resizeTo(aw, ah);  		  
		 }
     }
}


function ZeroAndNonZeroValue(V1,V2)
{	
	if (((V1==0) && (V2!=0)) || ((V1!=0) && (V2==0)))
		{
		 return true
		}
	else
		return false
}

/*******************************************************************************************/
/*     Functions																		   */
/*******************************************************************************************/




/*******************************************************************************************/
/*     Buttons										   */
/*******************************************************************************************/
var hold_buttonclass_name;

function button_mouseover(buttonid) 
{
 	hold_buttonclass_name            = document.all(buttonid).className;
 	document.all(buttonid).className = 'commandbuttonactive';
 	if (event.srcElement.title) 
 	    windowstatus(event.srcElement.title)
 	else
	   windowstatus(event.srcElement.onclick);
}

function button_mouseout(buttonid) 
{
 	document.all(buttonid).className = hold_buttonclass_name;
	windowstatus("");
}
/*******************************************************************************************/
/*     Buttons										   */
/*******************************************************************************************/





/*******************************************************************************************/
/*     Right Click Menu									   */
/*******************************************************************************************/

	/******************************************************************************/
	//set the skin of the menu (0 or 1, with 1 rendering a default Windows menu like skin)
	var menuskin=1
	
	//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
	var display_url=1
	
	function showmenuie5(){
		//Find out how close the mouse is to the corner of the window
		var rightedge=document.body.clientWidth-event.clientX;
		var bottomedge=document.body.clientHeight-event.clientY;
		
		//if the horizontal distance isn't enough to accomodate the width of the context menu
		if (rightedge<ie5menu.offsetWidth)
			//move the horizontal position of the menu to the left by it's width
			ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
		else
			//position the horizontal position of the menu where the mouse was clicked
			ie5menu.style.left=document.body.scrollLeft+event.clientX;
		
		//same concept with the vertical position
		if (bottomedge<ie5menu.offsetHeight)
			ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight
		else
			ie5menu.style.top=document.body.scrollTop+event.clientY;
		
		ie5menu.style.visibility="visible";
		return false;
	}
	
	function hidemenuie5(){
		ie5menu.style.visibility="hidden";
	}
	
	function highlightie5(){
		if (event.srcElement.className=="menuitems"){
			event.srcElement.style.backgroundColor="highlight";
			event.srcElement.style.color="white";
			if (display_url==1)
				window.status=event.srcElement.url;
		}
	}
	
	function lowlightie5(){
		if (event.srcElement.className=="menuitems"){
			event.srcElement.style.backgroundColor="";
			event.srcElement.style.color="black";
			window.status='';
		}
	}
	
	function jumptoie5(){
		if (event.srcElement.className=="menuitems"){
			if (event.srcElement.getAttribute("target")!=null)
				window.open(event.srcElement.url,event.srcElement.getAttribute("target"))
			else
				window.location=event.srcElement.url;
		}
	}
/*******************************************************************************************/
/*     Right Click Menu																	   */
/*******************************************************************************************/

/*******************************************************************************************/
/*     Clock																			   */
/*******************************************************************************************/
/*
Live Date Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/

var dayarray=new Array("Sun","Mon","Tue","Wed","Thur","Fri","Sat")
var montharray=new Array("Jan","Feb","March","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec")

function UpdateClock()
{
   var mydate=new Date()
   var year=mydate.getYear()

   if (year < 1000) year+=1900
   var day=mydate.getDay()
   var month=mydate.getMonth()
   var daym=mydate.getDate()
   if (daym<10) daym="0"+daym

   var hours=mydate.getHours()
   var minutes=mydate.getMinutes()
   var dn="AM"
   if (hours>=12) dn="PM"

   if (hours>12) {hours=hours-12}
   if (hours==0) hours=12
   if (minutes<=9) minutes="0"+minutes


   //change font size here
   var cdate=dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+" "+dn
   if (document.all)
	  if (document.all("clock")) document.all.clock.innerHTML= "&nbsp;" + cdate
   else if (document.getElementById)
           document.getElementById("clock").innerHTML= "&nbsp;" + cdate
        else
           document.write(cdate)
}


function setclockrefreshrate()
{
 if (document.all||document.getElementById) setInterval("UpdateClock()",60000)
}

/*******************************************************************************************/
/*     Clock										   */
/*******************************************************************************************/


/*******************************************************************************************/
/*     Cookies																			   */
/*******************************************************************************************/



function setCookie(sName,sValue)
{
  date = new Date();
  document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 31 Dec 2010 23:59:59 GMT;path=/"
}


function getCookie(sName)
{
 var search = sName + "=";
 var RetStr = ""
 var offset = 0;
 var end    = 0;
 

 if (document.cookie.length>0)
	{
	 offset = document.cookie.indexOf(search)
	 if (offset != -1)
		{
		 offset += search.length;
		 end    = document.cookie.indexOf(";",offset)
		 if (end==-1)
			end = document.cookie.length
		 RetStr = unescape(document.cookie.substring(offset,end));
		}
	}
 return (RetStr)
}
/*******************************************************************************************/
/*     Cookies																			   */
/*******************************************************************************************/




/*******************************************************************************************/
/*     Help																				   */
/*******************************************************************************************/
function DisplayHelp(sControlName,FormName)
{	
	if (Trim(SDCC_HelpPage) != "")
		{
		 window.open(ROOTURL + "/eHelp/eHelp.Asp?HelpFileName=" + SDCC_HelpPage, "eHelp","location=no,directories=no,status=yes,toolbar=no,scrollbars=auto,resizable=yes,height=600,800");
		 //window.showHelp(SDCC_HelpPage)
		}
		
	else
		alert("No Help Available For " + sControlName + " On Form " + FormName) 
				  
}  
/*******************************************************************************************/
/*     Help																				   */
/*******************************************************************************************/


function closewindow()
{/*window.location = ROOTURL + "/Toolbar/Logout/CloseWindow.Asp"*/}

function onUnloadPage()
{
 if (document.all)
	{
	 if ((window.event.clientX < 0) && (window.event.clientY < 0)) //X button is clicked
	 {window.open(ROOTURL + "/Toolbar/Logout/CloseWindow.Asp", "", "CLOSEWINDOW");}
	}
}


function opengis(url)
{
  w = window.open(url,"GIS","toolbar=no,scrollbars=yes,resizable=yes,status=yes");
  w.focus();
}

function TScheduleShowAreas()
	{if (document.all["TScheduleAreas"].style.display=="none")
		{ 
		 document.all["TScheduleAreas"].style.display="";
		 document.all["TScheduleAreaDirectionArrow"].innerHTML="&#9650;"		 
		}
	 else
		{
		 document.all["TScheduleAreas"].style.display="none";	 
		 document.all["TScheduleAreaDirectionArrow"].innerHTML="&#9660;"
		}
	}
	
		
function TMotionsAttached(TableName,TId,RoadId)
	{window.location = ROOTURL + "Common/TMotionsAttached/TMotionsAttachedList.Asp?TableName=" + TableName + "&TId=" + TId + "&RoadId=" + RoadId}
	
var FadeMessageInterval;
var FadeMessageCount = 100;
var oFadeMessageWindow;
function FadingMessage(sMessage,WaveFile)
	{
	 try
		{
	     if (document.all["FadingMessageWindow"])
			{oFadeMessageWindow = document.all["FadingMessageWindow"]	
			 oFadeMessageWindow.style.display = "";
			 document.all["FadingMessage"].innerHTML = sMessage
			 FadeMessageInterval = setInterval("FadeMessage()", 10);			 
			 if ((document.all("menuitem_sound")) && (WaveFile !="")) document.all('menuitem_sound').src= ROOTURL + "/Sounds/" + WaveFile
			}			
		}		  			 
	 catch(e)
		{alert(sMessage)}		
	
	}	

function FadeMessage()
	{
	 FadeMessageCount = FadeMessageCount - 1
	 if (FadeMessageCount<=0) 
		{
		 clearInterval(FadeMessageInterval)
		 oFadeMessageWindow.style.display = "none";
		}
	 oFadeMessageWindow.filters.alpha.opacity=FadeMessageCount
	}	
	
function DisableSpan(SpanId,Enabled)
	{document.all(SpanId).disabled = Enabled}
	
	
	
function ClaimsScheduleFilterOpenClose(FilterType)
	{if (document.all[FilterType+"FILTERWINDOW"].style.display=="none")
		{ 
		 document.all[FilterType+"FILTERWINDOW"].style.display="";
		 document.all[FilterType+"DirectionArrow"].innerHTML="&#9650;"		 
		}
	 else
		{
		 document.all[FilterType+"FILTERWINDOW"].style.display="none";	 
		 document.all[FilterType+"DirectionArrow"].innerHTML="&#9660;"
		}
	}		