/* (c) 2011 Kalamun.org */

function k_pop(url,w,h) {
	if(!w) w=300;
	if(!h) h=200;
	window.open(url,"popup","top=10,left=10,width="+w+",height="+h+",status=no,menubar=no,toolbar=no,scrollbar=no");
	}
	
function removePlaceholder(inp) {
	if(!inp.getAttribute("placeholder")) inp.setAttribute("placeholder",inp.value);
	if(inp.value==inp.getAttribute("placeholder")) {
		inp.value="";
		inp.style.color="#000";
		}
	}
function setPlaceholder(inp) {
	if(inp.value=="") {
		inp.value=inp.getAttribute("placeholder");
		inp.style.color="#aaa";
		}
	}

function saveYourComment() {
	var ajax=new kAjax;
	ajax.onSuccess(function(html) { writeYourComment(html); });
	ajax.onFail(function(html) { writeYourComment(html); });
	ajax.send("post",TEMPLATEDIR+'inc/savePageComment.php','&pl='+escape('guestbook')+'&cN='+escape(document.getElementById('commentName').value)+'&cE='+escape(document.getElementById('commentEmail').value)+'&cT='+escape(document.getElementById('commentText').value)+'&idpag='+escape(document.getElementById('idpag').value));
	document.getElementById('pageForm').innerHTML='...please wait...';
	return false;
	}
function writeYourComment(html) {
	document.getElementById('pageForm').innerHTML=html;
	}

