// cepumu cepejs
function setCookie(name,value,path){
	if(navigator.cookieEnabled){
		var curCookie = name + "=" + value;
        if(path!=''){curCookie = curCookie + "; path=" + path;}
        document.cookie = curCookie;
    }else{
    	alert('Cookies is DISABLED!\nPlease enable cookies in your browser, cookies are required.');
    }
}


// galerijas attelu atainotajs
var csddWin;
function openCsddTest() {
	var bplat = 640;
    var baugst = 520;
	var winw = (screen.width - bplat) / 3;
	var winh = (screen.height - baugst) / 3;
	if (csddWin && csddWin.closed==false) {
		csddWin.close();
	}
		csddWin = open("/csddt/", "csddWin", "toolbar=no,directories=no,status=no,location=no,resizable=yes,scrollbars=yes,menubar=no,height="+baugst+",width="+bplat+",top="+winh+",left="+winw+"");
	return false;
}

var theoryWin;
function viewTheroy(links) {
	var bplat = 640;
    var baugst = 520;
	var winw = (screen.width - bplat) / 3;
	var winh = (screen.height - baugst) / 3;
	if (theoryWin && theoryWin.closed==false) {
		theoryWin.close();
	}
		theoryWin = open("/csddt/?"+links, "theoryWin", "toolbar=no,directories=no,status=no,location=no,resizable=yes,scrollbars=yes,menubar=no,height="+baugst+",width="+bplat+",top="+winh+",left="+winw+"");
	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';
		}
	}
}
