           function MM_swapImgRestore() { 
                  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
                }

                function MM_preloadImages() { 
                  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
                    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
                    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
                }

                function MM_findObj(n, d) { 
                  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
                    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
                  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
                  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
                  if(!x && d.getElementById) x=d.getElementById(n); return x;
                }

                function MM_swapImage() { 
                  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
                   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
                }

                function changeImgs()
                {
                    var URL = new String(window.location.href); // reads the url
                    var subURL = URL.substr(7); // gets = http://
                    var parts = subURL.split("/"); // uses "/" to separate the parts
                    var dir = parts[4];
                    var img = document.getElementById(dir)
                    img.src = "../images/" + dir + "1.gif"; // gif must be name the same a directoy
                    img.parentNode.onmouseover = null;
                    img.parentNode.onmouseout = null;
                }




function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


function eraseCookie(name) {
	createCookie(name,"",-1);
}


			 function gopath(path) {
			  var query = location.pathname;
 			    var QArray = query.split("/");
				var newstring = "/psp/" + QArray[2] + path;
				saveWarning('TargetContent',null,'_parent',newstring);
		   }
		   
		   function goHome() {
		   //set the cookie
		 
		    cookieValue = 'new';
		    cookieName = 'LGCcspChange';
		    createCookie( cookieName, cookieValue, 1);
		  
		    
		   
		   var query = location.pathname;
		    			    var QArray = query.split("/");
				var newstring = "/psp/" + QArray[2] + "/CUSTOMER/CRM/h/?tab=GUEST";
				parent.location.href = newstring;
								
				}
		   
		   
		   function checkLoad() {
		   
		   // first we'll split this cookie up into name/value pairs
		   	// note: document.cookie only returns name=value, not the other components
		   	var a_all_cookies = document.cookie.split( ';' );
		   	var a_temp_cookie = '';
		   	var cookie_name = '';
		   	var cookie_value = '';
		   	var b_cookie_found = false; // set boolean t/f default f
		   	
		   	for ( i = 0; i < a_all_cookies.length; i++ )
		   	{
		   		// now we'll split apart each name=value pair
		   		a_temp_cookie = a_all_cookies[i].split( '=' );

		   		// and trim left/right whitespace while we're at it
		   		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		   		
		   		// if the extracted name matches passed check_name
		   		if ( cookie_name == 'LGCcspChange' )
		   		{
				//alert(cookie_name);
		   			 eraseCookie(cookie_name)

		   			window.location.reload(false);
		 		    
		   			break;
		   		}
		   		a_temp_cookie = null;
		   		cookie_name = '';
		   	}
		   	if ( !b_cookie_found )
		   	{

		   		return null;
		   	}

		   
		   
		   }
		   
		   
		   //added for code pages to function properly on menu link click
		   var  totalTimeoutMilliseconds = 14400000; 
		   var  warningTimeoutMilliseconds = 14100000; 
		   var timeOutURL = 'http://psdweb1.lgc.com:7002/psp/cspupg/CUSTOMER/CRM/?cmd=expire';
		   var timeoutWarningPageURL = 'http://psdweb1.lgc.com:7002/psc/cspupg/CUSTOMER/CRM/s/WEBLIB_TIMEOUT.PT_TIMEOUTWARNING.FieldFormula.IScript_TIMEOUTWARNING';

		   
		   //  %Copyright
		   //  ToolsRel: %Toolsrel
		   
		   //% These are used for cross-domain check...
		   document.props = new Object();
		   document.props.location = document.location.href;
		   document.props.domain = document.domain;
		   
		   function saveWarning(frameName,form,target,url)
		   {
		   var changed=null;
		   
		   if (form)
		     changed = checkFormChanged(form, null);
		   
		   if (changed==null && top.frames && frameName.length>0 )
		   {
		     objFrame = top.frames[frameName];
		     if (objFrame)
		       changed=checkFrameChanged(objFrame);
		   }
		   
		   if ((changed==null) && top.frames)
		     changed = checkAnyFrameChanged(top.frames);
		   
		   var rtn = true;
		   if (changed)
		     rtn = !confirm("%Message(124,202,You have unsaved data on this page. Click OK to go back and save the information, or Cancel to continue.)");
		   
		   if (!url)
		     return rtn;           //% just tell caller if changed/confirmed
		   
		   if (rtn)
		     open(url, target)
		   
		   }
		   
		   //%For Accessibility(ICE 727959000) reposition to specified anchor and set the focus.  
		   function setAnchorAndFocus(link) 
		   {
		   setAnchor(link);
		   
		   var obj = document.anchors[link];
		   if (obj == null && document.getElementById) 
		       obj=document.getElementById(link);
		   if (obj != null)
		       tryFocus(obj);
		   } 
		   
		   
		   //% Attempt to reposition to the specified anchor. 
		   function setAnchor(link) 
		   {
		   var obj = document.anchors[link];
		   if (obj == null && document.getElementById) 
		       obj=document.getElementById(link);
		   
		   if (obj!=null && typeof obj == 'object')
		       {
		       if (obj.scrollIntoView) 
		           obj.scrollIntoView();
		       else 
		           //% questionable kludge. Try to avoid refresh loops by
		           //% only doing this if we aren't already there.  Also, note the  
		           //% value should not include the "#" according to my doc, but with
		           //% sfari, at least, it does; so check both forms
		   	    if (document.location.hash != ("#" + link) && document.location.hash != link) 
		               document.location.href = "#"+link;
		       }
		   }                
		   
		   //% See if any frame has a change
		   function checkAnyFrameChanged(frames)
		   {
		   for (var j=0; j < frames.length; ++j)
		   {
		     var objFrame = frames[j];
		     if (checkFrameChanged(objFrame))
		       return true;
		     //% check child frames
		     if ((!isCrossDomain(objFrame)) && (objFrame.frames))
		       if (checkAnyFrameChanged(objFrame.frames))
		         return true;
		   }
		   }
		   
		   //% See if any form in the frame is changed
		   function checkFrameChanged(objFrame)
		   {
		   if (isCrossDomain(objFrame))
		     return null;
		   
		   var objForms = objFrame.document.forms;
		   if (!objForms)
		     return null;
		   
		   var retval = null;
		   for (var i=0; i < objForms.length; i++)
		   {
		     var change = checkFormChanged(objForms[i], objFrame);
		     if (change != null)
		     {
		       if (change)
		         return true;
		       retval = change;
		     }
		   }
		   //% null if we found no form with an ICChanged; else false
		   return retval;
		   }
		   
		   //% See if form changed previously or any field changed since
		   //% loaded.
		   function checkFormChanged(form, objFrame)
		   {
		   if (!form.ICChanged)
		     return null;          //% no change flag
		   if (form.ICChanged.value == "-1")
		     return false;        //% don't check
		   if (form.ICChanged.value == "1")
		     return true;          //% previous change
		   for (var j = 0; j < form.length; ++j)
		   {
		     if (isChanged(form.elements[j], objFrame))
		        return true;
		   }
		   return false;
		   }
		   
		   function ignoreChg(obj, objFrame)
		   {
		   if (obj.getAttribute == null)
		     {
		     var ignoreChgElem = null; 
		     if (objFrame != null)
		       ignoreChgElem = objFrame.ignoreChgElem;
		     if (ignoreChgElem == null)
		       return false;
		     for (var i=0; i<ignoreChgElem.length; i++)
		       if (obj.name == ignoreChgElem[i])
		         return true;
		     return false;
		     }
		   else
		     return obj.getAttribute("PSnchg");
		   }
		   
		   //% Check if various types of form fields have been changed from initial value
		   function isChanged(obj, objFrame)
		   {
		   if (obj.type == "checkbox"  || obj.type == "radio")
		     return (obj.checked != obj.defaultChecked) && !ignoreChg(obj, objFrame);
		   else if (obj.type == "select-one" && obj.selectedIndex > -1)
		     return !(obj.options[obj.selectedIndex].defaultSelected) && !ignoreChg(obj, objFrame);
		   else if (obj.type == "select-multiple")
		   {
		     for (var i =0; i < obj.options.length; ++i)
		     {
		        if (obj.options[i].defaultSelected != obj.options[i].selected)
		           return !ignoreChg(obj, objFrame);
		     }
		     return false;
		   }
		   else if (obj.type == "hidden" || obj.type == "button")
		     return false;
		   else
		     return (obj.value != obj.defaultValue) && !ignoreChg(obj, objFrame);
		   }
		   
		   var timeoutWin;
		   var timeoutWarningID;
		   var timeoutID;
		   
		   //% Mac/IE needs special version to defer setting actual timers a few
		   //% msec as a workaround for T-JLAMB-CB9L3
		   function setupTimeoutMac()  //% called from onLoad.  
		   {
		   window.setTimeout("setupTimeout();", 1000);		
		   }
		   
		   //% Set timers used for session timeout control.
		   function setupTimeout() 
		   {
		   if (totalTimeoutMilliseconds != 2073600000)
		   {
		     if (!isSessionLoggedout())
		     {
		     window.clearTimeout(timeoutWarningID);
		     window.clearTimeout(timeoutID);
		     timeoutID = window.setTimeout('displayTimeoutMsg()', totalTimeoutMilliseconds);	//% Setting up final timeout	
		     timeoutWarningID = window.setTimeout('displayTimeoutWarningMsg()', warningTimeoutMilliseconds); //% Warning timeout
		     }
		   }
		   }
		   
		   //% alert box displayed when session actually timesout.
		   function displayTimeoutMsg() 
		   {
		   timeoutMsg = "%Message(146,93,Your session has been timed out. As a security precaution, sessions are ended after )"
		       + " " + totalTimeoutMilliseconds/60000 + " " + "%Message(146,94, minutes of inactivity. )"; 
		   self.location = timeOutURL;   //% goto sign on page		
		   }
		   
		   //% timeout warning display in a new window
		   function displayTimeoutWarningMsg()                      
		   {
		   timeoutWinOption = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=330,height=220";
		   timeoutWin =window.open( timeoutWarningPageURL, "timeoutWarning", timeoutWinOption, true); 
		   timeoutWin.focus(); 
		   }
		   
		   function getForm(document,formname)
		   {
		   var objForms = document.forms;
		   if (!objForms)
		     return null;
		   
		   for (var i=0; i < objForms.length; i++)
		   {
		     if (objForms[i].name==formname)
		       return objForms[i];
		   }
		   return null;
		   }
		   
		   function getLoginCookieValue(cookiename)
		   {
		   var allcookies;
		   allcookies = document.cookie;
		   
		   if (allcookies == "")
		     return "-1";
		   
		   //% Now extract just the named cookie from that list.
		   var start = allcookies.indexOf(cookiename + '=');
		   if (start == -1) return "-1";          //% Cookie not defined for this page.
		   start += cookiename.length + 1;   //% Skip name and equals sign.
		   //%alert(" looking for " + cookiename +"  in  "+ allcookies +"  start = " + start);     
		       
		   var end = allcookies.indexOf(';', start);
		   if (end == -1) end = allcookies.length;
		   var cookieval = allcookies.substring(start, end);
		   var a = cookieval.split(' ');
		   var winhref=window.location.href;    
		   winhref=winhref.toLowerCase();
		   for(var i=0; i < a.length; i++)
		   {  
		     if (a[i].length>0)
		     {
		       var urlpath = a[i].substring(0,a[i].lastIndexOf("/"));
		       var pshome = a[i].substring(a[i].lastIndexOf("/"),a[i].length);       
		       urlpath = urlpath.toLowerCase();
		       pshome = pshome.toLowerCase();
		       if ((winhref.indexOf(urlpath) !=-1) && (winhref.indexOf(pshome) !=-1))
		          return a[i];
		     }
		   }
		   return "-1";
		   }
		   
		   function isSessionLoggedout()
		   {
		   var val =  getLoginCookieValue("PS_LOGINLIST");
		   if (val==-1)
		   {
		     self.location=timeOutURL;
		     return true;
		   }
		   return false;
		   }
		   
		   function isIE() {
		   var isIE = navigator.appVersion.indexOf("MSIE")>0;
		   return isIE;
		   }
		   
		   function isMAC() {
		   var isMAC = navigator.appVersion.indexOf("Mac")>0;
		   return isMAC;
		   }
		   
		   function addExtraParam(saveWarn,frameName,form,target,tgturl,openNewWindowOption)
		   {
		     var rtn = true;
		   
		     if (saveWarn == "Y")
		     {
		       var changed=null;
		   
		       if (form)
		         changed = checkFormChanged(form, null);
		   
		       if (changed==null && top.frames && frameName.length>0 )
		       {
		         objFrame = top.frames[frameName];
		         if (objFrame)
		           changed=checkFrameChanged(objFrame);
		       }
		   
		       if ((changed==null) && top.frames)
		         changed = checkAnyFrameChanged(top.frames);
		   
		       if (changed)
		         rtn = !confirm("%Message(124,202,You have unsaved data on this page. Click OK to go back and save the information, or Cancel to continue.)");
		   
		       if (!tgturl)
		         return rtn;           //% just tell caller if changed/confirmed
		     }
		     
		     if (rtn)
		     {
		       var newurl = "";
		       if (typeof URLIntercept == "function"){
		         newurl = URLIntercept(tgturl,target);
		         if (newurl == "") 
		           return;  
		         else
		           tgturl = newurl;  
		         }  
		         // open(tgturl, target);
		         open(tgturl, target, ((target.toLowerCase() == '_blank') ? openNewWindowOption : ''));
		     }
}