/*
JavaScript modulis litkama.lt 
Autorius: Rolandas Paulauskas,  2008-05-10
www.orbcube.eu rolandas@orbcube.eu
*/

function header() {
    var data = "?puslapis=" + getUrlParam();
    //alert(data);
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="970" height="270">\n');
    document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    document.write('<param name="movie" value="header.swf' + data + '" />\n');
    document.write('<param name="quality" value="high">\n');
    document.write('<param name="wmode" value="transparent">\n');
    document.write('<param name="FlashVars" value="' + data + '">\n');
    document.write('<embed src="header.swf' + data + '" FlashVars="' + data + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" width="970" height="270"></embed>\n');
    document.write('</object>\n');
}

function updateClock() {
	var clockID = 0;
	if(clockID) {
		clearTimeout(clockID);
		clockID  = 0;
	}
	var tDate = new Date();
	y = tDate.getFullYear();
	mm = tDate.getMonth()+1;  if (mm<10) mm = "0"+mm;
	d = tDate.getDate();  if (d<10) d = "0"+d;
	h = tDate.getHours(); if (h<10) h = "0"+h; 
	m = tDate.getMinutes(); if (m<10) m = "0"+m;
	s = tDate.getSeconds(); if (s<10) s = "0"+s;
	
	document.getElementById("currentTime").value = ""+ y + "-" + mm + "-" + d + " " + h + ":" + m + ":" + s;
	clockID = setTimeout("updateClock()", 1000);
}

function startClock() {
	clockID = setTimeout("updateClock()", 500);
	
}

function stopClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}

function getUrlParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  var strQueryString = strHref.substr(strHref.indexOf("/")).toLowerCase();
  var aQueryString = strQueryString.split("/");
   return aQueryString[aQueryString.length-1];
}

function popupas(picassrc,w,h) {
	if (window.newWindow) newWindow.close();
	newWindow = window.open("","Nuotrauka","width="+w+",height="+h+",left=200,top=200");
	newWindow.document.open();
	newWindow.document.write("<html><head><title>UAB Litkama</title> <link rel=\"stylesheet\" type=\"text/css\" href=\"stilius_popup.css\"></head><body onclick=\"window.close()\">");
    newWindow.document.write("<img src=\""+picassrc+"\" width=\""+w+"\" height=\""+h+"\" alt=\"\">");
	newWindow.document.write("</body></html>");
	newWindow.focus();
}
function popUp(URL,w,h){
    newWindow = window.open('','Prekė','width='+w+',height='+h+',left = 200, top = 200');
    newWindow.document.open();
    newWindow.document.write('<html><link rel=\"stylesheet\" type=\"text/css\" href=\"stilius_popup.css\" /><title>Galerija</title><body onclick=\"window.close()\">');
	newWindow.document.write("<img src=\"" + URL + "\">");
	newWindow.document.write("</body></html>");
	newWindow.focus();
	onclick=newWindow.document.close();
}

function trinti() {
	document.getElementById('imone').value = "";
	document.getElementById('vardas').value = "";
	document.getElementById('elpastas').value = "";
	document.getElementById('tema').value = "";
	document.getElementById('tekstas').value = "";
}

