checked=false;
function checkedAll(){
	checked=(checked==false) ? true : false;
	for(i=0;i<document.getElementById('dataTab').elements.length;i++)
		document.getElementById('dataTab').elements[i].checked=checked;
}
function setv(id,v){document.getElementById(id).value=v;}
function getv(id){return document.getElementById(id).value;}
function textCounter(field,countfield,maxlimit){
	if (field.value.length > maxlimit) field.value=field.value.substring(0,maxlimit);
	else countfield.value = maxlimit - field.value.length;
}
function showHide(id,mode){
	if (mode==1) disp='none';
	else if (mode==-1) disp = '';
	else disp=document.getElementById(id).style.display;
	document.getElementById(id).style.display=(disp=='none' ? '' : 'none');
}
function xwin(URL,w,h){
	var pop; if(w==null) w=500; if(h==null) h=400;
	if (pop!=null && !pop.closed) pop.close();
	var L=(screen.width-w)/2; T=(screen.height-h)/2;
	pop=window.open(URL,'sidu','scrollbars=yes,resizable=yes,left='+L+',top='+T+',width='+w+',height='+h);
	pop.focus();
}
//$(document ).ready(function(){
//});
function cpop(id){
	$('.cpop').hide();
	box=$('#'+id);
	h=$(window).height()/2-box.height()/2;
	w=$(window).width()/2-box.width()/2;
	box.css({top:h+'px',left:w+'px',display:'block'});
}
function xpop(id){$('#'+id).hide();}

