<!--
var isSafari	= navigator.userAgent.indexOf("Safari")>=0;
var isOpera	= navigator.userAgent.indexOf("Opera")>=0;
var isGecko	= navigator.userAgent.indexOf("Gecko")>=0;
var isExplorer	= navigator.userAgent.indexOf("MSIE")>=0;
var ExplorerVersion=null;
if(isExplorer) {
	var VersionParts = navigator.appVersion.split("MSIE");
	ExplorerVersion = parseFloat(VersionParts[1]);
};

var ModalDialog; //Holds the active ModalDialog.


function Element_ByID(ElementID) {return document.getElementById?document.getElementById(ElementID):null}


function uc(Text){return Text.toUpperCase()}
function lc(Text){return Text.toLowerCase()}

function Escape(Text)	{return window.encodeURIComponent?encodeURIComponent(Text):escape(Text)}
function Unescape(Text)	{return window.decodeURIComponent?decodeURIComponent(Text):unescape(Text)}

function UnHTML(Text)	{if (typeof Text == "string") {return Text.replace(/&amp;/g,'&').replace(/#039;/g,'\'').replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&nbsp;/g,' ')} else {return "!string"}}
function UnXML(Text)	{if (typeof Text == "string") {return Text.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&apos;/g,'\'').replace(/&quot;/g,'"').replace(/&amp;/g,'&')} else {return "!string"}}

function HTML(Text)	{if (typeof Text == "string") {return Text.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/ /g,'&nbsp;')} else {return "!string"}}
function Edit(Text)	{if (typeof Text == "string") {return Text.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&nbsp;/g,' ')} else {return "!string"}}

function Trim(Text)	{if (typeof Text == "string") {return Text.replace(/^\s*|\s*$/g,"")} else {return "!string"}}






function SetHTML_Objects_ByName(Name,valueHTML)
{
	var Objects  = document.getElementsByName(Name);

	var idx;
	var obj;
	for (idx=0 ; ((idx<Objects.length) && (idx<25)) ; idx++)
	{
			obj = Objects[idx];
			obj.innerHTML=valueHTML;
	}
};



function SetValue_Objects_ByName(Name,valueHTML)
{

	var Objects  = document.getElementsByName(Name);
	var idx;
	var obj;
	for (idx=0 ; ((idx<Objects.length) && (idx<25)) ; idx++)
	{
			obj = Objects[idx];
			obj.value=valueHTML;
	}
};



function SetCheck_Objects_ByName(Name,checkedValue)
{

	var Objects  = document.getElementsByName(Name);
	var idx;
	var obj;
	for (idx=0 ; ((idx<Objects.length) && (idx<25)) ; idx++)
	{
			obj = Objects[idx];
			obj.checked=checkedValue;
	}
};

	

function SetDisplay_Objects_ByName(Name,Display)
{
	var Objects  = document.getElementsByName(Name);
	var idx;
	var obj;
	for (idx=0 ; ((idx<Objects.length) && (idx<25)) ; idx++)
	{
			obj = Objects[idx];
			obj.style.display=Display;
	}
};


function SetHREF_Objects_ByName(Name,HREF)
{
	var Objects  = document.getElementsByName(Name);
	var idx;
	var obj;
	for (idx=0 ; ((idx<Objects.length) && (idx<25)) ; idx++)
	{
			obj = Objects[idx];
			obj.href=HREF;
	}
};






function CancelBubble(EventObject)
{
	EventObject = (EventObject) ? EventObject : window.event;
	EventObject.cancelBubble = true;
	if (EventObject.stopPropagation) EventObject.stopPropagation();
}


function GetElementOffset(Element,isTop)
{
	var CurrentObject = Element; 
	var OffsetVar = "offset" + (isTop?"Top":"Left");

	//Accumulates offset of object
	var AccumulateOffset = 0;
	while (CurrentObject != null) 
	{
		AccumulateOffset += CurrentObject[OffsetVar];
		CurrentObject=CurrentObject.offsetParent
	}
	
	return AccumulateOffset;
};


