var co_name = 'Sleepover';
var pageId = '1';
alertConfig = { defaultHeaders : false, cssButtons : false, useIcons : false, leftFillHeader : false, printButton : false }

// -------------------- web site functions
function saveWallp(el) {
  if (typeof(el) == 'string') {
    var id = el;  // used for home page fader
  } else {
    var id = el.getAttribute('data-id');
  }
  id = id.replace('-extra','');
  setCookie('wallp',id);
}
function setWallp() {
  var wid = getCookie('wallp');
  if (thisPageId && thisPageId != '<elucid_pageid_placeholder>') { wid = thisPageId; }
  if (wid) {
    pageId = wid;
//    document.body.style.backgroundImage = 'url('+thisUrl+'assets/images/lifestyle/'+wid+'-back.jpg)';
//alert(document.body.style.backgroundImage);
  }
}
var menuTimer = null;
var menuTId = '';
var menuCaller = null;
var menuJustify = '';
function onMenuTimer() {
  if (menuTId) {
    var el = document.getElementById(menuTId);
    if (el) {
      if (window.imgtrans1) {
//        if (!isIE()) { imgtrans1.stop(); }
      }
      el.style.zIndex = '2000';
      el.style.display = 'block';
      if (menuCaller) {
        if (menuJustify == 'R') {
          el.style.left = (menuCaller.offsetLeft + menuCaller.offsetWidth - el.offsetWidth- 2) + 'px';
        } else {
          el.style.left = menuCaller.offsetLeft + 'px';
        }
      }
      hideSelects();
    }
  }
}
function delayMenu(id,caller,justify) {
  clearTimeout(menuTimer);
  menuTId = id;
  menuCaller = caller;
  menuJustify = justify;
  menuTimer = setTimeout( 'onMenuTimer()', 200 );
}

function hideMenu(ev) {
  clearTimeout(menuTimer);
  if (!ev) var ev = window.event;
	 var t = ev.relatedTarget || ev.toElement;

  if (t && menuTId) {
    var gone = true; var checked = false;
    if (t.parentElement) {
      checked = true;
   			while (t && t.parentElement != null) {
   //alert(t.tagName+' '+t.className);
   			 if (t == menuCaller) { gone = false; }
   				t = t.parentElement;
   			}
   	} else if (t.parentNode) {
      checked = true;
   			while (t && t.parentNode != null) {
   			 if (t == menuCaller) { gone = false; }
   				t = t.parentNode;
   			}
   	}

    if (gone && checked && menuTId) {
      var el = document.getElementById(menuTId);
      if (el) { el.style.display = 'none'; menuTId = '';}
      if (window.imgtrans1) {
//        if (!isIE()) { imgtrans1.restart(); }
      }
    }
  }
  showSelects();
}

function initCatDivs() {
  var area = document.getElementById('catDivArea');
  if (area) {
    var catDiv = document.getElementById('catDiv_holder');
    if (catDiv) {
      var tmp = catDiv.innerHTML;
      // remove <!-- and --> from around the template
      tmp = tmp.replace('<!--','');
      tmp = tmp.replace('-->','');
      var s = '';
      var lm = document.getElementById('leftMenu');
      if (lm) {
        var pid = pageId;
        if (pid.indexOf('_') > 0) { pid = pid.substr(0,pid.indexOf('_')); }
        var lia = lm.getElementsByTagName("LI");
        for (var i=0; i < lia.length; i++ ) {
          var id = lia[i].getAttribute('data-id');
          if (id == pid) {
            var sma = lia[i].getElementsByTagName("A");
            for (var j=0; j < sma.length; j++ ) {
              if (sma[j].className.indexOf('toponly') < 0) {
                var txt = sma[j].innerHTML;
                var txt = txt.replace(/&amp;/g,'');
                var img = txt.replace(/[ &]/g,'');
                var link = sma[j].href;
                var linka = link.split(delim404);
                var code = linka[linka.length-1]
                var tmp1=tmp;
                tmp1 = tmp1.replace(/<xx_catimg>/g, img);
                tmp1 = tmp1.replace(/<xx_catname>/g, txt);
                tmp1 = tmp1.replace(/<xx_catcode>/g, code);
                tmp1 = tmp1.replace(/<xx_cathref>/g, link);
                s+= tmp1;
              }
            }
          }
        }
      }
      area.innerHTML = s;
    }
  }
}

