function roll_over(img_name, img_src) {
   document[img_name].src = img_src;
}
function roll_out(img_name, img_src) {
   document[img_name].src = img_src;
}

function toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}


function CheckMsgLenght() {

}

function checkBlogComment() {
		nume = document.blogcomment.username.value;
		subj = document.blogcomment.subj.value;
		comm = document.blogcomment.comm.value;

		if(nume == '' || subj == '' || comm == '') {
			alert('Toate campurile sunt obligatorii');
		}
		else {
			document.blogcomment.submit();
		}
}

function newBlogEntryCheck() {
	titlu = document.newBlogEntry.titlku.value;
	categ = document.newBlogEntry.categ.value;	

	if(titlu == '' || categ == '') {
		alert('Toate campurile sunt obligatorii');
	}
	else {
		document.newBlogEntry.submit();
	}
}

function checkNewNrForm() {
		titlu = document.add_numar.tag.value;
		ziua = document.add_numar.data_zi.value;
		luna = document.add_numar.data_luna.value;
		anul = document.add_numar.data_an.value;
		cover = document.add_numar.cover.value;
		
		if(titlu == '' || ziua == '' || luna == '' || anul == '' || cover == '') {
			alert('Nu ati completat toate datele necesare adaugarii unui numar nou...');
		}
		else {
			document.add_numar.submit();
		}
		
}

function checkAddSubcap() {
		titlu = document.addsubcap.titlu.value;
		subtitlu = document.addsubcap.subtitlu.value;
		ordine = document.addsubcap.ordine.value;
		
		if(titlu == '' || subtitlu == '' || ordine == '') {
				alert('Toate campurile sunt obligatorii');
		}
		else {
				document.addsubcap.submit();
		}
}