function IsChildOf(Element,Parent)
{
	var CurrentObject = Element;
	while ((CurrentObject != null) && (CurrentObject!=Parent))
	{
		CurrentObject=CurrentObject.parentNode;
	}
	
	return (CurrentObject==Parent);
};





var DebugElement = Element_ByID('debug');
function Debug(Text) {DebugElement.value = DebugElement.value + Text + "\n";}
function Debug_Reset() {DebugElement.value=""};



Date.ONE_SECOND = 1000
Date.ONE_MINUTE = Date.ONE_SECOND * 60
Date.ONE_HOUR = Date.ONE_MINUTE * 60
Date.ONE_DAY = Date.ONE_HOUR * 24
function nap (m) {var then = new Date(new Date().getTime() + m); while (new Date() < then) {}}




var K_CountriesArray = [
	[0,''],
	[3,'Afghanistan'],
	[6,'Albania'],
	[59,'Algeria'],
	[12,'American Samoa'],
	[1,'Andorra'],
	[9,'Angola'],
	[5,'Anguilla'],
	[10,'Antarctica'],
	[4,'Antigua and Barbuda'],
	[11,'Argentina'],
	[7,'Armenia'],
	[15,'Aruba'],
	[14,'Australia'],
	[13,'Austria'],
	[16,'Azerbaijan'],
	[30,'Bahamas'],
	[23,'Bahrain'],
	[19,'Bangladesh'],
	[18,'Barbados'],
	[34,'Belarus'],
	[20,'Belgium'],
	[35,'Belize'],
	[25,'Benin'],
	[26,'Bermuda'],
	[31,'Bhutan'],
	[28,'Bolivia'],
	[17,'Bosnia and Herzegovina'],
	[33,'Botswana'],
	[32,'Bouvet Island'],
	[29,'Brazil'],
	[103,'British Indian Ocean Territory'],
	[27,'Brunei Darussalam'],
	[22,'Bulgaria'],
	[21,'Burkina Faso'],
	[24,'Burundi'],
	[114,'Cambodia'],
	[44,'Cameroon'],
	[36,'Canada'],
	[50,'Cape Verde'],
	[121,'Cayman Islands'],
	[38,'Central African Republic'],
	[209,'Chad'],
	[43,'Chile'],
	[45,'China'],
	[51,'Christmas Island'],
	[37,'Cocos (Keeling) Islands'],
	[46,'Colombia'],
	[116,'Comoros'],
	[39,'Congo'],
	[42,'Cook Islands'],
	[47,'Costa Rica'],
	[41,'Cote D\'Ivoire (Ivory Coast)'],
	[95,'Croatia (Hrvatska)'],
	[49,'Cuba'],
	[52,'Cyprus'],
	[53,'Czech Republic'],
	[48,'Czechoslovakia (former)'],
	[56,'Denmark'],
	[55,'Djibouti'],
	[57,'Dominica'],
	[58,'Dominican Republic'],
	[218,'East Timor'],
	[60,'Ecuador'],
	[62,'Egypt'],
	[205,'El Salvador'],
	[85,'Equatorial Guinea'],
	[64,'Eritrea'],
	[61,'Estonia'],
	[66,'Ethiopia'],
	[69,'Falkland Islands (Malvinas)'],
	[71,'Faroe Islands'],
	[68,'Fiji'],
	[67,'Finland'],
	[72,'France'],
	[73,'France, Metropolitan'],
	[78,'French Guiana'],
	[171,'French Polynesia'],
	[210,'French Southern Territories'],
	[74,'Gabon'],
	[82,'Gambia'],
	[77,'Georgia'],
	[54,'Germany'],
	[79,'Ghana'],
	[80,'Gibraltar'],
	[86,'Greece'],
	[81,'Greenland'],
	[76,'Grenada'],
	[84,'Guadeloupe'],
	[89,'Guam'],
	[88,'Guatemala'],
	[83,'Guinea'],
	[90,'Guinea-Bissau'],
	[91,'Guyana'],
	[96,'Haiti'],
	[93,'Heard and McDonald Islands'],
	[94,'Honduras'],
	[92,'Hong Kong'],
	[97,'Hungary'],
	[106,'Iceland'],
	[102,'India'],
	[98,'Indonesia'],
	[250,'International'],
	[105,'Iran'],
	[104,'Iraq'],
	[99,'Ireland'],
	[101,'Isle of Man'],
	[100,'Israel'],
	[107,'Italy'],
	[109,'Jamaica'],
	[111,'Japan'],
	[108,'Jersey'],
	[110,'Jordan'],
	[122,'Kazakhstan'],
	[112,'Kenya'],
	[115,'Kiribati'],
	[118,'Korea (North)'],
	[119,'Korea (South)'],
	[120,'Kuwait'],
	[113,'Kyrgyzstan'],
	[123,'Laos'],
	[132,'Latvia'],
	[124,'Lebanon'],
	[129,'Lesotho'],
	[128,'Liberia'],
	[133,'Libya'],
	[126,'Liechtenstein'],
	[130,'Lithuania'],
	[131,'Luxembourg'],
	[143,'Macau'],
	[139,'Macedonia'],
	[137,'Madagascar'],
	[151,'Malawi'],
	[153,'Malaysia'],
	[150,'Maldives'],
	[140,'Mali'],
	[148,'Malta'],
	[138,'Marshall Islands'],
	[145,'Martinique'],
	[146,'Mauritania'],
	[149,'Mauritius'],
	[241,'Mayotte'],
	[152,'Mexico'],
	[70,'Micronesia'],
	[136,'Moldova'],
	[135,'Monaco'],
	[142,'Mongolia'],
	[147,'Montserrat'],
	[134,'Morocco'],
	[154,'Mozambique'],
	[141,'Myanmar'],
	[155,'Namibia'],
	[255,'Nato field'],
	[164,'Nauru'],
	[163,'Nepal'],
	[161,'Netherlands'],
	[8,'Netherlands Antilles'],
	[252,'Network'],
	[165,'Neutral Zone'],
	[156,'New Caledonia'],
	[167,'New Zealand (Aotearoa)'],
	[160,'Nicaragua'],
	[157,'Niger'],
	[159,'Nigeria'],
	[166,'Niue'],
	[253,'Non-Profit Organization'],
	[158,'Norfolk Island'],
	[144,'Northern Mariana Islands'],
	[162,'Norway'],
	[254,'Old style Arpanet'],
	[168,'Oman'],
	[174,'Pakistan'],
	[181,'Palau'],
	[179,'Palestinian Territories'],
	[169,'Panama'],
	[172,'Papua New Guinea'],
	[182,'Paraguay'],
	[170,'Peru'],
	[173,'Philippines'],
	[177,'Pitcairn'],
	[175,'Poland'],
	[180,'Portugal'],
	[178,'Puerto Rico'],
	[183,'Qatar'],
	[184,'Reunion'],
	[185,'Romania'],
	[186,'Russian Federation'],
	[187,'Rwanda'],
	[87,'S. Georgia and S. Sandwich Isls.'],
	[117,'Saint Kitts and Nevis'],
	[125,'Saint Lucia'],
	[232,'Saint Vincent and the Grenadines'],
	[239,'Samoa'],
	[199,'San Marino'],
	[203,'Sao Tome and Principe'],
	[188,'Saudi Arabia'],
	[200,'Senegal'],
	[190,'Seychelles'],
	[198,'Sierra Leone'],
	[193,'Singapore'],
	[197,'Slovak Republic'],
	[195,'Slovenia'],
	[189,'Solomon Islands'],
	[201,'Somalia'],
	[243,'South Africa'],
	[65,'Spain'],
	[127,'Sri Lanka'],
	[194,'St. Helena'],
	[176,'St. Pierre and Miquelon'],
	[191,'Sudan'],
	[202,'Suriname'],
	[196,'Svalbard and Jan Mayen Islands'],
	[207,'Swaziland'],
	[192,'Sweden'],
	[40,'Switzerland'],
	[206,'Syria'],
	[222,'Taiwan'],
	[213,'Tajikistan'],
	[223,'Tanzania'],
	[212,'Thailand'],
	[211,'Togo'],
	[214,'Tokelau'],
	[217,'Tonga'],
	[220,'Trinidad and Tobago'],
	[216,'Tunisia'],
	[219,'Turkey'],
	[215,'Turkmenistan'],
	[208,'Turks and Caicos Islands'],
	[221,'Tuvalu'],
	[225,'Uganda'],
	[224,'Ukraine'],
	[2,'United Arab Emirates'],
	[75,'United Kingdom'],
	[228,'United States'],
	[229,'Uruguay'],
	[247,'US Commercial'],
	[248,'US Educational'],
	[249,'US Government'],
	[251,'US Military'],
	[227,'US Minor Outlying Islands'],
	[204,'USSR (former)'],
	[230,'Uzbekistan'],
	[237,'Vanuatu'],
	[231,'Vatican City State (Holy See)'],
	[233,'Venezuela'],
	[236,'Viet Nam'],
	[234,'Virgin Islands (British)'],
	[235,'Virgin Islands (U.S.)'],
	[238,'Wallis and Futuna Islands'],
	[63,'Western Sahara'],
	[240,'Yemen'],
	[242,'Yugoslavia'],
	[245,'Zaire'],
	[244,'Zambia'],
	[246,'Zimbabwe']
];