var imgno = 0;
var showNoReview = true;
function setReviewStars() {
  var star_gap = 2;  // the gap between individual stars in the image
  var imgs = document.getElementsByTagName ('img');
  if (imgs) {
    for (var i = 0; i < imgs.length; ++i) {
      var stars = imgs[i].getAttribute('data-stars');
      if (stars) {
        var sta = stars.split('/');
        if (sta[0] === '' || sta[0] == undefined || sta[0] == '<elucid_rating>' || typeof(sta[0]-0) != 'number') {
          if (showNoReview && (sta[0] == '')) {
            imgs[i].setAttribute('title', 'No reviews');
            imgs[i].style.display = 'block';
          }
        } else {
          imgs[i].style.display = 'block';

          var ovl = imgs[i].getAttribute('data-ovl');
          if (ovl) {
            var div = document.getElementById(ovl);
            var w = imgs[i].getAttribute('data-wid');
          } else {
            imgno++;
            var id = 'star'+imgno;
            var div = document.createElement('div');
            div.setAttribute('id', id);
            div.setAttribute('name', id);
            div.setAttribute('className', 'reviewstars_overlay');
            div.setAttribute('class', 'reviewstars_overlay');
            div.setAttribute('title', imgs[i].getAttribute('title'));
            imgs[i].parentNode.appendChild(div);
            div.style.display = 'block';
            div.style.left = (div.offsetLeft + imgs[i].offsetLeft) + 'px';
            div.style.top = (div.offsetTop + imgs[i].offsetTop) +'px' ;
            div.innerHTML = ' ';
            imgs[i].setAttribute('data-ovl',id);
            var w = cssStyle(div,'width');
            imgs[i].setAttribute('data-wid',w);
          }
//          sta[0] = '4.9';
            var w1 = Math.round((w - (4*star_gap)) * sta[0] / sta[1] + (Math.floor(sta[0]) * star_gap));
            if (typeof(w1) == 'number' && !isNaN(w1)) { div.style.width = (w1) + 'px'; }
        }
      }
    }
  }
}

