function showImg(iid,idshop) {
	if( iid != null ){
		mb = document.getElementById('mediaBox'+idshop);
		images = mb.getElementsByTagName('img');
		links = mb.getElementsByTagName('a');
		
		//alert(images.length);
		if(images.length>0){
			for(i=0;i<images.length;i++){
				images[i].style.display = "none";
			}
			document.getElementById('media_'+idshop+iid).style.display = "block";
			
			if(links.length==0){
				for(i=0;i<images.length;i++){
					lnk = document.createElement('a');
					lnk.className=(i==0?"mbal_selected":"mbal_class");
					txt = document.createTextNode(i+1);
					lnk.setAttribute('href', 'javascript:showImg(\''+(i+1)+'\',\''+idshop+'\');');
					lnk.setAttribute('id', 'mediaboxlink'+idshop+(i+1));
					lnk.appendChild(txt);
					mb.appendChild(lnk);
				}
				//document.getElementById('mediaboxlink'+idshop+'1').className = 'selected';// 'mbal_selected';// 'selected';
			}
			else{
				for(i=0;i<links.length;i++){
					if(links[i].id!='mediaboxlink'+idshop+iid)
						links[i].className='mbal_class';
					else
						links[i].className = 'mbal_selected';//'mbal_class';//"";
				}
			//	document.getElementById('mediaboxlink'+idshop+iid).className = 'selected';// 'mbal_selected';// 'selected';	
			}
		}
	}
}


function showBox(idshop, nBox,pe) 
{
	for(i = 0; i<nBox; i++) {
		document.getElementById('prdDetails'+(i+1)).style.display = "none";
	}
	//showImg('0',idshop);
	try {
		showImg('1',idshop);
	}
	catch(E) {
	}
	document.getElementById('prdDetails'+idshop).style.display = "block";
	
	if(pe!=null) {
		var row=pe.parentNode.parentNode;
		var prow=document.getElementById("hlrow");
		if(prow!=null) {
			prow.className=prow.name;
			prow.id="";
			prow.name="";
		}
		row.name=row.className;
		row.id="hlrow";
		row.className="hlrow";
	}
}
