function $(t){return document.getElementById(t);}
function revY(a,t, l){
	for(i=0;$('ar'+i)!=undefined;i++){
		$('ar'+i).style['display']='none';
		$('cr'+i).style['textDecoration']='none';
		$('cr'+i).style['color']='';
		$('er'+i).style['background'] = 'transparent';
	}

	$(a).style['display']='block';
	t.style['textDecoration']='underline';
	$('er'+l).style['background'] = '#dedede';
}
var timerId = null
	var obj = new Array()

	function prepareShowAlt(event){
		idd = this.id
		if (idd.search("title_") == 0){
			idd = idd.substring(6)
			if ((typeof titles != "undefined") && (typeof titles[idd] != "undefined") && titles[idd].length > 0){
				text = titles[idd]
			}else{
				return;
			}
		}else{
			return
		}

		x = 0;
		y = 0;
		oX = 0;
		if (document.all){
			x = window.event.clientX
			y = window.event.clientY + document.documentElement.scrollTop
		}else{
			x = event.clientX - oX
			y = event.clientY + window.scrollY
		}
		x += Math.round(xs[idd])
		y += Math.round(ys[idd])

		obj = new Array()
		obj[0] = text
		obj[1] = x
		obj[2] = y

		timerId = setTimeout("showAlt()", 500);
	}

	function showAlt(){
		text = obj[0]
		x = obj[1]
		y = obj[2]

		altd = document.getElementById('altDiv')
		text2=text.split('||')
		i=0
		if(text2.length>1){
		for(i=0,text4='';text2.length-1>i;i++){
			xtex = text2[i].split('*')
			if(xtex.length>1){

				if (xtex[0]=="2"){
				text4+='<div style=\"border:1px solid #d8d8d8;float:left;height:15px;width:25px;margin:3px;\"><div style="float:left;background:#'+xtex[1]+';width:12px;height:15px;"></div><div style="float:left;background:#'+xtex[2]+';width:13px;height:15px;"></div></div>'
				}
				else if(xtex[0]=="1"){
				text4+='<div style=\"border:1px solid #d8d8d8;float:left;height:13px;width:25px;margin:3px;background:url('+xtex[1]+')\"></div>'
				}
			}
			else {
				text4+='<div style=\"border:1px solid #d8d8d8;float:left;height:15px;width:25px;margin:3px;background:#'+text2[i]+'\"></div>'
			}
		}
		if(text4==''){ text4='kolory: skontaktuj się aby uzyskać informacje na temat produktu' }
		altd.innerHTML = "<table cellpadding=2 cellspacing=0 style='background-color: #EEF6FF; border: solid #c7c7c7 1px; font-family: tahoma;" + (text.length > 30 ? "width: 200px;" : "") +"'><tr><td style='color: #403540; font-size: 11px;'>Dostępne kolory:<br/><br/>" + text4 + "</td></tr></table>"
		}
		else {		altd.innerHTML = "<table cellpadding=3 cellspacing=0 style='background-color: #EEF6FF; border: solid #c7c7c7 1px; font-family: tahoma;" + (text.length > 30 ? "width: 200px;" : "") +"'><tr><td style='color:#403540;font-size:11px;'>" + text2 + "</td></tr></table>"
		}
		altd.style.left = Math.min(x + 10,document.body.clientWidth-201)+'px'
		altd.style.top = y+'px'
	
		altd.style.display = 'inline'
	}

	function hideAlt(){
		obj = new Array()
		clearTimeout(timerId)
		altd = document.getElementById('altDiv')
		altd.innerHTML = ""
		altd.style['left'] = -100+'px'
		altd.style['top'] = -100+'px'
		altd.style.display = 'none'
	}

	function initAlts(){
		arr = document.getElementsByName('title')
		titles = new Array()
		xs = new Array()
		ys = new Array()
		for (i=0; i<arr.length; i++){
			itemm = arr.item(i)
			itemm.onmouseover = prepareShowAlt
			itemm.onmouseout = hideAlt
			itemm.id = "title_" + i
			titles[i] = itemm.title
			xs[i] = (typeof itemm.xs == 'undefined' ? 0 : itemm.xs)
			ys[i] = (typeof itemm.ys == 'undefined' ? 0 : itemm.ys)
			itemm.title = ""
		}
	}
