//sends NS6 to splash page to set cookie to fix history.back() bug.
function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0
  var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
  if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
  } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}

//sets cookie 'FittingRoom" to null so fitting room css not retained.
function QF_SetFittingRoom(d, theStyle) { //v1.7 by PVII 'P7_setCSS'
  var expDays=parseInt(d),path = "/";
  var expdate = new Date();
  expdate.setTime(expdate.getTime() + (expDays*24*60*60*1000));
  document.cookie = "QF_FittingRoom=" + escape (theStyle) + "; expires=" + expdate.toGMTString() +'; path=' + path;
}

//sets cookie to default lg/sm text preference to small & reveals lg/sm button div's
function QF_SetTextSize(d, theStyle) { //v1.7 by PVII 'P7_setCSS'
  var expDays=parseInt(d),path = "/";
  var expdate = new Date();
  expdate.setTime(expdate.getTime() + (expDays*24*60*60*1000));
  document.cookie = "QF_TextSize=" + escape (theStyle) + "; expires=" + expdate.toGMTString() +'; path=' + path;
}

function MM_findObj(n, d) { //v4.01
  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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function popcenter(center, top, left, height, width, name, winName) {

var LeftPos;
var TopPos;

if(center)
	{
	if ((screen.height - height) > 0)
		{
		TopPos = (screen.height - height)/2;

		}
		else
		{
		TopPos = 0;
		}
	if ((screen.width - width) > 0)
		{
		LeftPos = (screen.width - width)/2;
		}
		else
		{
		LeftPos = 0;
		}
	}
else
	{
	if ((screen.height - height) > 0)
		{
		TopPos = top;
		}
		else
		{
		TopPos = 0;
		}
	if ((screen.width - width) > 0)
		{
		LeftPos = left;
		}
		else
		{
		LeftPos = 0;
		}
	}

  popupWin = window.open(name, winName,'menubar=0,status=1,toolbar=0,location=0,resizable=1,scrollbars=0,width=' + width +',height=' + height  +',top= ' + TopPos + ',left= ' + LeftPos)
  popupWin.focus()
}

//pops center WITH nav bar.
function popcenterNAV(center, top, left, height, width, name, winName) {

var LeftPos;
var TopPos;

if(center)
	{
	if ((screen.height - height) > 0)
		{
		TopPos = (screen.height - height)/2;

		}
		else
		{
		TopPos = 0;
		}
	if ((screen.width - width) > 0)
		{
		LeftPos = (screen.width - width)/2;
		}
		else
		{
		LeftPos = 0;
		}
	}
else
	{
	if ((screen.height - height) > 0)
		{
		TopPos = top;
		}
		else
		{
		TopPos = 0;
		}
	if ((screen.width - width) > 0)
		{
		LeftPos = left;
		}
		else
		{
		LeftPos = 0;
		}
	}

  popupWin = window.open(name, winName,'menubar=0,status=1,toolbar=1,location=0,resizable=1,scrollbars=0,width=' + width +',height=' + height  +',top= ' + TopPos + ',left= ' + LeftPos)
  popupWin.focus()
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

