// SWF fix
var bo_noscript_id = 0;
function isIE() {
  var strBrowser = navigator.userAgent.toLowerCase();
  return ((strBrowser.indexOf("msie") > -1 || strBrowser.indexOf("opera") > -1) && strBrowser.indexOf("mac") < 0);
}

function startFix() {
  if (isIE()) {
   document.write('<div style="display: none;" id="bo_noscript_id_' + bo_noscript_id + '">');
  }
}

function endFix() {
  if (isIE()) {
   document.write('</div>');
   var theObject = document.getElementById("bo_noscript_id_" + bo_noscript_id++);
   theObject.outerHTML = theObject.innerHTML;
  }
}
// SWF fix END

// galerijas attelu atainotajs
var imageWin;
function showImg(imgSrc,bplat,baugst,title) {
	var winw = (screen.width - bplat) / 3;
	var winh = (screen.height - baugst) / 3;
	if (imageWin && imageWin.closed==false) {
		imageWin.close();
	}
		imageWin = open("/blank.htm", "bilde", "toolbar=no,directories=no,status=no,location=no,resizable=no,scrollbars=no,menubar=no,height="+baugst+",width="+bplat+",top="+winh+",left="+winw+"");
		imageWin.document.open();
		imageWin.document.write("<html><head><title>" + title);
		imageWin.document.write("</title></head><body bgcolor='#000000' scrolling=no marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>");
		imageWin.document.write("<table width=100% height=100% cellpadding=0 border=0 cellspacing=0><tr><td valign=middle align=center><a href='javascript:void(0);' onclick='javascript:window.close();' title='X'><img src='"+imgSrc+"' width="+bplat+" height="+baugst+" border=0></a></td></tr></table>");
		imageWin.document.write("</body></html>");
		imageWin.document.close();
	return false;
}

// nonemam sakuma tuksos simbolus
function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}
// nonemam beigu tuksos simbolus
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}
// nonemam sakuma un beigu tuksos simbolus
function trim( value ) {
	return LTrim(RTrim(value));
}
// mail too antispams :)
function m2(ne,ht) {
      window.location.href = "mailto:"+ne+"@"+ht;
}

function hidediv(id) {
	// atskirigo parluku drosa funkcija, kas pasleps div slanus
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	// atskirigo parluku drosa funkcija, kas paradiis konkreeto div slaani

	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

// paradam preci detalizeti jauna loga
function productWin(productID,lng) {
	var w = 640;
    var h = 480;
	var winl = (screen.width - w) / 3;
	var wint = (screen.height - h) / 3;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,resizable';
	win = window.open('/productpage/'+lng+'/'+productID+'.html', 'prWin', winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
