var bPageIsLoaded = false;

function setCookie(sName, sValue, sExpire)
{
var sCookie = sName + "=" + escape(sValue) +"; path=/";	
if (sExpire)
	{
	sCookie += "; expires=" + sExpire.toGMTString();	
	}
document.cookie = sCookie;					
return null;
}

function getCookie(sName)
{
var sCookiecrumbs = document.cookie.split("; "); 	
var sNextcrumb
for (var i=0; i < sCookiecrumbs.length; i++)
	{
	sNextcrumb = sCookiecrumbs[i].split("=");	
	if (sNextcrumb[0] == sName)			
	    {
	     return unescape(sNextcrumb[1]); 		
	    }
	}
	return null;
}

function saveReferrer()
{
	if (window.name == 'ActPopup') return;
var bSetCookie = false;
if (parent.frames.length == 0)					
		{
		bSetCookie = true;
		}
else														
		{
		var bCatalogFrameSet = false;
		for (var nFrameId = parent.frames.length; nFrameId > 0; nFrameId--)
			{
			if (parent.frames[nFrameId - 1].name == 'CatalogBody')	
				{
				bCatalogFrameSet = true;
				break;
				}
			}
		if (bCatalogFrameSet)							
			{
			if (window.name=='CatalogBody')			
				{
				bSetCookie = true;
				}
			}
		else													
			{
			bSetCookie = true;
			}
		}
if (bSetCookie)
		{
		var sUrl = document.URL;
		var nHashPos = sUrl.lastIndexOf("#");		
		if (nHashPos > 0)									
		    {
		    sUrl = sUrl.substring(0,nHashPos);		
		    }
		setCookie("ACTINIC_REFERRER", sUrl);		
		}
	    return null;
	    }

function CreateArray(n)
	{
	this.length = n;
	for (var i=1; i <= n; i++)							
		{
		this[i] = new Section();						
		}
	return this;											
	}

function Section()
	{
	this.sURL = null;
	this.sName = null;
	this.sImage = null;
	this.nImageWidth = null;
	this.nImageHeight= null;
	this.nSectionId	= null;
	this.pChild = null;
	}
	
function SwapImage(sName, sAltImage)
	{
	var nCount = 0;
	document.aSource = new Array;						
	if (document[sName] != null)						
		{
		document.aSource[nCount++] = document[sName];	
		if(null == document[sName].sOldSrc)
			{
			document[sName].sOldSrc = document[sName].src;	
			}
		document[sName].src = sAltImage;				
		}
	}

function RestoreImage()
	{
	var nCount, aSource = document.aSource;
	if (aSource != null)									
		{
		for(nCount=0; nCount < aSource.length; nCount++)	
			{
			if ((aSource[nCount] != null) &&
				(aSource[nCount].sOldSrc != null))	
				{
				aSource[nCount].src = aSource[nCount].sOldSrc;	
				}
			}
		}
	}

function PreloadImages()
	{
	bPageIsLoaded = true;
	if(document.images)
		{
		if(!document.Preloaded)							
			{
			document.Preloaded = new Array();		
			}
		var nCounter , nLen = document.Preloaded.length, saArguments = PreloadImages.arguments;
		for(nCounter = 0; nCounter < saArguments.length; nCounter++)	
			{
			document.Preloaded[nLen] = new Image;
			document.Preloaded[nLen++].src = saArguments[nCounter];
			}
	}
	}
	

function ShowPopUp(sUrl, nWidth, nHeight)
	{
	window.open(sUrl, 'ActPopup', 'width=' + nWidth + ',height=' + nHeight + ',scrollbars, resizable');
	if (!bPageIsLoaded)
		{
		window.location.reload(true);
		}
	}

function DecodeMail()
	{
	var nIdx = 0;
	for( ; nIdx < document.links.length; nIdx++ )
		if ( document.links[ nIdx ].name == "contactus" )
		{
		var sOldRef = document.links[ nIdx ].href;

		while( sOldRef.indexOf( " [dot] " ) != -1 )
			sOldRef = sOldRef.replace( " [dot] ", "." );
			
		while( sOldRef.indexOf( " [at] " ) != -1 )
			sOldRef = sOldRef.replace( " [at] ", "@" );
			
		document.links[ nIdx ].href = sOldRef;
		}
	}

function HtmlInclude()
	{
	var req;
	
	
	
	if (typeof(XMLHttpRequest) == "undefined") 	
		{
		try
			{
			req = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch(e)
			{
			try
				{
				req = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch(e) 										
				{
				return; 										
				}
			}
		}
	else 														
		{
		req = new XMLHttpRequest();
		}
	
	
	
	var tags = document.getElementsByTagName("A");
	var i;
	for (i = 0; i < tags.length; i++)
		{
		
		
		
		if (tags[i].getAttribute("rel") == "fragment")
			{
			try
				{
				
				
				
				req.open('GET', tags[i].getAttribute("href"), false);
				if (document.characterSet)
					{
					req.overrideMimeType("text/html; charset=" + document.characterSet);
					}
				req.send(null);
				if (req.status == 200) 					
					{
					
					
					
					var span = document.createElement("SPAN");
					span.innerHTML = req.responseText;
					tags[i].parentNode.replaceChild(span, tags[i]);
					}
				}
			catch(e)											
				{
				return;										
				}
			}
		}
	}

if (window.attachEvent) 								
	{
	window.attachEvent("onload", HtmlInclude);
	}
else 															
	{
	window.addEventListener("load", HtmlInclude, false);
	}