/* right */
function setid(){
	document.getElementById("udetails").submit();
}

/* goods */
function r(b,tick) {
	img = new Image();
	img.src = '/countlinks.php?type=4&elementid=' + b + '&tick=' + tick;
}
function zak(obj, id, url,tick,nos, urld) {
	r(id,tick);
	//if(!nos) document.forms["goodsite"].submit();
	if(!nos) window.open("/out.php?to="+urld+"&from="+document.location,id);
}

/* index */
function myGetElementById(id,type){
	if(!type) type='div';
	if (document.getElementById) {
		return (document.getElementById(id));
	} else if (document.all) {
		return (document.all[id]);
	} else {
		if ((navigator.appname.indexOf("Netscape") != -1) && parseInt(navigator.appversion == 4)) {
			if(type=='div')	return (document.layers[id]);
			if(type=='img')	return (document.images[id]);
			if(type=='form')return (document.forms[id]);
		}
	}
}
function op2(object1){
	alert(object1);
	var re='';
	var ax=0;
	for (i in object1){ax++;re=re+' '+i+' = '+object1[i]+' \n'; if(!(ax%10)){ if(!confirm(re)) break; else re='';}}
}

outline = new Array(500);
for (var i = 0; i < outline.length; ++i){
	outline[i] = 0;
}

function ssp(i) 
{
	dst = myGetElementById('la'+i+'_dst');
	src = myGetElementById('la'+i+'_src');
	if (outline[i] == 0 )
	{
		dst.innerHTML  =  src.innerHTML ;
		changeDisplay(dst);
		outline[i] = 1;
	}
	else
	{
		dst.innerHTML  = '' ;
		changeDisplay(dst);
		outline[i] = 0;
	}
}

function changeDisplay(obj){
	var elestyle = obj.style;
	if(!elestyle) return;
	if (elestyle.display != "block") {
		elestyle.display = "block";
	} else {
		elestyle.display = "none";
	}
}

function setVisible(id){
	myGetElementById(id).style.visibility = "visible";
}

function setHidden(id){
	myGetElementById(id).style.visibility = "hidden";
}
function op3(){
	op2(myGetElementById('la1_dst').style);
}

function sspin(i)
{
	def = myGetElementById('la'+i+'_def');
	src = myGetElementById('la'+i+'_src');
	lay = myGetElementById('la'+i);
	if (outline[i] == 0 )
	{
		lay.innerHTML  =  '<br>'+src.innerHTML ;
		lay.className = "tree";
		outline[i] = 1;
	}
	else
	{
		lay.innerHTML  = def.innerHTML ;
		lay.className = "treebefore";
		outline[i] = 0;
	}
}

/* pagetop */

function rc(id,url) {
	img = new Image();
	img.src = 'http://www.pricehouse.ru/counters.php?id='+id+'&rnd='+Math.random();
	if(url){
		document.forms["banform_"+id].submit();
	}
}
function tosite(id) {
	document.forms["goodsite"+id].submit();
}
function myr(b,tick) {
	img = new Image();
	img.src = 'http://www.pricehouse.ru/countlinks.php?elementid=' + b + '&tick='+tick;
}
function zakgl(id, gid, tick, urld) {
	myr(id,tick);
	//document.forms["goodsite"+gid].submit();
	window.open("/out.php?to="+urld+"&from="+document.location,gid);
}