/* ==============================Admin Functions==============================This Javascript cucumber was pickled by:>> Robin Wallar at Fathom Solutions>> www.fathomsolutions.ca | robin [at] fathomsolutions {dot} ca------------------------------Written with massive mits on while scraping ice of the screenof my icicle that serves as a monitor. ------------------------------------------------------------Feel free to use this to educateyourself on the wonders of javascript.If you plan on copying something directly please contact us. ------------------------------*/	  function load_admin(div, url_in){	height = gebi(div).offsetHeight + 100 + 'px';	var url = url_in + '&height=' + height;	window.location.href = url;	//ajax(url, div);}function ajax_load_admin(div, url_in){	height = gebi(div).offsetHeight + 100 + 'px';	var url = url_in + '&height=' + height;	ajax(url, div);}function overlay(mode){	var redirect = 'admin.php?mode=' + mode ;	show_div('overlay');	ajax(redirect, 'overlay_content', 1);		return false;}	/*ajax tiny mce  start*//*load the editing toolbar */var editors_opened = new Array();var i_editors = 1;/*this will active the tinyMce command and close existing tiny instances*/function edit_text(id){	gebi('container').style.marginTop = "88px";		/*only add to the array of opened  (or in other words existing) divs if hasn't already been opened*/	if(this.editors_opened.indexOf(id)==-1)	{		this.editors_opened[this.i_editors] = id;	}	var len = this.editors_opened.length;	/*use this to close other ones*/		/*close existing elements*/	for(i=1; i<len; i++)	{			if(gebi(this.editors_opened[i])!=null && this.editors_opened[i]!=id)/*only close "real" ones and do no close it if it is the one you are trying to open*/		{			exit_editor(this.editors_opened[i]);		}	}		gebi(id).style.height = '250px';		var edit_id = 'edit_' + id;	show_div(edit_id); /*show the save and exit buttons*/	tinyMCE.execCommand('mceAddControl', false, id); /*instantiate the tiny class on the appropriate div*/	this.i_editors++;}/*submit the form*/function save_text(id){				var edit_id = 'edit_' + id;	gebi(id + '_form').value = tinyMCE.getContent();	gebi('form_id_'+id).submit();}/*exit the form&*/function exit_editor(id){	if(gebi(id)!=null)	{		var edit_id = 'edit_' + id;		hide_div(edit_id); /*hide the save and exit buttons */		tinyMCE.execCommand('mceRemoveControl', false, id);	}}/*ajax tinymce  end *//*set a hidden field to true so files are delete*/function start_upload(id){		gebi(id).className="";	return false;}/*set a hidden field to true so files are delete*/function stop_upload(id, url){		window.top.gebi(id).style.overflow = "hidden";	window.top.gebi(id).style.visibility = "hidden";	tabs(url, 'admin_tabs_loader', 'admin_tabs[]', '-1');}function add_hover(id){	gebi(id).style.overflow = "visible";	gebi(id).style.visibility = "visible";	gebi(id).className = "admin_file_list_add";}function edit_hover(id){	gebi(id).style.overflow = "visible";	gebi(id).style.visibility = "visible";	gebi(id).className = "admin_file_list_edit";}function edit_file(url){	ajax(url, 'admin_tabs_loader');}function return_file(id, inform, element_name){	inform.elements[element_name].value = id;	hide_div('overlay');		/*show the file information*/	window.top.gebi(inform.getAttribute('name') + element_name).className = '';			var url = 'admin.php?mode=form_file_item&id=' + id + '&form_name='+ inform.name + '&element_name='+ element_name;	ajax(url, inform.getAttribute('name') + element_name);	window.top.gebi(inform.getAttribute('name') + element_name + '_add').className = 'hide';}function remove_file(inform, element_name){	inform.elements[element_name].value = '';		/*hide the file information*/	window.top.gebi(inform.getAttribute('name') + element_name).className = 'hide';	window.top.gebi(inform.getAttribute('name') + element_name + '_add').className = 'add_file';	return false;}function open_file_manager(mode, form_name, element_name){	var redirect = 'admin.php?mode=' + mode + '&form_name='+ form_name + '&element_name='+ element_name;	show_div('overlay');	ajax(redirect, 'overlay_content');	return false;}	function logout(url){		var do_logout = confirm_do("Are you sure you want to logout?");		if(do_logout)	{		window.location.href = url + '&logout=1';	}	}function file_update_form_value(fname, f){	f.elements[fname + 'file_value'].value = f.elements[fname].value}var sfd_file_field="sfd_file_list";/*use this to assign file to the img field*/function seefundo(input){	gebi('src').value = input;	/*append the path*/	ImageDialog.showPreviewImage(input);}/***************Mini-Cal Functions****************/var date_field;var submit_field;var mini_cal_id;var prev_mini_cal_id;function assign_mini_value(input_visible, input_submit){	this.date_field.value = input_visible;		this.submit_field.value = input_submit;		document.getElementById(this.mini_cal_id).innerHTML = "";}function mini_close(){	document.getElementById(this.mini_cal_id).innerHTML = "";}function mini_cal(url, div, inform, element_name){	if(this.prev_mini_cal_id!=null)	{		gebi(this.prev_mini_cal_id).innerHTML = "";	}		this.prev_mini_cal_id = div;	this.date_field=inform.elements[element_name + "_visible"];	this.submit_field=inform.elements[element_name];	this.mini_cal_id = div;	ajax(url, div);}