﻿// ** I18N

// Calendar EN language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Encoding: any
// Distributed under the same terms as the calendar itself.

// For translators: please use UTF-8 if possible.  We strongly believe that
// Unicode is the answer to a real internationalized world.  Also please
// include your contact information in the header, as can be seen above.

// full day names
Calendar._DN = new Array
("Nedjelja",
 "Ponedjeljak",
 "Utoran",
 "Srijeda",
 "Četvrtak",
 "Petak",
 "Subota",
 "Nedjelja");

// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary.  We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
//   Calendar._SDN_len = N; // short day name length
//   Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.

// short day names
Calendar._SDN = new Array
("Ned",
 "Pon",
 "Uto",
 "Sri",
 "Čet",
 "Pet",
 "Sub",
 "Ned");

// First day of the week. "0" means display Sunday first, "1" means display
// Monday first, etc.
Calendar._FD = 1;

// full month names
Calendar._MN = new Array
("Siječanj",
 "Veljača",
 "Ožujak",
 "Travanj",
 "Svibanj",
 "Lipanj",
 "Srpanj",
 "Kolovoz",
 "Rujan",
 "Listopad",
 "Studeni",
 "Prosinac");

// short month names
Calendar._SMN = new Array
("Sij",
 "Vel",
 "Ožu",
 "Tra",
 "Svi",
 "Lip",
 "Srp",
 "Kol",
 "Ruj",
 "Lis",
 "Stu",
 "Pro");

// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "O Kalendaru";

Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Date selection:\n" +
"- Use the \xab, \xbb buttons to select year\n" +
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
"- Hold mouse button on any of the above buttons for faster selection.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Time selection:\n" +
"- Click on any of the time parts to increase it\n" +
"- or Shift-click to decrease it\n" +
"- or click and drag for faster selection.";

/*
Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
Calendar._TT["GO_TODAY"] = "Go Today";
Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
Calendar._TT["SEL_DATE"] = "Select date";
Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
Calendar._TT["PART_TODAY"] = " (today)";
*/


// tooltips

Calendar._TT["TOGGLE"] = "Promjeni dan s kojim počinje tjedan";
Calendar._TT["PREV_YEAR"] = "Prethodna godina (dugi pritisak za meni)";
Calendar._TT["PREV_MONTH"] = "Prethodni mjesec (dugi pritisak za meni)";
Calendar._TT["GO_TODAY"] = "Idi na tekući dan";
Calendar._TT["NEXT_MONTH"] = "Slijedeći mjesec (dugi pritisak za meni)";
Calendar._TT["NEXT_YEAR"] = "Slijedeća godina (dugi pritisak za meni)";
Calendar._TT["SEL_DATE"] = "Izaberite datum";
Calendar._TT["DRAG_TO_MOVE"] = "Pritisni i povuci za promjenu pozicije";
Calendar._TT["PART_TODAY"] = " (today)";
Calendar._TT["MON_FIRST"] = "Prikaži ponedjeljak kao prvi dan";
Calendar._TT["SUN_FIRST"] = "Prikaži nedjelju kao prvi dan";

// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Display %s first";

// This may be locale-dependent.  It specifies the week-end days, as an array
// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";

Calendar._TT["CLOSE"] = "Zatvori";
Calendar._TT["TODAY"] = "Danas";
Calendar._TT["TIME_PART"] = "(Shift-)Klikni i pomakni kalendar";

// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";

Calendar._TT["WK"] = "Tje";
Calendar._TT["TIME"] = "Vrijeme:";






function initCalDate(textField, callButton) {
	Calendar.setup({
		inputField     :    textField.id,      // id of the input field
		ifFormat       :    "%d.%m.%Y",       // format of the input field
		showsTime      :    false,            // will display a time selector
		button         :    callButton.id,   // trigger for the calendar (button ID)
		singleClick    :    true,           // double-click mode
		step           :    1                // show all years in drop-down boxes (instead of every other year as default)
	});
}


function initCalTime(textField, callButton) {
	Calendar.setup({
		inputField     :    textField.id,      // id of the input field
		ifFormat       :    "%d.%m.%Y %H:%M",       // format of the input field
		showsTime      :    true,            // will display a time selector
		button         :    callButton.id,   // trigger for the calendar (button ID)
		singleClick    :    true,           // double-click mode
		step           :    1                // show all years in drop-down boxes (instead of every other year as default)
	});
}

var reg;
var boxColorInvalid;
var boxColorValid;

boxColorInvalid = "#FF0000";
boxColorValid = "#FFFFFF";



function check(cId, msg) {
	if(cId.value == "")
		return true;
		
	if(cId.value.match(new RegExp(reg)) == null) {
		cId.value = "";
		cId.style.backgroundColor = boxColorInvalid;
		alert(msg);
		return false;
	}
	else {
		cId.style.backgroundColor = boxColorValid;
		return true;
	}
	
}


function isDate(cId) {
	// od 1950 do 2099 - ... ([2][0]\d{2}|[1][5-9]\d{2}) ...
	reg = /^(([1-9]|[0-2]\d|[3][0-1])\.([1-9]|[0]\d|[1][0-2])\.([2][0]\d{2}|[1][5-9]\d{2}))$|^(([1-9]|[0-2]\d|[3][0-1])\.([1-9]|[0]\d|[1][0-2])\.([2][0]\d{2}|[1][5-9]\d{2})\s([1-9]|[0-1]\d|[2][0-3])\:[0-5]\d)$/;
	return check(cId, "Nije datum!");
}