window.onload =  function () {
	
	getAJAX = getHTTPObject(); 
	
	
	var alltags=document.all? document.all : document.getElementsByTagName("*");
	 for (i=0; i<alltags.length; i++)	{
	
	   	if (alltags[i].className=='relatedItem')	{
				alltags[i].onclick = function () { location.href = this.getAttribute('rel'); }
				alltags[i].style.backgroundImage = 'url("' + storeImageFolder + 'minithumbs/' + alltags[i].getAttribute('src') +'")';
				// alltags[i].onmouseover = function () {this.className='latestContainer';}
				// alltags[i].onmouseout = function () {this.className='latestContainerDimmed' }
				// alltags[i].ondblclick = function () { location.href = this.getAttribute('rel'); }
			 }
	
	  	else if (alltags[i].className=='morePhoto')	{	
				alltags[i].style.backgroundImage = 'url("' + storeImageFolder +  alltags[i].getAttribute('src') +'")';
				alltags[i].innerHTML = '&nbsp;';
			}
  
	  
			else if (alltags[i].className=='productListImageContainer')	{	
				alltags[i].style.backgroundImage = 'url("' + storeImageFolder + 'thumbs/' + alltags[i].getAttribute('src') +'")';
				alltags[i].style.height = '200px';
				alltags[i].style.cursor = 'pointer';
				alltags[i].onclick = function () { if (this.getAttribute('rel'))  location.href = this.getAttribute('rel'); }
				alltags[i].innerHTML = '&nbsp;';
			}
	
			
			else if (alltags[i].className.match("internal"))	{
					divTarget = alltags[i].getAttribute('rel');
			 		alltags[i].onclick = function () {
						doAjax(this.href + '&ajaxed',this.getAttribute('rel')); 
						// setThumb();
						return false;
					}	
			}	
	
	 }
	 
	
	if (document.getElementById('modelContainer'))	{
		document.getElementById('modelContainer').style.backgroundImage = 'url("' + document.getElementById('modelContainer').getAttribute('rel') +'")';
	}
	
	if (document.getElementById('productImageContainer'))	{
		if (document.getElementById('productImageContainer').getAttribute('rel')) {document.getElementById('productImageContainer').style.backgroundImage = 'url("' + storeImageFolder + document.getElementById('productImageContainer').getAttribute('rel') +'")';
		document.getElementById('productImageContainer').innerHTML = '&nbsp;'; }
		// document.getElementById('productImageContainer').onclick = function () {alert('cliok'); if(event.button==2){alert('right mouse button clicked!');} }
	}

}

