/*
Javascript Functions - Global functions
					- Local funcitons described on individual tpl.html pages within <script></script> tags
*/



function open_win(page,wid,hei,name) { // otevre nove okno s obrazkem
	if (wid == '') {
		wid = '600';
	}
	if (hei == '') {
		hei = '400';
	}
	if (name == '') {
		name = 'image';
	}
	new_window = window.open(page,name,'width='+wid+',height='+hei+',alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=20,top=20');
}

function open_win_scroll(page,wid,hei) { // otevre nove okno s obrazkem
	if (wid == '') {
		wid = '600';
	}
	if (hei == '') {
		hei = '400';
	}
	new_window = window.open(page,'window','width='+wid+',height='+hei+',scrollbars=1,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=20,top=20');
}




function confirmSubmit(text) {
	var agree = confirm(text);
	if (agree) {
		return true;
	} else {
		return false;
	}
}

function checkBlank(frm){
	var rtn = false;
	if(frm.elements['nameTxt'].value != '') rtn = true;
	
	return rtn;
}

function emailChecker(strng){
	var emailFilter=/^.+@.+\..{2,3}$/;
	var error = '';
	if (!(emailFilter.test(strng))) { 
	       error = "Please enter a valid email address.\n";
	}
	
	//Again, we want to check to make sure that no forbidden characters have slipped in. For email addresses, we're forbidding the following: ( ) < > [ ] , ; : \ / "
	
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
	if (strng.match(illegalChars)) {
	   error = "The email address contains illegal characters.\n";
	}
	
	if(error=='') return true;
	return false;
}