/*
var bigpicInitSize = { w:0, h:0 }
var bigpicImage = null;
var bigpicName = 'bigImage';
//
function printbigpic() {
  printDiv(bigpicName+'Img');
}
function initBigImage(sub) {
  // switch the look of the box for the large map image
  if (sub == -4) { bigpicName = 'mapImage'; } else { bigpicName = 'bigImage'; }
  var div = createDynamicPopup(bigpicName);
  var s = '';
  s+='<div id="'+bigpicName+'Head"></div>';
  s+='<img id="'+bigpicName+'PrintBtn" src="'+thisUrl+'assets/images/popupprint.jpg" alt="print" title="print" onclick="printbigpic();"/>';
  s+='<img id="'+bigpicName+'CloseBtn" src="'+thisUrl+'assets/images/popupclose.jpg" alt="close" title="close" />';
  s+='<div id="'+bigpicName+'Img"><img id="'+bigpicName+'ImgImage" onerror="imageErr(this,\'zoom\')" /></div>';
  div.innerHTML = s;
  var el = document.getElementById('bigImageHead');
  if (el) { dhBig = DragHandler.attach(el,div); } // make it draggable on the header
}
function bigPicClose() {
  hideShadowBox();
  var el = document.getElementById(bigpicName);
  if (el) { el.style.display='none'; }
}
function bigpicLoaded() {
  var div = document.getElementById(bigpicName);
  var im = document.getElementById(bigpicName+'ImgImage');
  var el = bigpicImage;
//alert(el.width+' '+el.height+' '+bigpicInitSize.wi+' '+bigpicInitSize.hi+' '+bigpicInitSize.w)
  if (el.width != bigpicInitSize.wi || el.height != bigpicInitSize.hi) {
    var x = xOnPage(0,el.width+bigpicInitSize.wx,true);
    var y = yOnPage(0,el.height+bigpicInitSize.hx,true);

    var w = el.width; var h = el.height;
    var ss = screenSize();
    if (w > ss.w-bigpicInitSize.wx-16) { w = ss.w-bigpicInitSize.wx-16; }
    if (h > ss.h-bigpicInitSize.hx-16) { h = ss.h-bigpicInitSize.hx-16; }
    bigpicInitSize.innerDiv.style.width = w+'px';
    bigpicInitSize.innerDiv.style.height = h+'px';
    div.style.width = w+bigpicInitSize.wx+'px';
    div.style.height = h+bigpicInitSize.hx+'px';
    div.style.left = x + 'px';
    div.style.top = y + 'px';
  }
  im.src = el.src;
  showShadowBox(bigpicName);
}
function showbigpic() {
  if (window.opera || bigpicImage.width > 0) { bigpicLoaded(); }
}
function bigpic(what,sub) {
// sub >=0 = bikebuilder feature index
// sub = -1  bikebuilder frame
// sub = -2  prodpage
// sub = -3  showpart
   initBigImage(sub);
   popupInit(bigPicClose,bigpicName+'CloseBtn');
   var el = document.getElementById(bigpicName);
   var eli = document.getElementById(bigpicName+'Img');
   if (el && eli) {
     el.style.display = 'none';
     if (sub == -4) { var im = '('+noNull(what)+')'; }
     else
     if (sub == -3) { var im = '('+noNull(document.getElementById("pdImage").src)+noNull(document.getElementById("pdImage").getAttribute('data-src'))+')'; }
     else
     if (sub == -2) { var im = '('+document.getElementById("pimage"+what).src+')'; }
     var a = im.split('(');
     im = a[1];
     a = im.split(')');
     im = a[0];
//     if (im.match('coming_soon') || im.match('blank.gif')) { return false; }  // dont show if its a coming soon image
     c = im.replace('.jpg','_large.jpg');
//     c = c.replace('thumb','zoom');
//     c = c.replace('small','zoom');
//     c = c.replace('medium','zoom');
//     var ii = c.indexOf('products');  // opera fix
//     if (ii > -1) { c = c.substring(ii,100); }
     if (bigpicInitSize.w == 0) {
       bigpicInitSize.w = cssStyle(el,'width');
       bigpicInitSize.h = cssStyle(el,'height');
       bigpicInitSize.wi = cssStyle(eli,'width');
       bigpicInitSize.hi = cssStyle(eli,'height');
       bigpicInitSize.wx = bigpicInitSize.w - bigpicInitSize.wi;
       bigpicInitSize.hx = bigpicInitSize.h - bigpicInitSize.hi;
     }
     bigpicInitSize.innerDiv = eli;
     el.style.width = bigpicInitSize.w + 'px';
     el.style.height = bigpicInitSize.h + 'px';
     eli.style.width = bigpicInitSize.wi + 'px';
     eli.style.height = bigpicInitSize.hi + 'px';
     el.style.display = 'block';

     var x = el.offsetLeft;
     var y = el.offsetTop;
     x = xOnPage(x,600,true);
     y = yOnPage(y,554,true);

     el.style.left = x + 'px';
     el.style.top = y + 'px';
//     el1.style.width = wd + 'px';
//     el1.style.height = ht + 'px';

     bigpicImage = new Image();
     bigpicImage.onload = bigpicLoaded;
     bigpicImage.src = c;

//     el1.innerHTML = '<img src="'+c+'" onerror="imageErr(this,\'zoom\')" onload="bigpicLoaded(this)">';
     if (sub == -4) {
     }
     else
     if (sub == -3) {
       document.getElementById('bigImageHead').innerHTML = what;
     }
     else
     if (sub == -2) {
       document.getElementById('bigImageHead').innerHTML = document.getElementById('listItemTitle'+what).innerHTML;
     }
     else
     if (sub == -1 ) {
       document.getElementById('bigImageHead').innerHTML = document.getElementById('bbItemTitle'+what).innerHTML;
     }
     else {
       document.getElementById('bigImageHead').innerHTML = document.getElementById('bbItemTitle'+what+'Sub'+sub).innerHTML; }
//     document.getElementById('bigImageText').innerHTML = c;
//     document.getElementById('bigImageText').style.textAlign = 'right';
     showbigpic();
   }
   return false;
}
*/
//--------------------------------------
function explode(div, classs, endfunc, fromcust) {
  showModalCover();
  div.style.left = '-2000px';
  explodeStage = 1; // exploding
  var too = { x:div.origleft, y:div.offsetTop, w:div.offsetWidth, h:div.offsetHeight };
  if (fromcust) { var from = fromcust; } else { var from = { el:div }; }
  transition( from, too, { speed:1000, classname:classs, grow:'Y', onend:endfunc, action:'h,w' } );
//  transition( from, too, { speed:700, classname:'bigImage', movediv:'Y', onend:exploded, action:'fi' } );
}
//--------------------------------------
function initSizeChart() {
  var id = 'sizeChartDiv';
  var div = createDynamicPopup(id);
  var sct = document.getElementById('sizechartHost');
  if (sct) { sct = sct.innerHTML; } else { sct = 'Size Chart Not Found'; }

  var s = '';
  s+='<div id="sizeChartHead">Size Chart Help</div>';
  s+='<img id="sizeChartCloseBtn" src="assets/images/headerbtn.jpg"  alt="close" title="close" />';
  s+='<div id="sctable">'+sct+'</div>';
  div.innerHTML = s;
  var el = document.getElementById('sizeChartHead');
  if (el) { dhSize = DragHandler.attach(el,div); } // make it draggable on the header
  return div;
}
function showSizeChart() {
  var div = initSizeChart();
  if (div) {
    popupInit(hideSizeChart,'sizeChartCloseBtn');

    div.style.display = 'block';
    var posd = getBounds(div);
    var x = xOnPage(0,posd.w,true);
    var y = yOnPage(0,posd.h,true);
    div.style.left = x + 'px';
    div.style.top = y + 'px';
    showShadowBox(div);
  }
}
function hideSizeChart() {
  var el = document.getElementById('sizeChartDiv');
  hideShadowBox();
  if (el) { el.style.display = 'none'; }
}
//--------------------
var cols_ovr = -1;
function tidyProdpage() {
  if (window.prodpagef) { return; }
// set all div heights to the same on each prodpage row so the divs slide nicely into place
  // home page has multiple part lists on tabs so I need to separate them
  var parents = new Array;
  cnt = 0;
  hpad = -1;
  var alldiv = document.getElementsByTagName('div');
  for(var m=0, elm; elm=alldiv[m++];) {
    if ( elm.id.substring(0,12) == 'productVSDiv') {
      var par = (elm.offsetParent ? elm.offsetParent : elm.parentNode);
      parents[par.id] = true;
      if (hpad == -1) { hpad = hborder(elm); }
    }
  }

  for (var parent in parents) {
   // collect vs box max height on each row
    var cols = cols_ovr;  var inittop = 0;
    var heights = new Array;
    cnt = 0;
    var alldiv = document.getElementsByTagName('div');
    for(var m=0, elm; elm=alldiv[m++];) {
      var par = (elm.offsetParent ? elm.offsetParent : elm.parentNode);
      if ( elm.id.substring(0,12) == 'productVSDiv' && par.id == parent) {
       if (cnt==0) { inittop = elm.offsetTop; }
       cnt++;
       if (cols==-1 && inittop != elm.offsetTop) { cols = cnt-1; }  // auto detect number of columns
       var cc = (cols == -1 ? 0 : Math.floor((cnt-1) / cols));
       heights[cc] = (!heights[cc] || elm.offsetHeight > heights[cc] ? elm.offsetHeight : heights[cc]);
      }
    }
    if (cols == -1) { cols = cnt; }
  // set all prodpage boxes to the same height
    cnt = 0;
    for(var m=0, elm; elm=alldiv[m++];) {
      var par = (elm.offsetParent ? elm.offsetParent : elm.parentNode);
      if ( elm.id.substring(0,12) == 'productVSDiv' && par.id == parent) {
       cnt++;
       var cc = Math.floor((cnt-1) / cols);
       var rm = Math.floor((cnt-1) % cols) == cols-1;
       var h1 = elm.offsetHeight;
       if (h1 > 0) { elm.style.height = heights[cc]+'px'; }
       var h2 = elm.offsetHeight - hpad;
  //     elm.innerHTML = cnt+' '+cc+' '+heights[cc]+' '+(heights[cc] - elm.offsetHeight);
       var elmore = document.getElementById(elm.id.replace('productVSDiv','productVSFill'));
       if (elmore) {
//         elmore.innerHTML = h1+' '+h2+' '+cnt+' '+cc+' '+heights[cc]+' '+(heights[cc] - elm.offsetHeight+' '+rm+' '+cols);
//alert(h2+' '+h1);
         if (h2 > h1) { elmore.style.paddingBottom = ( h2 - h1 ) + 'px'; }
       }
       if (rm) { elm.style.borderRightWidth = '0'; }
      }
    }
  }
  setReviewStars();
}

