function openEvent(id){
  w = window.open('showevent.php?id='+id,'event'+id,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=500');
}

function objSetStyle (obj,prop,val) {
 		obj.style.cursor = 'hand';
		var tmp = document.getElementById('menuColor').currentStyle.backgroundColor;
		if (tmp != obj.bgColor) {
			obj.bgColor = tmp;
		} else {obj.bgColor = "";}
}

/*
var t = document.getElementById('igor');
		// t.currentStyle.color = "yellow";
		alert(t.currentStyle.color);
*/

function callUrl (val) {
 		window.location.href = val;
		
}


function delete_record(url,string) {
	var where_to = confirm("Do you really want to delete this record?\r\n" + string);
	if (where_to == true) {
		window.location = url;
	}
}

function required_fields (f,fields_string,submit_page) {

	fields = fields_string.split(",");
	
	var re = /^(\w|[^_]\.|[\-])+((\@){1}([^_]))(([a-z]|[\d]|[\-]|\.)+|([^_]\.[^_])*)+\.[a-z]{2,6}$/;	
	
	submit_form = true;

	for (var i=0;i < fields.length;i++) {
		field_name = fields[i];
		if (field_name=="email") {
			if (!re.test(f.elements[field_name].value)) {
				submit_form = false;
				message ="\nWrong email address!";
			}
		} else {
			if (f.elements[field_name].value==""){
				submit_form = false;
				message ="Please fill out required fields!";
			}
		}
	}

	if (submit_form == true) {
		f.action = submit_page;
		f.submit();
	} else {
		alert(message);
	}

}


function Go_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function New_Window(name,url,scrollbars,toolbar,location,status,menubar,resizable,width,height,left,top) {
	var properties = "scrollbars=" + scrollbars + ",toolbar=" + toolbar + ",location=" + location + ",status=" + status + ",menubar=" + menubar + ",resizable=" + resizable + ",width=" + width + ",height=" + height + ",left=" + left + ",top=" + top;
 	window.open(url,name,properties);
}

 
function media(url) {
     url = "media.php?media=" + url;
         window.open(url,"media","toolbar=0,location=0,status=0, menubar=0,scrollbars=1,resizable=1,width=400,height=200");
}
