//-------------------------------------------------------------------------------
// Paspaudus ant mygtuko, peradresuojame i mums reikiama puslapi

function RedirectMe(adr)
{
  window.location=adr
}



//-------------------------------------------------------------------------------
// Peradresuoja i pagal nutylejima puslapio nustatymo langa

function DefPage (fname)
{
	location = "/include/defpage_change.asp?fname="+fname;
}



//-------------------------------------------------------------------------------
// Tikrina ar vedliu pagalba puslapiu kurimo procese nebuvo praleistas
// failo pavadinimas arba antraštė

function Start_Validator()
{
  submitOK = 0
	if (frm.file.value == "") {
		error1.style.display = "";
		submitOK =  submitOK + 1}
	else {
		error1.style.display = "none"}

	if (frm.heading.value == "") {
		error2.style.display = "";
		submitOK =  submitOK + 1}
	else {
		error2.style.display = "none"}

	if (submitOK == 0)
           {
	    return true
           }
	else 
           {
	    return false
           }
}

//-------------------------------------------------------------------------------



//-------------------------------------------------------------------------------
// Funkcijos pagalba tikriname ar teisingai ivestas el. pasto adresas

function Email_Validator()
{
var goodEmail = frm.pastas.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);

 if (frm.pastas.value == "") {
     error6.style.display = "";
     return false }
 else {
     error6.style.display = "none";
     if (goodEmail) {
          error15.style.display = "none";
          return true }
     else {
	  error15.style.display = "";
	  return false }
          }
}

//-------------------------------------------------------------------------------



//-------------------------------------------------------------------------------
// Bylu ikelimo formos butinu lauku uzpildymo tikrinimas

function File_Validation()
{
  submitOK = 0
	if (form.file.value == "") {
		error4.style.display = "";
		submitOK =  submitOK + 1}
	else {
		error4.style.display = "none"}

	if (submitOK == 0)
           {
	    return true
           }
	else 
           {
	    return false
           }

}

//-------------------------------------------------------------------------------



//-------------------------------------------------------------------------------
// Tikrina kliento puseje ar prisijungimo formoje yra ivesti vartotojo vardo
// ir slaptazodziu laukai, jeigu sie laukai yra tusti, forma nebus vykdoma

function Login_Validation()
{
  submitOK = 0
	if (LogFrm.usr.value == "") {
		error1.style.display = "";
		submitOK =  submitOK + 1}
	else {
		error1.style.display = "none"}

	if (LogFrm.pwd.value == "") {
		error2.style.display = "";
		submitOK =  submitOK + 1}
	else {
		error2.style.display = "none"}

	if (submitOK == 0)
           {
	    return true
           }
	else 
           {
	    return false
           }

}

//-------------------------------------------------------------------------------



//-------------------------------------------------------------------------------
// Pagal atitinkama pozimy vartotojui parodome tam tikra "paslepta" informacija

function Show_Form(id)
{
  if (id == '1')
     {
     Show_1.style.display = "none";
     Hide_1.style.display = "";
     }
  if (id == '2')
     {
     Show_2.style.display = "none";
     Hide_2.style.display = "";
     }
  if (id == '3')
     {
     Show_3.style.display = "none";
     Hide_3.style.display = "";
     }
  if (id == '4')
     {
     Show_4.style.display = "none";
     Hide_4.style.display = "";
     }
  if (id == '5')
     {
     Show_5.style.display = "none";
     Hide_5.style.display = "";
     }

}
//-------------------------------------------------------------------------------



//-------------------------------------------------------------------------------
// "spalta" informacija pagal pozymi vel paslepiame
function Hide_Form(id)
{
  if (id == '1')
     {
     Show_1.style.display = "";
     Hide_1.style.display = "none";
    }
  if (id == '2')
     {
     Show_2.style.display = "";
     Hide_2.style.display = "none";
     }
  if (id == '3')
     {
     Show_3.style.display = "";
     Hide_3.style.display = "none";
     }
  if (id == '4')
     {
     Show_4.style.display = "";
     Hide_4.style.display = "none";
     }
  if (id == '5')
     {
     Show_5.style.display = "";
     Hide_5.style.display = "none";
     }
}

//-------------------------------------------------------------------------------




//-------------------------------------------------------------------------------
// Sios funkcijos pagalba mes atidarome reikiamo dydzio langa, kurio
// sumazinti arba padidinti jau negalima. Taip pat ten nera meniu
// Vartotojas cia skaito pagalba arba pateikia reikiamus duomenis apie save
// * ka - koki faila reikia uzkrauti
// * w  - lango plotis (rekomenduoju ne daugiau 600)
// * h  - lango aukstis (rekomenduoju ne daugiau 400)

function OpenWin(ka,w,h)
{
self.name = "pasyvus";

options = "toolbar=0,status=0,menubar=0,scrollbars=0," + "resizable=0,top=100,left=100,width=" + w + ",height="+ h;
//options = "toolbar=0,status=Yes,menubar=0,scrollbars=0," + "resizable=Yes,top=100,left=100,width=" + w + ",height="+ h;
pasiulymas = window.open(ka,"remote",options);

}

//-------------------------------------------------------------------------------



//-------------------------------------------------------------------------------

function OpenHelp(ka)
{
options = "toolbar=0,status=0,menubar=0,scrollbars=Yes," + "resizable=1,top=100,left=100,width=640,height=580";
pasiulymas = window.open(ka,"",options);
}

//-------------------------------------------------------------------------------