function tidyFunc() {
// hide price if its 0.00 - check contents of li.price1 and hide li
  var cnt = 0;
  var arel = 0;
/*
  var all = document.getElementsByTagName('div');
  for (var m=0, elm; elm=all[m++];) {
    if ( elm.className== 'rrpsav') {
      var s = elm.innerHTML;
      // remove 0.00 or -x.x% or -x%
      if ( s.match(/[^0-9]0\.00/) || s.match(/\-[0-9]*\.?[0-9]*\%/)) {
        elm.innerHTML = '&nbsp;';
      }
    }
  }
  all = null;
*/
  tidyProdpage();
  
  // remove the tooltip titles from the top menu
  var lm = document.getElementById('menu');
  if (lm) {
    var lia = lm.getElementsByTagName("A");
    for (var i=0; i < lia.length; i++ ) {
      lia[i].title = '';
    }
  }
  // remove the tooltip titles from the left menu
  var lm = document.getElementById('leftMenu');
  if (lm) {
    var lia = lm.getElementsByTagName("A");
    for (var i=0; i < lia.length; i++ ) {
      lia[i].title = '';
    }
  }
  // manage left menu - its a copy of the main menu
  // - remove the mouseover handlers
  var lm = document.getElementById('leftMenu');
  if (lm) {
    var lia = lm.getElementsByTagName("LI");
    for (var i=0; i < lia.length; i++ ) {
      lia[i].onmouseover=null;
      lia[i].onmouseout=null;
    }
    // make visible all menus with data-id = pageid or data-id = pageid+'extra'
    // pageid can have a _??? section, the _??? allows for different background but same menu
    // remove the _??? to get the correct menu
    var pid = pageId;
    if (pid.indexOf('_') > 0) { pid = pid.substr(0,pid.indexOf('_')); }
    var lia = lm.getElementsByTagName("LI");
    for (var i=0; i < lia.length; i++ ) {
      var id = lia[i].getAttribute('data-id');
      if (id == pid) { lia[i].style.display = 'block'; }
      if (id == pid+'-extra') { lia[i].style.display = 'block'; }
      if (id == 'refine') { lia[i].style.display = 'block'; }
    }
/*
    var el = document.getElementById('innerContainer');
    if (el) {
      // make sure images on the page have a specified height, otherwise this will calc the wrong height
      var ht = el.offsetHeight;
      ht = (ht > 100 ? ht : 100); // -10 to match innerContainer padding
      lm.style.height = ht + 'px';
    }
*/
  }
}

