sp=0;
r=a=x=tr=false;
r=(/MSIE/.test(navigator.userAgent))?true:false;
if(!r)
{
	x=(/Firefox|Safari/.test(navigator.userAgent))?true:false;
	if(!x)
	{
		a=(/Opera/.test(navigator.userAgent))?true:false;
		if(!a)
		{
			x=true;
		}
	}
}
else
{
	if(/MSIE 8/.test(navigator.userAgent))
	{
		r=false;
		x=true;
		tr=true;
	}
}
function getElementsByClass(n,c,t)
{
  var ce=new Array();
  var els=n.getElementsByTagName(t);
  var ne = els.length;
  var p = new RegExp("\\b" + c + "\\b");
  for (i = 0, j = 0; i < ne; i++) {
    if (p.test(els[i].className)) {
      ce[j++] = els[i];
    }
  }
  return ce;
}
function lbzI()
{
  var ce;
  
  pw=420;
  ph=580;
  oo=document.getElementById('lbzO');
  fo=document.getElementById('lbzF');
  po=document.getElementById('lbzB');
  co=document.getElementById('lbzC');

  cl=document.getElementById('lbzC-l');
  pha=60;
  if(r||tr)
  {
  	m=20;
	}
	var e=document.getElementsByName('lbzPreview');
	for(var i=0;i<e.length;i++)
	{
		e[i].onclick=sbp;
	}
	fo.onclick=hp;
	oo.onclick=hp;
  ce=getElementsByClass(document.getElementById('lbzP'), "cart", "span");
  for(var x=0;x<ce.length;x++)
  {
    ce[x].onclick=b;
  }
  ce=getElementsByClass(document.getElementById('lbzP'), "cartOut", "span");
  for(var x=0;x<ce.length;x++)
  {
    ce[x].onclick=b;
  }
}
function b()
{
  var tid = this.id.replace(/i|o/, "");
  document.getElementById('ppb').value=tid;
  document.forms['buyCrosses'].submit();
}
function sbp()
{
  cl.innerHTML = this.alt;
	var pgh=gph();
	var wh=window.innerHeight;
  if(r||tr)	
  {
		var ww=document.body.clientWidth;	
		if(document.documentElement&&document.documentElement.scrollTop)
		{
	  	sp=document.body.parentElement.scrollTop;
		}
		else
		{
	  	sp=document.body.scrollTop;
		}
  }
  else
  {
  	sp=window.pageYOffset;		
  }
  if(r||tr)	
	{
		oo.style.width=document.body.scrollWidth+m+"px";
	}
  oo.style.height=pgh+"px";
	oo.style.display="block";
  fn=this.id+".jpg";
  iStr='<img id="Image1" src="http://awesomecrosses.com/images/SS/'+fn+'" style="width:420px;height:580px;" />';
  /*
  iStr = '<img id="Image1" src="images/ss/' + fn + '" style="width:420px;height:580px;" />';
  */
  po.innerHTML = iStr;
  po.currentWidth=pw;
  po.style.width=pw+"px";
	co.style.width=po.style.width;
	co.style.marginTop=sp+"px";
  ph+=pha;
  if(wh>ph)
  {
    fo.style.top=(wh-ph)/2+"px";
  }
	fo.style.display="block";
	var npgh=gph();
  if(r||tr)	
	{
		npgh=((sp+ph)>npgh)?sp+ph:npgh+pha;
		oo.style.height=npgh+"px";
	}
	else if(pgh<npgh)
	{
	  oo.style.height=npgh+"px"; 
	}
}
function gfn(o)
{
	return o.src.substring(o.src.lastIndexOf('/')+1,o.src.length);  
}
function hp()
{
	oo.style.display="none";
	fo.style.display="none";
}
function gph()
{
  return (document.documentElement&&document.documentElement.scrollHeight)?
    document.documentElement.scrollHeight:
    (document.body.scrollHeight>document.body.offsetHeight)?
    document.body.scrollHeight:document.body.offsetHeight;
}
window.onload=lbzI;
