function Div(divId)

{	this.id = divId;

	this.alias = (document.getElementById) ? document.getElementById(this.id).id 

		: (document.layers) ? findLayerAlias(this.id) : new String("document.all." + this.id);

	this.styleAlias = (document.getElementById || document.all) ? this.alias + ".style" : this.alias;

	this.documentObject = (document.getElementById) ? document.getElementById(this.id) : eval(this.alias);

	this.styleObject = (document.getElementById) ? this.documentObject.style : eval(this.styleAlias);

		

	// for Netscape 4.x: finds a nested layer object		

	function findLayerAlias(name, docAlias) 

	{	var i, layer, docLayers, layerAlias;

		if(!docAlias) docAlias = "document";

		docLayers = eval(docAlias + ".layers");

		for(i = 0; i < docLayers.length; i++) 

		{	layerAlias = docAlias + ".layers." + docLayers[i].name;

			layer = eval(layerAlias);

			if(layer.name == name) return layerAlias;

			if(layer.document.layers.length > 0) 

			{	layerAlias = findLayerAlias(name, layerAlias + ".document");

				if(layerAlias != null) return layerAlias;

			}

		}

		return null;

	}

	

	return this;

}




Div.prototype.setZIndex = function(z)

{	if(!isNaN(z)) this.styleObject.zIndex = z;

}


Div.prototype.getImage = function(imgName)

{	imgArray = (document.getElementById || document.all) ? document.images : this.documentObject.document.images;

	return (imgArray != null && imgArray.length > 0) ? imgArray[imgName] : null;

}

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)

	{	lastSlash = img.src.lastIndexOf("/");

		if(lastSlash == -1) lastSlash = 0;

		
		lastDot = img.src.lastIndexOf(".");

		if(lastDot == -1) lastDot = img.src.length;

		

		imgLoc = (lastSlash > 0) ? img.src.substring(0, lastSlash + 1) : new String("");

		baseName = img.src.substring(lastSlash + 1, lastDot);

		ext = img.src.substring(lastDot, img.src.length);


		// fix for old _off naming

		offIndex = baseName.lastIndexOf("_off");

		if(offIndex != -1) baseName = baseName.substring(0, offIndex);

		
		
		img.off = new Image();

		img.off.src = img.src;
		
		img.over = new Image();
		//here
		img.over.src = imgLoc + baseName + "_over" + ext;


		 
		//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)

{	img = this.getImage(strName);

	if(img && img != null && this.ready && !img.locked) img.src = img.off.src;

}



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);

}


RolloverEngine.prototype.lock = function(strName)

{	img = RolloverEngine.images[strName];

	if(img && img != null) img.locked = true;

}



RolloverEngine.prototype.lockAll = function()

{	for(i = 0; i < RolloverEngine.images.countImages(); i++)

	{	RolloverEngine.images.imageAt(i).locked = true;

	}

}



RolloverEngine.prototype.unlock = function(strName)

{	img = RolloverEngine.images[strName];

	if(img && img != null) img.locked = false;

}



RolloverEngine.prototype.unlockAll = function()

{	for(j = 0; j < RolloverEngine.images.countImages(); j++)

	{	RolloverEngine.images.imageAt(j).locked = false;

	}

}



RolloverEngine.prototype.isLocked = function(strName)

{	img = RolloverEngine.images[strName];

	return (img && img != null && img.locked && img.locked == true);

}



RolloverEngine.prototype.setSrc = function(strName, path)

{		 img = this.getImage(strName);

		 if(img && img != null && this.ready) img.src = path;

}



RolloverEngine.prototype.getSrc = function(strName)

{		 img = this.getImage(strName);

		 return img.src;

}



RolloverEngine.prototype.toString = function()

{	return "[object RolloverEngine]";

}



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;");

	}

}



ImageCollection.prototype.imageAt = function(index)

{	return (index >= 0 && index < this.images.length) ? this.images[index] : null;

}



ImageCollection.prototype.countImages = function()

{	return this.images.length;

}



ImageCollection.prototype.toString = function()

{	return "[object ImageCollection]";

}

//var retailerName = "This is My Retailer Name";
// browser checks 

 var ns = (document.layers) ? 1:0;

 var ns6 = (document.sidebar) ? 1:0;

 var ie = (document.all && (ns6 == 0)) ? 1:0;

function handleResize() {
    if (!ie) {
        history.go(0)
    }
}

 if (ns) {
           widthCheck = window.innerWidth
           heightCheck = window.innerHeight
           window.onResize = resizeFix
        }
        function resizeFix() {
                if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
                document.location.href = document.location.href
        }
		
 var re;

 function gnavinit() {	
        re = new RolloverEngine();
}

 function mgnavinit() {	
        re = new RolloverEngine();
}


// error handling. if user interacts before page is fully loaded.

 window.onerror = CHANELerror;

 function CHANELerror() {
   return true;
  }
    // declarations and functionality

	var chmcboxac;

	var chmcboxbc;

	var chmcboxcc;

	var chmcboxdc;

	var chmcboxec;

	var chlastBox;



function init() {

	//re = new RolloverEngine();

 //chmcboxe = new Div("chmcboxe");

	chmcboxac = new Div("chmcboxac");

	chmcboxbc = new Div("chmcboxbc");

	chmcboxcc = new Div("chmcboxcc");

	chmcboxdc = new Div("chmcboxdc");

	//chmcboxec = new Div("chmcboxec");

	gnavinit();

}	



// roolver functionality for boxes.

function chmcboxOff(whichBox) {

	chmcboxOn('a', 0, 1);

	chmcboxOn('b', 0, 1);

  	chmcboxOn('c', 0, 1);

  	chmcboxOn('d', 0, 1);

	//chmcboxOn('e', 0, 1);

  	if (whichBox) { 	chmcboxOn(whichBox, 1); }

	

}



function chmcboxOn(whichBox, whichState, fromboxoff) {

if (chmcboxa) {

	if (whichState) {

	    if (whichBox == chlastBox) { 

		    return; 

		    } else { 

		   eval('chmcbox'+whichBox+'.setZIndex(4);');

		   eval('chmcbox'+whichBox+'c.setZIndex(5);');

		}

	} else {

  	 if (whichBox == chlastBox) { 

		    return; 

		    } else { 

		eval('chmcbox'+whichBox+'.setZIndex(5);');

		eval('chmcbox'+whichBox+'c.setZIndex(4);');

	  }

	}

                if (fromboxoff == 0) {

	   chlastBox = whichBox;

	}

}
}
function print_map(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(page,name,args);
}