var K_CountriesOption_HTML;
function CreateCountrySelect()
{//Creates options for country select. Generates only once.
	if (K_CountriesOption_HTML) {return(K_CountriesOption_HTML)};
	
	//else
	var RunIndex;
	for (RunIndex=0; RunIndex<K_CountriesArray.length; RunIndex++)
	{
		K_CountriesOption_HTML += "<option value="+K_CountriesArray[RunIndex][0]+">"+K_CountriesArray[RunIndex][1]+"</option>";
	}
	
	return(K_CountriesOption_HTML);
}



function OpenDialog(URL,Name,Width,Height)
{
	var newWindow = window.open(URL, Name, 'directories=0,height='+Height+',location=0,resizable=1,scrollbars=1,toolbar=0,width='+Width+',left=25,top=25,screenX=25,screenY=25'); 
	newWindow.focus(); 
	return(false);
}



function OpenModalDialog(Title,URL,Name,Width,Height)
{
	if (!Width) {Width=500}; Element_ByID("ModalDialog_IFrame").style.width = Width;
	if (!Height) {Height=200}; Element_ByID("ModalDialog_IFrame").style.height = Height;
	if (!Title) {Title=""}; Element_ByID("ModalDialog_Title").innerHTML = Title;

	Element_ByID("ModalDialog_IFrame").src = URL;
	
	ModalDialog.render();
	ModalDialog.show();
	
}

function CloseModalDialog()
{
	Element_ByID("ModalDialog_IFrame").src = "http://www.klostu.com/blank.html";
	ModalDialog.cancel();
};


function Init()
{
	ModalDialog = new YAHOO.widget.Dialog("ModalDialog");
	ModalDialog.cfg.queueProperty("underlay","none");
	ModalDialog.cfg.queueProperty("constraintoviewport",true);
	ModalDialog.cfg.queueProperty("width","100%");
	ModalDialog.cfg.queueProperty("height","100%");
	ModalDialog.cfg.queueProperty("modal",true);	
	ModalDialog.cfg.queueProperty("fixedcenter",true);
}

-->

