function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var newWindow
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+','
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	win.focus();
}


function submitTheForm(){
	document.forms.Form1.elements.inpContent.value = oEdit1.getHTMLBody();
	document.forms.Form1.elements.inpContent2.value = oEdit2.getHTMLBody();
	document.forms.Form1.submit()
}

function checkAll( n, fldName ) {
  if (!fldName) {
     fldName = 'cb';
  }
	var f = document.adminForm;
	var c = f.toggle.checked;
	var n2 = 0;
	for (i=0; i < n; i++) {
		cb = eval( 'f.' + fldName + '' + i );
		if (cb) {
			cb.checked = c;
			n2++;
		}
	}
	
	if (c) {
		document.adminForm.boxchecked.value = n2;
	} else {
		document.adminForm.boxchecked.value = 0;
	}
}

function submitbutton(pressbutton) {
	submitform(pressbutton);
}

function isChecked(isitchecked){
	if (isitchecked == true){
		document.adminForm.boxchecked.value++;
	}
	else {
		document.adminForm.boxchecked.value--;
	}
}

function submitform(pressbutton){
	document.adminForm.action.value=pressbutton;
	try {
		document.adminForm.onsubmit();
		}
	catch(e){}
	document.adminForm.submit();
}

function NewWindow(mypage, myname, w, h, scroll) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		var newWindow
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+','
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
		win.focus();
	}
	
		
function clearALl() {
	document.getElementById("dat").value="";
	}

function reload(form,path)
{
var val=form.cat.options[form.cat.options.selectedIndex].value;
self.location=path + '.php?action=add&cat=' + val ;
}

function ordby(form,path)
{
var val=form.section_id.options[form.section_id.options.selectedIndex].value;
self.location=path + '.php?action=edit&section_id=' + val ;
}

function ordbycat(form,path,sect_id)
{
var val=form.cat_id.options[form.cat_id.options.selectedIndex].value;
self.location=path + '.php?action=edit&section_id='+sect_id+'&cat_id='+val ;
}

function deteImage(path,img)
{
self.location=path + '.php?action=deletephoto&id=' + img ;
}

function deteImageParent(path,sect_id,img,entr_id)
{
self.location=path + '.php?action=deletephoto&section_id='+sect_id+'&cat_id='+img+'&id='+entr_id;
}



