﻿// trynimo patvirtinimas

var cmsg = new Array();
cmsg[0] = 'Ar tikrai norite istrinti kalbu lentele ?\n\nVisi dumenys bus istrinti ir neatstatomi !!!';
cmsg[1] = 'Ar tikrai norite ištrinti kalbą?\n\nVisi šia kalba suvesti duomenys bus ištrinti !!!';
cmsg[2] = 'Ar tikrai norite ištrinti produktų grupę?\n\nVisi šios grupės pogrupiai ir produktai bus ištrinti !!!';
cmsg[3] = 'Ar tikrai norite ištrinti produktų pogrupį?\n\nVisi šio pogrupio produktai bus ištrinti !!!';
cmsg[4] = 'Ar tikrai norite ištrinti įrašą?';
cmsg[5] = 'Ar tikrai norite ištrinti įrengimų grupę?\n\nVisi šios grupės įrengimai bus ištrinti !!!';
cmsg[6] = 'Ar tikrai norite ištrinti šią naujieną?';


function confirmDelete(msg_no){
   msg = cmsg[msg_no];
   var del=confirm(msg);
        if (del == true) {return true;} else {return false;};
} 

//----------------------------------------------------------------------
// TAB MENU
//---------------------- galima keisti ---------------------------------
 
 var activeMenuBackgroundColor = '#ffffff';
 var activeMenuColor = '#000000';

//-------------------------  nekeisti ----------------------------------
 var shortDescription = '';
 var fullDescription = '';
 var logo = '';
 var visibleSection = '';

 var menu1 ='';
 var menu2 ='';
 var menu3 ='';
 var activeMenu = '';

 function loadInit(){
        shortDescription = document.getElementById("div_anotation");
        fullDescription  = document.getElementById("div_description");
	logo = document.getElementById("div_logo");
	fullDescription.style.display = 'none';
	logo.style.display = 'none';
	visibleSection = shortDescription;

	menu1 = document.getElementById("menu1");
	menu2 = document.getElementById("menu2");
	menu3 = document.getElementById("menu3");

	activeMenu = menu1;
	activeMenu.style.backgroundColor = activeMenuBackgroundColor;
	activeMenu.style.color = activeMenuColor;

 }

 function showSection(obj){
	if (obj == 'menu1'){
		shortDescription.style.display = '';
		fullDescription.style.display = 'none';
		logo.style.display = 'none';

		menu1.style.backgroundColor = activeMenuBackgroundColor;
		menu1.style.color = activeMenuColor;
		menu2.style.backgroundColor = '';
		menu2.style.color = '';
		menu3.style.backgroundColor = '';
		menu3.style.color = '';
	};

	if (obj == 'menu2'){
		shortDescription.style.display = 'none';
		fullDescription.style.display = '';
		logo.style.display = 'none';
		menu1.style.backgroundColor = '';
		menu1.style.color = '';
		menu2.style.backgroundColor = activeMenuBackgroundColor;
		menu2.style.color = activeMenuColor;
		menu3.style.backgroundColor = '';
		menu3.style.color = '';

	};

	if (obj == 'menu3'){
		shortDescription.style.display = 'none';
		fullDescription.style.display = 'none';
		logo.style.display = '';
		menu1.style.backgroundColor = '';
		menu1.style.color = '';
		menu2.style.backgroundColor = '';
		menu2.style.color = '';
		menu3.style.backgroundColor = activeMenuBackgroundColor;
		menu3.style.color = activeMenuColor;

	};

 }

//  **** naujienos
 var NewsText = '';
 var NewsDates = '';

 function loadInitNews(){

        NewsText = document.getElementById("div_news_text");
        NewsDates = document.getElementById("div_news_dates");


	NewsDates.style.display = 'none';


	visibleSection = NewsText;

	menu1 = document.getElementById("menu1");
	menu2 = document.getElementById("menu2");


	activeMenu = menu1;
	activeMenu.style.backgroundColor = activeMenuBackgroundColor;
	activeMenu.style.color = activeMenuColor;

 }

 function showNewsSection(obj){

	if (obj == 'menu1'){
		NewsText.style.display = '';
		NewsDates.style.display = 'none';

		menu1.style.backgroundColor = activeMenuBackgroundColor;
		menu1.style.color = activeMenuColor;
		menu2.style.backgroundColor = '';
		menu2.style.color = '';
	};

	if (obj == 'menu2'){
		NewsText.style.display = 'none';
		NewsDates.style.display = '';

		menu1.style.backgroundColor = '';
		menu1.style.color = '';
		menu2.style.backgroundColor = activeMenuBackgroundColor;
		menu2.style.color = activeMenuColor;

	};

 }

//  **** info
 var InfoText = '';
 var InfoDates = '';

 function loadInitInfo(){

        NewsText = document.getElementById("div_info_text");
        NewsDates = document.getElementById("div_info_dates");


	InfoDates.style.display = 'none';


	visibleSection = NewsText;

	menu1 = document.getElementById("menu1");
	menu2 = document.getElementById("menu2");


	activeMenu = menu1;
	activeMenu.style.backgroundColor = activeMenuBackgroundColor;
	activeMenu.style.color = activeMenuColor;

 }

 function showInfoSection(obj){

	if (obj == 'menu1'){
		InfoText.style.display = '';
		InfoDates.style.display = 'none';

		menu1.style.backgroundColor = activeMenuBackgroundColor;
		menu1.style.color = activeMenuColor;
		menu2.style.backgroundColor = '';
		menu2.style.color = '';
	};

	if (obj == 'menu2'){
		InfoText.style.display = 'none';
		InfoDates.style.display = '';

		menu1.style.backgroundColor = '';
		menu1.style.color = '';
		menu2.style.backgroundColor = activeMenuBackgroundColor;
		menu2.style.color = activeMenuColor;

	};

 }
