function brand(guid,name,url,vbw_translate,locale,wtb_translate,sap_translate,gvd_translate,newWindow,endecaID,hasAssets)
{
	this.guid = guid;
	this.name = name;
	this.url = url;
	this.vbw_translate = vbw_translate;
	this.locale = locale;
	this.wtb_translate = wtb_translate;
	this.sap_translate = sap_translate;
	this.gvd_translate = gvd_translate;
	this.newWindow = newWindow;
	this.endecaID = endecaID;
	this.hasAssets = hasAssets;
}	


function ShowBrandInfoPopUp(obj)
{
	/* get Window size */
	var myWindow = getWindowSize();
	
	/* Get Popup */
	var PopUp = document.getElementById("Brand_Info_Popup");
	
	/* get Link location */
	var obj_coords = FindPosition(obj);
	obj_coords.X = obj_coords.X - (myWindow.width * .11 ) //130; //adj position
	if (obj_coords.X < 0) {
		//alert(obj_coords.X);
		obj_coords.X = 13;
	}
	/* Hide PopUp */
	PopUp.style.display = 'none'; 	
	
	/* Update PopUp info */
	if(aBrands)
	{
		/* if url exists put in url and translation copy */
		if(aBrands[obj.id].url == ""){
			var thisListLink = ""
		}else{
			var thisListLink = "<li><a href='" + aBrands[obj.id].url + "' class='hglt'>" + aBrands[obj.id].vbw_translate + "</a></li>"
			if(aBrands[obj.id].newWindow == "1")
				thisListLink = "<li><a href='" + aBrands[obj.id].url + "' class='hglt' target='_blank'>" + aBrands[obj.id].vbw_translate + "</a></li>"
		}
		if(aBrands[obj.id].hasAssets == 0){
			var thisAssetLink = ""
		}else{
			var thisAssetLink = "<li class='last'><a href='/" + aBrands[obj.id].locale + "/play/browse.cfm?N=64+" + aBrands[obj.id].endecaID + "&Ntk=All&Ntx=mode+matchallpartial' class='hglt'>" + aBrands[obj.id].gvd_translate + "</a></li>"
		}
				
		/* The id of the link (obj) is the id for the aBrands list */		
		PopUp.innerHTML = 		
			"<h3>" + aBrands[obj.id].name + "</h3><a href='javascript:;' onClick='HideBrandInfoPopUp(this)' class='hsb_ol_close'><img src='/images/shop/shop_bl_close.gif' alt='X' title='X' /></a><div class='hsb_ol_no_thumb_bg'><ul class='col_1'> " + thisListLink + " <li><a href='/" + aBrands[obj.id].locale + "/shop/where-to-buy.cfm?brand_guid=" + aBrands[obj.id].guid + "' class='hglt'>" + aBrands[obj.id].wtb_translate + "</a></li><li class='last'><a href='/" + aBrands[obj.id].locale + "/shop/browse.cfm?N=63+"+aBrands[obj.id].endecaID+"&Ntk=All&Ntx=mode+matchallpartial' class='hglt'>" + aBrands[obj.id].sap_translate + "</a></li>" + thisAssetLink + "</ul><div class='hsb_spacer'></div></div>"		
		/*<!---<li><a href='" + catalog_url +"' class='hglt'>See All" + brand_name +"Products</a></li>--->*/		
	}	
	
	/* set Popup location */
	PopUp.style.position = 'absolute'; 
	PopUp.style.left = obj_coords.X + "px"; 
	PopUp.style.top = obj_coords.Y + "px"; 	
		
	/* Show PopUp */
	PopUp.style.display = 'block'; 
}

function HideBrandInfoPopUp()
{
	var PopUp = document.getElementById("Brand_Info_Popup");
	PopUp.style.display = 'none'; 	
}

function coordinates(X,Y)
{
	this.X = X;
	this.Y = Y;
}

function windowSize(width,height)
{
	this.width = width;
	this.height = height;
}

function FindPosition(obj)
{
	var MyCoords = new coordinates(findPosX(obj),findPosY(obj));
	return MyCoords;
}

function findPosX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
			while(1) 
			{
				curleft += obj.offsetLeft;
				if(!obj.offsetParent)
					break;
				obj = obj.offsetParent;
			}
	else if(obj.x)
			curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
			while(1)
			{
				curtop += obj.offsetTop;
				if(!obj.offsetParent)
					break;
				obj = obj.offsetParent;
			}
	else if(obj.y)
			curtop += obj.y;
	return curtop;
}


function getWindowSize() {
  var myWidth = 0, myHeight = 0;

	
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
	
 var myWindow = new windowSize(myWidth,myHeight)
 return myWindow;
}


function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;

if (level > 0)
{
	return dumped_text;
}
//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += "    ";

if(typeof(arr) == 'object') { //Array/Hashes/Objects
 for(var item in arr) {
  var value = arr[item];
 
  if(typeof(value) == 'object') { //If it is an array,
   dumped_text += level_padding + "'" + item + "' ...\n";
   dumped_text += dump(value,level+1);
  } else {
   dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
  }
 }
} else { //Stings/Chars/Numbers etc.
 dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}
return dumped_text;
} 