function resetMenuHeight() {  // used in tabbed info pages
/*  var lm = document.getElementById('leftMenu');
  if (lm) {
    lm.style.height = 'auto';
    var el = document.getElementById('innerContainer');
    if (el) {
      var ht = el.offsetHeight;
      ht = (ht > 100 ? ht - 10 : 100); // -10 to match innerContainer padding
      lm.style.height = ht + 'px';
    }
  }
*/
}
//--------------------------------------
function doProductBookmark() {
var url = location.href;
var title = document.title;
if (window.sidebar) // firefox
	{ window.sidebar.addPanel(title, url, ""); }
else if(window.opera && window.print) // opera
 {	var elem = document.createElement('a');
  	elem.setAttribute('href',url);
  	elem.setAttribute('title',title);
  	elem.setAttribute('rel','sidebar');
  	elem.click();
 }
else if(document.all && window.external)// ie
 {	window.external.AddFavorite(url, title); }
else
 { alertX('Bookmark could not be created\r\nPlease use your browsers menu to add a bookmark'); }
}
//--------------------------------------
//
function scok() {
  var res = false;
  var pwel = document.getElementById('sctot');
  if (pwel) {
    var opel = document.getElementById('opswd');
    if (opel) {
      var scpw = opel.value.toUpperCase();
      var pwht = 0;
      for (var i=0; i < scpw.length; i++) {
        pwht += scpw.charCodeAt(i) * (1+Math.pow(i*256,2));
      }
      if (pwht == pwel.value) res = true;
//  alert(pwht+' '+pwel.value);
    }
  }
  if (!res) {
    if (scpw == '') { alert('Please enter your old password'); }
    else { alert('The password you entered does not match your old password'); }
  }
  return res;
}
//
function searchOk(el,def) {
  var val = document.getElementById(el).value;
  if ((val == '' || val == def)) { return false; }
  if (trim(val).length < 2) { alertX('<br>&nbsp;&nbsp;Please enter at least 2 characters to search for&nbsp;&nbsp;<br>'); return false; }
  else {
    // dont let the form post. I want all the data in the querystring
    val = escape(trim(val.replace(/:/g,'')));
    if (delim404 == '*') {
      var s = thisUrl.replace('https:','http:')+'prodpage.asp?type=search&action=Search&searchwhat='+val;
      document.location = s;
    } else {
      var s = thisUrl.replace('https:','http:')+'product'+delim404+'t'+delim404+val;
      document.location = s;
    }
    popupClose('','');  // close any open popups
  }
  return false;
}
function setNumber(num) {
	var n = document.getElementById("r_updateNo");
	n.value = num;
	return true;
}

