function selectAll(theField) {

var tempval=eval("document."+theField)

tempval.focus()

tempval.select()

}

function checkBrowser(){

	this.ver=navigator.appVersion

	this.dom=document.getElementById?1:0

	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;

	this.ie4=(document.all && !this.dom)?1:0;

	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;

	this.ns4=(document.layers && !this.dom)?1:0;

	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)

	return this

}

bw=new checkBrowser()

function showhide(div,nest){

	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 

	if(obj.display=='block' || obj.display=='block') obj.display='none'

	else obj.display='block'
	
}

function show(div,nest){

	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 

	obj.display='block'

}

function hide(div,nest){

	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 

	obj.display='none'

}

function changeColor(id, bflag) {
	if(bflag) {
		document.getElementById(id).style.backgroundColor = "#cacaca";
	}
	else {
		document.getElementById(id).style.backgroundColor = "#f2f2f2";
	}
}

function popup(img, title, matmenys, year, id, rid) {
	width = 0;
	height = 0;
	if(id == 6) {
		width = 600;
		height = 800;
	}
	else {
		width = 460;
		height = 460;
	}
	window.open('popup.php?img='+img+'&title='+title+'&matm='+matmenys+'&year='+year+'&id='+id+'&rid='+rid, 'Press', 'toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,width='+width+'px,height='+height+'px');
}

function newsPopUp(myname, id, w, h){
 var win= null;
 var winl = (screen.width-w)/4;
 var wint = (screen.height-h)/4;
 var settings  ='height='+h+',';
     settings +='width='+w+',';
     settings +='top='+wint+',';
     settings +='left='+winl+',';
     settings +='scrollbars=yes,';
     settings +='resizable=no';
 win = window.open('newsPUp.php?id='+id, myname, settings);
}

function editEntry(myname, id, lg, tp, w, h){
 var win= null;
 var winl = (screen.width-w)/4;
 var wint = (screen.height-h)/4;
 var settings  ='height='+h+',';
     settings +='width='+w+',';
     settings +='top='+wint+',';
     settings +='left='+winl+',';
     settings +='scrollbars=yes,';
     settings +='resizable=no';
 win = window.open('edit.php?id='+id+'&lg='+lg+'&edt='+tp, myname, settings);
}

//function enter(event) {
	//if (event.keyCode==13) {
		//var textarea = document.getElementById('text');
		//textarea.value = textarea.value +'<br />';
		//alert(event.keyCode);
	//}
//}
