var current_pic= "photo_125";
var current_border= "thumb_125";
var main_image = new Array();
function showhide(myId) {
	if (document.getElementById) {
		state = document.getElementById(myId).style.display;
		if (state == 'block') {
			hide(myId);
		} else {
			show(myId);
		}
	}
}
//shows an id
function show(myId) {
	if (document.getElementById(myId)) {
		document.getElementById(myId).style.display = 'block';

	}
	current_pic=myId;
}

function set_border(myId,current_border) {

	if (document.getElementById(current_border)) {
					document.getElementById(current_border).style.border ='1px solid #FFF';
	}	
	if (document.getElementById(myId)) {
					document.getElementById(myId).style.border = '1px solid #369';

	}	
	current_border=myId;
	return current_border;	
}



function show_submenu(hidelist,showid) {
	var temp = new Array();
	temp =hidelist.split(',');
	var len = temp.length;
	for (var n=0;n<len;n++) {
		var theid="sub_menu_"+temp[n];
		if (document.getElementById(theid)) {
			document.getElementById(theid).style.display = 'none';			
		} else {
//			alert(theid+"not found");
		}
	}
	var theshowid="sub_menu_"+showid;
	if (document.getElementById(theshowid)) {
			document.getElementById(theshowid).style.display = 'block';			
	}
}
function show_heading(myId) {
	document.getElementById('about_us_left_heading').style.display = 'block';
	document.getElementById('events_left_heading').style.display = 'block';
	document.getElementById('leaders_left_heading').style.display = 'block';
	if (document.getElementById('ministries_left_heading')) {
		document.getElementById('ministries_left_heading').style.display = 'block';
	}
	document.getElementById('resources_left_heading').style.display = 'block';
	document.getElementById('teams_left_heading').style.display = 'block';
	document.getElementById('international_left_heading').style.display = 'block';


}
//hides an id
function hide(myId) {
//	alert(myId);
	if (document.getElementById(myId)) {
		document.getElementById(myId).style.display = 'none';
	}
}

function change_background(myId) {
	if (document.getElementById) {
		var my_element=	document.getElementById(myId);
		my_element("li").style.backgroundImage="url(/images/overview_corner.png)";
	}
}

function check_delete(id_list,page,section) {
         if (confirm("Are you sure you want to delete this row?")){
                 document.location = "index.php?delete_row="+id_list+"&page="+page+"&section="+section+"&edit=true";
         }
}
function check_merge(id_list,page,section) {
         if (confirm("Are you sure you want to merge the content of this row?")){
                 document.location = "index.php?merge_row="+id_list+"&page="+page+"&section="+section+"&edit=true";
         }
}
function check_add(id_list,page,section) {
         if (confirm("Are you sure you want to add a column to this row?")){
                 document.location = "index.php?add_column="+id_list+"&page="+page+"&section="+section+"&edit=true";
         }
}
function image_browser(id,page,section) {
         window.open('/admin/images.php?id='+id+'&page='+page+'&section_id='+section+'&template=browser','Image Browser')
}
function submitform(thisform) {
			document.getElementById(thisform).submit();
}
function MM_jumpMenu(targ,selObj,restore,url,app,show,action,lang){ 
  eval(targ+".location='"+url+"/"+app+"?action="+action+"&lang="+lang+"&show="+show+"&id="+selObj.options[selObj.selectedIndex].value+"&change=Change+Section'");
  if (restore) selObj.selectedIndex=0;
}
-->