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

function image_open(image_loc,img)
{
  HTML = "<html><style>body{margin:0px 0px 0px 0px}</style><body onBlur='top.close()'><img src='"+ image_loc +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width,document.load_image.height)'></body></html>";
  popupImage = window.open('','_blank','toolbar=no,scrollbars=no');
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
  obj_img = document.getElementById(img);

}

function getDate(day, month, year)
{
	month--;
	document.availForm.datemonth.value = month;
	document.availForm.dateday.value = day;
	document.availForm.dateyear.value = year;
} 

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 show_photo(what,imag,photo) {
	document.images[imag].src=photo;
	//document.getElementById("thetitle").value = thtitle;
}

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 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;
}

function showVac() {
 	if (document.getElementById) {
 		document.getElementById("vacancies").style.display = "block";
 		document.getElementById("mvac").className = 'top_links_back_over_c';
 		document.getElementById("hotels").style.display = "none";
 		document.getElementById("mhotels").className = 'top_links_back_c';
 	}
 }
 
function showHotels() {
 	if (document.getElementById) {
 		document.getElementById("hotels").style.display = "block";
 		document.getElementById("mhotels").className = 'top_links_back_over_c';
 		document.getElementById("vacancies").style.display = "none";
 		 document.getElementById("mvac").className = 'top_links_back_c';
 	}
 }




