var ActivDiv;
var ActivForm;

function showForm(val) {
	if(ActivDiv)
		if(ActivDiv.style.display = 'block') ActivDiv.style.display = 'none';

	ActivDiv = document.getElementById(val);
	document.getElementById("new_message").reset();

	
	var y = top.document.body.scrollTop + "px";
    ActivDiv.style.top = y;
    
	ActivDiv.style.display = 'block';    
}

function hideForm() {
	ActivDiv.style.display = 'none';
}


function reloadwin(url) {
	document.location = url;
}

function saveForm(val) {
	ActivForm = val;

	if(val=='new-message')
	{
	linc = new String("/feedback/save.php?mail="+
	document.getElementById('mail').value+"&tel="+
	document.getElementById('tel').value+"&name="+
	document.getElementById('name').value+"&text="+
	document.getElementById('message').value);
	}
	/*
	if(val =='priom')
	{
	linc = new String("/feedback/save.php?mail="+
	document.getElementById('mail').value+"&name="+
	document.getElementById('name').value+"&text="+
	document.getElementById('message').value);
	}
	*/
	//linc.replace("/\n/","<br>");
	//alert(linc);
	document.getElementById('ifr').src = encodeURI(linc);
}

/******************/
function closeWin() {window.close();}
function setScroll(){document.body.setExpression("scroll","checkScroll()","JScript");}
function checkScroll(){
	var o=document.body;
	document.body.scroll=(o.scrollHeight>o.clientHeight || o.scrollWidth>o.clientWidth ? "yes":"no");
}



function init()
{
	if(navigator.appName.substring(0,3)=='Mic') setScroll();
	print();
}

/*
function OpenImg(id,catalog) {
	winpodr2 = window.open("one_image.php?id="+id+"&catalog="+catalog, "pop2", "Width=900px, Height=700px, center=yes, location=0, status=1, menubar=0, scrollbars=1, resizable=1, help=0, toolbar=no");
	winpodr2.focus();
}




function print()
{
	var leftie = document.getElementById("leftie");
	var rightie = document.getElementById("rightie");
	var k_img = document.getElementById("kasseta_img");
	var k_text = document.getElementById("kasseta_text");
	
	if(curpic==0) {
		leftie.style.visibility = 'hidden';
	}

	if(curpic==picz.length-1) {
		rightie.style.visibility = 'hidden';
	}

	if(curpic > 0) {
		leftie.style.visibility = 'visible';
	}

	if(curpic < picz.length-1) {
		rightie.style.visibility = 'visible';
	}

	kasseta.src = picz[curpic];
}

function prev()
{
	curpic--;
	if(curpic<0)  curpic=0;
	print();
}


function nextie()
{
	curpic++;
	if(curpic>picz.length-1)  curpic=picz.length-1;
	print();
}
*/