function showHideTabs(div_id) {
  if (div_id=="<elucid_tab>") { return }
  var ids = new Array('a','b','c','d','e','f');
  for (var i=0; i<ids.length; i++) {
   	var el = document.getElementById('s'+ids[i]);
    if (el) { el.style.display = 'none'; }
   	el = document.getElementById('p'+ids[i]);
    if (el) {el.className = 'off'; }
  }

	// show the requested div
 	var el = document.getElementById('s'+div_id);
  if (el) { el.style.display = 'block'; }
 	el = document.getElementById('p'+div_id);
  if (el) {el.className = 'on'; }

  resetMenuHeight();
}

function pagerHead() {  // gets called from pagerText in common.js
//  var s = '<span class="ptext">Page '+pager_Page+' of '+pager_Max+' </span>';
  var s = '';//'<span class="ptext">Page </span>';
  showPagerArrows = true;
  return s;
}

function makeTable(fmt, s, tclass) {
// fmt is an array of columns defined as ['width','th justify','td justify','head text']
// justify is C, L or R
  var justy = new Array; justy['L']='Left'; justy['C'] = 'center'; justy['R'] = 'right';
//  if (tclass) { tclass = ' class="'+tclass+'"'; } else { tclass='';}
  if (tclass) {} else {tclass='';}

  var dohead = false;  // set to true if text supplied in the fmt array
  var totw = 0;
  var cols = fmt.length;
  for (var i=0; i<cols; i++) {
    var col = fmt[i];
    if (col[3]) { dohead = true; }
    totw += col[0]-0;
  }

  res = '<table cellspacing="0" cellpadding="4" border="0" width="'+totw+'" '+tclass+'>';
  if (dohead) {
    res += '<tr>';
    for (var i=0; i<fmt.length; i++) {
      var col = fmt[i];
      var val = (col[3] ? col[3] : '&nbsp;');
      res += '<th width="'+col[0]+'" align="'+justy[col[1]]+'">'+val+'</th>';
    }
    res += '</tr>';
  }

  var a = s.split('|');
  var col = 0;
  for (var i=0; i<a.length-1; i++) {
    col++;
    if (col == 1) { res += '<tr>'; }
    var val = (a[i] ? a[i] : '&nbsp;');
    res += '<td width="'+fmt[col-1][0]+'" align="'+justy[fmt[col-1][2]]+'">'+val+'</td>';
    if (col == cols) { res += '</tr>'; col = 0; }
  }

  res += '</table>';
  return res;
}

// info page 'more' popup
function infoAlertClose(val) {
  if (val == undefined) { return true; }
}

function doInfoPopup(id) {
  var el = document.getElementById(id);
  if (el) {
    var buttons = {};
    promptX(el.innerHTML, infoAlertClose, 0, buttons);
  }
}

function infoPageTo(thisel, id) {
  closeThisAlertX(thisel,'');
  doInfoPopup(id);
}

// switch on intellisense (search drop down) by calling initSearchBox()
var searchBoxId = 'searchwhat';  // the id of the search input box
addLoadEvent(initSearchBox);
//stopRightClick();
//addLoadEvent(templateSwitch);
//addLoadEvent(preLoad);
//addLoadEvent(setHeight);
