var ns = (document.layers) ? 1:0;
var ns6 = (document.sidebar) ? 1:0;
var agt=navigator.userAgent.toLowerCase();
var is_ie=(agt.indexOf("msie")!=-1);
var is_net=(agt.indexOf("mozilla/5")!=-1);
var is_mac = agt.indexOf("Mac")>-1;

if(is_ie || is_net) {
var ie=true;
}   
 if (ns) {
           widthCheck = window.innerWidth
           heightCheck = window.innerHeight
           window.onResize = resizeFix
        }

function opnPop(mypage)
{
    if (is_ie && ! is_mac)
        {
            if (typeof win == "undefined")
                 window.open(mypage,'','fullscreen=1');
        }
        else
        var win=window.open(mypage,'ahs','width='+screen.width+',height='+screen.height+',top=0,left=0');
}


function resizeFix() {
                if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
                document.location.href = document.location.href
        }



function RolloverEngine(pat){


	if(pat && pat != null)

		this.pattern = (typeof pat == "string") ? new RegExp(pat) : pat;

	else this.pattern = null;



	RolloverEngine.images = new ImageCollection();

	this.ready = false;

	this.findImages();

	this.ready = true;

	return this;

}



RolloverEngine.prototype.findImages = function(doc)

{	if(!doc) doc = window.document;



	if(doc.images.length > 0)

	{	var img, a, b;

		for(a = 0; a < doc.images.length; a++)

		{	img = doc.images[a];

			if(img.name)

			{	if(this.pattern == null || this.pattern.test(img.name))

					this.loadImage(img);

			}

		}

	}

	if(doc.layers && doc.layers != null)

	{	if(doc.layers.length > 0)

		{	for(b = 0; b < doc.layers.length; b++)

			{	this.findImages(doc.layers[b].document);

			}

		}

	}

}



RolloverEngine.prototype.loadImage = function(img)

{

if(img && img != null && img.src)

	{

		img.over = new Image();

		img.over.src = img.src.replace('_off', '_over');

		//alert(img.over.src);

		RolloverEngine.images.addImage(img);


		/*var strretailer = chaneljssvr;

		if (img.src.lastIndexOf(strretailer) != -1) {

		RolloverEngine.images.addImage(img);
		}
		*/
	}

}



RolloverEngine.prototype.containsImage = function(strName)

{	return (strName && strName != null) ? (RolloverEngine.images[strName] && RolloverEngine.images[strName] != null) : false;

}



RolloverEngine.prototype.getImage = function(strName)

{
return (this.containsImage(strName)) ? RolloverEngine.images[strName] : null;

}



RolloverEngine.prototype.setOff = function(strName)

{
if(img && img != null && this.ready && !img.locked) img.src = img.over.src.replace('_over', '_off');

}

RolloverEngine.prototype.setOver = function(strName)

{

	img = this.getImage(strName);

	if(img && img != null && this.ready && !img.locked) img.src = img.over.src;

}


RolloverEngine.prototype.isOver = function(strName)

{	img = RolloverEngine.images[strName];

	return (img && img != null && img.src == img.over.src);

}


function ImageCollection()

{	this.images = new Array();

}

ImageCollection.prototype.addImage = function(img)

{	if(img && img != null && img.name)

	{	this.images[this.images.length++] = img;

		eval("this." + img.name + " = img;");

	}

}


function setgnavstate() {

  eval("re.setOver('chgi"+chsetdefgnav+"');");

  if (chsetdefgnavdiv) {

  eval("re.setOver('chgi"+chsetdefgnavdiv+"');");

  }

}

function gnavinit() {

      re = new RolloverEngine();

	setgnavstate();
}

if(!document.re) { re = new RolloverEngine();

}

function chopenwinbig(page, name, w, h, c) {

   xposition=0; yposition=0;



    if ((parseInt(navigator.appVersion) >= 4 ) && (c)){

        xposition = (screen.width - w) / 2;

        yposition = (screen.height - h) / 2;

    }



   if (ns6) { h = h - 10; }



    args = "width=" + w + "," 

    + "height=" + h + "," 

    + "location=0," 

    + "menubar=0,"

    + "resizable=0,"

    + "scrollbars=1,"

    + "status=0," 

    + "titlebar=0,"

    + "toolbar=0,"

    + "hotkeys=0,"

    + "screenx=" + xposition + "," 

    + "screeny=" + yposition + ","  

    + "left=" + xposition + ","     

    + "top=" + yposition;       


 if (ns) {  args = args + ", alwaysRaised, dependent";  };    
    window.open(wsmlMakeResourceUrl(page),name,args);



}
// Precision Specific JavaScript Document

var precisionWin=0;

function openPrecisionWindow(URLStr, left, top, width, height)
{
  if(precisionWin)
  {
    if(!precisionWin.closed) precisionWin.close();
  }
  precisionWin = open(URLStr, 'precisionWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  precisionWin.focus();
}
