version = navigator.appVersion.toLowerCase();
agent = navigator.userAgent.toLowerCase();
ie = (version.indexOf('msie')>-1);
win = (version.indexOf('windows')>-1);
opera = (agent.indexOf('opera')>-1);
ie50 = (version.indexOf('msie 5.0')>-1);

/* 

	Blankwin function 
	written by Alen Grakalic, provided by Css Globe (cssglobe.com)
	please visit http://cssglobe.com/post/1281/open-external-links-in-new-window-automatically/ for more info
	
*/

this.blankwin = function(){
	var hostname = window.location.hostname;
	hostname = hostname.replace("www.","").toLowerCase();
	var a = document.getElementsByTagName("a");	
	this.check = function(obj){
		var href = obj.href.toLowerCase();
		return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? true : false;				
	};
	this.set = function(obj){
		obj.target = "_blank";
		obj.className = "out";
		obj.title="Link will open in new window"
	};	
	for (var i=0;i<a.length;i++){
		if(check(a[i])) set(a[i]);
	};		
};

// script initiates on page load. 

this.addEvent = function(obj,type,fn){
	if(obj.attachEvent){
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn](window.event );}
		obj.attachEvent('on'+type, obj[type+fn]);
	} else {
		obj.addEventListener(type,fn,false);
	};
};
addEvent(window,"load",blankwin);

function goprn () {
	window.print();
}

/**
 * global language specific configuration
 */
var cfg = {};

cfg.imgUrl = "/img/design";

cfg.homePageUrl = "/en/"; 

cfg.printPageHtml = '<a href="javascript:goprn();" title="Print page"><img src="' + cfg.imgUrl + '/ico-print.gif" width="17" height="13" alt="Print"></a>';

cfg.increaseFontHtml = '<a href="#"><img src="' + cfg.imgUrl + '/ico-plus.gif" width="17" height="12" alt="Maximize" /></a>';
cfg.increaseFontMultiplier = 1.1;
	
cfg.decreaseFontHtml = '<a href="#"><img src="' + cfg.imgUrl + '/ico-minus.gif" width="14" height="12" alt="Minimize" /></a>';
cfg.decreaseFontMultiplier = 0.9;

cfg.cidDownload = {};
cfg.cidDownload.id = 'cidDownload';
cfg.cidDownload.title = 'The use of the logo and of the uniform visual style (UVS) of the Czech EU Presidency is subject to the following conditions:<ul><li>The logo and the UVS may be used solely for the purpose to inform and promote the Czech EU Presidency in 2009. Neither the logo nor the UVS may be used for commercial purposes, for one’s own promotion or for the promotion of products or services.</li><li>The logo and the UVS may be used exclusively in a manner complying with the graphic manual of the UVS. The logo, UVS and individual elements of the UVS may not be changed or modified, nor used in any way degrading its value.</li></ul><strong>In case of breach of the conditions set out for the use of the logo and the uniform visual style, the Office of the Government of the Czech Republic is entitled to seek correction in accordance with § 40 ff. of Act No. 121/2000 Sb. (Coll.) on copyright law</strong>';
cfg.cidDownload.chkLabel = '<span style="color:red">I agree with the conditions for the use of the logo and the uniform visual style and undertake to inform all persons that I provide with the logo or the uniform visual style about these conditions.</span>';
cfg.cidDownload.failMessage = 'To download the manual, you must first accept the terms and conditions of usage.';
cfg.cidDownload.links = [
	{
		href:    "/scripts/file.php?id=3434&amp;down=yes",
		label:   "Logotype manual, basic use of the logo (pdf, 6658&nbsp;kB)",
		icon:    "/img/icons/pdf.gif",
		iconAlt: "pdf"
	}, {
		href:    "/scripts/file.php?id=3433&amp;down=yes",
		label:   "Presidency logo, in eps format (zip, 259&nbsp;kB)",
		icon:    "/img/icons/zip.gif",
		iconAlt: "zip"
	}
];

cfg.msg = {
	checkAtLeastOneLanguage: 'Please choose at least one language to receive messages in.',
	enterEmail: 'Please insert an e-mail address into the "{0}" field.',
	correctEmail: 'There might be a typing error in the e-mail address you inserted into the "{0}" field. Please insert a correct e-mail address to receive messages from us.',
	enterPhoneNumber: 'Please insert a telephone number into the "{0}"field.',
	correctPhoneNumber: 'There might be a typing error in the telephone number you inserted into the "{0}" field. Please insert a correct telephone number, so we can contact you.',
	enterValue: 'The "{0}" field is obligatory, please fill it in.'
}

/**
 * jQuery UI datepicker config
 */
/* English initialisation for the jQuery UI date picker plugin. */
/* Written by Tomas Muller (tomas@tomas-muller.net). */	
cfg.datepicker = {
	buttonImageUrl: cfg.imgUrl + "/cal.gif",
	buttonText: "Choose a date",
	language: 'en',
	today: "Today",
	next7days: "Upcoming 7 days",
	next30days: "Upcoming 30 days",
	term: "First semester of 2009"
};