function GotoCatalogPage(page,params) 
{
	if (params != "" ) 
	{
		newwindow=window.open(page +"?" + params,'product','toolbar=yes,location=yes,menubar=yes,scrollbars=yes,resizable=yes,height=520,width=780');
		//self.location = page +"?" + params;
	}
	return;
}

function DD_findObj(n, d) { //v3.0
  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=DD_findObj(n,d.layers[i].document); return x;
}
function DD_swapImage() { //v3.0
  var i,j=0,x,a=DD_swapImage.arguments; document.DD_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=DD_findObj(a[i]))!=null){document.DD_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function DD_swapImgRestore() { //v3.0
  var i,x,a=document.DD_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function getCookie(name) {
  var cookies = document.cookie;
  var start = cookies.indexOf(name + '=');
  if (start == -1) return null;
  var len = start + name.length + 1;
  var end = cookies.indexOf(';',len);
  if (end == -1) end = cookies.length;
  return unescape(cookies.substring(len,end));
}

function setCookie(name, value, expires, path, domain, secure) {
  value = escape(value);
  expires = (expires) ? ';expires=' + expires.toGMTString() :'';
  path    = (path)    ? ';path='    + path                  :'';
  domain  = (domain)  ? ';domain='  + domain                :'';
  secure  = (secure)  ? ';secure'                           :'';

  document.cookie =
    name + '=' + value + expires + path + domain + secure;
}

function deleteCookie(name, path, domain) 
{
  var expires = ';expires=Thu, 01-Jan-70 00:00:01 GMT';

  (path != '') ? path=';path=' + path : path='';
  (domain != '') ? domain=';domain='  + domain : domain='';

  if (getCookie(name))
    document.cookie = name + '=' + expires + path + domain;
}

function isCookieEnabled() {
  if (!document.all) {
    if (!navigator.cookieEnabled) {
      alert('Please enable cookies.  This web site requires the use of cookies!');
      location.href='/Leextranet/NeedCookies.html';
      return false;
    }
    else return true;
  }
  else {
    setCookie('temp','tempValue');
    var temp = getCookie('temp');
    if (!temp) {
      alert('Please enable cookies.  This web site requires the use of cookies!');
      location.href='/Leextranet/NeedCookies.html';
      return false;
    }
    else return true;
  }
}

//Functions to build popup to warn about session ending.
function executeWarnTimer(strMessage, strImageDirSource) 
{
	var strHead;
	var strFoot;
	var output = '';

	strHead = getHeaderPortion(strImageDirSource);
	strFoot = getFooterPortion(strImageDirSource);

	output = strHead + strMessage + ':<br/>&nbsp;' + endTime + strFoot;
	openWindow();
	outputContent(output);
}

function openWindow() 
{
    myWindow = window.open('/Global/sessWarn.htm','myLincolnElectricSessionStatus','width=350,height=200');

    if (!myWindow.opener)
        myWindow.opener = self;
}

function outputContent(output) 
{
	/*
	try {
		myWindow.document.open('text/html');
		myWindow.document.write(output);
		myWindow.document.close();
	} catch (e) {
		myWindow.close();
	}
	*/
	
	if(myWindow)
	{
		myWindow.document.open('text/html');
		myWindow.document.write(output);
		myWindow.document.close();	
	}
	
	return;
}

function getHeaderPortion(strImageDirName)
{
	var strHead = new String("<html>");
	strHead += "<head>";
	strHead += "<link TYPE='text/css' HREF='/Global/include/css/master2.css' REL='stylesheet'>";
	strHead += "<script language='JavaScript1.3' src='/Global/Include/scripts/scripts.js'></script>";
	strHead += "<title>Session Timeout Warning</title>";
	strHead += "</head>";
	strHead += "	<body bgcolor='#FFFFFF' text='#000000' link='#FF0000' vlink='#FF0000' alink='#990000' leftmargin='0' topmargin='0' marginheight='0' marginwidth='0'>";
	strHead += "		<p>";
	strHead += "		<table border='0' height='200' width='350' cellspacing='1' cellpadding='1' bgcolor='#FFFFFF' bordercolor='#FF00FF'>";
	strHead += "			<tr>";
	strHead += "				<td>&nbsp;<img src='" + strImageDirName + "global/logo.jpg' width='166' height='79'></td>";
	strHead += "				<td class='title-sm'>&nbsp;myLincolnElectric.com</td>";
	strHead += "			</tr>";
	strHead += "			<tr>";
	strHead += "				<td colspan='2' class='fielddetail2'>&nbsp;<b><u>WARNING:</U></b></td>";
	strHead += "			</tr>";
	strHead += "			<tr>";
	strHead += "				<td colspan='2' class='leftnavtext'>&nbsp;Your session ";

	return strHead.toString();
}

function getFooterPortion(strImageDirName)
{
	var strFoot = new String(" </td>");
	strFoot += "			</tr>";
	strFoot += "			<tr>";
	strFoot += "				<td colspan='2' align='right'><a href='javascript:window.close()' border='0'><img src='" + strImageDirName + "buttons/a_button_close.gif' width='48' height='17' border='0'></a>&nbsp;&nbsp;</td>";
	strFoot += "			</tr>";
	strFoot += "		</table>";	
	strFoot += "		</p>";
	strFoot += "	</body>";
	strFoot += "</html>";
	
	return strFoot.toString();

}

function buildPrinterFriendlyPage() {
	//by using print.css we can now use the normal print function.
	window.print();
}
