var password_window = window;

function get_password_window(page, path) {
	var i_width = 354;
	var i_height = 330;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = 'get_password.php';
	password_window = window.open(s_url, 'passwordwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=no,status=yes,left='+i_left+',top='+i_top);
}

function on_submit() {
	if (password_window.closed == false)
		password_window.close();

	return true;
}


/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function set_cookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function get_cookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
        begin += 2;
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
        end = dc.length;
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function delete_cookie(name, path, domain) {
    if (getCookie(name))     {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

var navigation_disabled = false;

function navigate(i_nav_id, s_url) {
	if (typeof(dont_save) != "undefined") {
		if (dont_save) {
			return;
		}
		dont_save = true;
	}
	if (typeof(navigation_disabled) != "undefined") {
		if (navigation_disabled == true) {
			return;
		}
	}
	if (i_nav_id > 0) {
		if(typeof s_url != 'undefined' && s_url != '')
			document.getElementById('next_url').value = s_url;

		document.getElementById('next_nav_id').value = i_nav_id;
		document.post.submit();
	}
	else {
		document.location.href = s_url;
	}
}

function block_navigation(status) {
	//console.log('block_navigation', status);
	if (typeof(status) != 'boolean')
		return;

	nav = jQuery('[name=navigation]');

	if (status == true) {
		navigation_disabled = status;
		nav.each(function(index, element){
			jQuery(element).hide();
		});
	}

	if (status == false) {
		navigation_disabled = status;
		nav.each(function(index, element){
			jQuery(element).show();
		});

	}
}

function show_help_popup(id, path) {
	var i_width = 900;
	var i_height = 600;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=help&id=' + id, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function show_admin_help_popup(id, path) {
	var i_width = 800;
	var i_height = 600;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=adminhelp&id=' + id, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function show_faq_help_popup(id, path) {
	var i_width = 800;
	var i_height = 620;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=faq&id=' + id, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function show_export_help_popup(id, path) {
	var i_width = 500;
	var i_height = 320;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=export&id=' + id, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}
function show_export_preview_popup(pic, path) {
	var i_width = 600;
	var i_height = 500;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=export_pic&pic=' + pic, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function show_faq_help_abstract_popup(id, path) {
	var i_width = 800;
	var i_height = 620;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=faq_abstract&id=' + id, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function show_rating_help_popup(id, path) {
	var i_width = 800;
	var i_height = 600;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=ratinghelp&id=' + id, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}
function show_rating_help_popup_old(id, path) {
	var i_width = 800;
	var i_height = 600;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=ratinghelp_old&id=' + id, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}
function show_itinerary_help_popup(id, path) {
	var i_width = 800;
	var i_height = 600;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=itineraryhelp&id=' + id, 'helpwindow', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function show_termsandconditions(path) {
	var i_width = 659;
	var i_height = 480;

	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(path + 'popup.php?page=termsandconditions', 'tandc', 'width='+i_width+',height='+i_height+',resizeable=no,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function hide_mediafile(i_mediafile_id, i_mediafile_group_id) {
	document.getElementById('hide_mediafile_id').value = i_mediafile_id;
	document.getElementById('hide_mediafile_group_id').value = i_mediafile_group_id;
	document.post.submit();
}

function open_mesh_browser(s_tree_nr) {
	var i_width = 640;
	var i_height = 480;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../../popup/popup.php?page=mesh_browser&tree_nr=' + s_tree_nr;

	window.open(s_url, 'meshbrowser', 'width='+i_width+',height='+i_height+',left='+i_left+',top='+i_top+',dependent=yes,resizeable=yes,scrollbars=yes,status=no');
}

function open_disclosure_popup(person_id, path, relation_id, relation_type_id) {
	var i_width = 900;
	var i_height = 680;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = path + 'popup.php?page=disclosure&person_id=' + person_id;

	if(arguments.length > 2)
		s_url += "&relation_id=" + relation_id;
	if(arguments.length > 3)
		s_url += "&relation_type_id=" + relation_type_id;
	if(arguments.length > 4)
		s_url += "&session_id=" + arguments[3];
	if(arguments.length > 5 && arguments[5] > -1)
		s_url += "&pos=" + parseInt(arguments[5]);

	window.open(s_url, 'disclosure', 'width='+i_width+',height='+i_height+',resizeable=yea,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_disclosure_view_popup(person_id, path, relation_id, relation_type_id) {
	var i_width = 900;
	var i_height = 680;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = path + 'popup.php?page=disclosure&viewonly=1&person_id=' + person_id;

	if(arguments.length > 2)
		s_url += "&relation_id=" + relation_id;
	if(arguments.length > 3)
		s_url += "&relation_type_id=" + relation_type_id;
	if(arguments.length > 4)
		s_url += "&session_id=" + arguments[3];
	if(arguments.length > 5 && arguments[5] > -1)
		s_url += "&pos=" + parseInt(arguments[5]);

	window.open(s_url, 'disclosure', 'width='+i_width+',height='+i_height+',resizeable=yea,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_payment_popup(publication_id, person_id) {
	var i_width = 860;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../../popup/popup.php?page=payment&publication_id=' + publication_id + '&person_id=' + person_id;

	if(arguments.length > 1)
		s_url += "&session_id=" + arguments[1];
	if(arguments.length > 2 && arguments[2] > -1)
		s_url += "&pos=" + parseInt(arguments[2]);

	window.open(s_url, 'payment', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_category_pdf_popup() {
	var i_width = 860;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../../popup/popup.php?page=category_pdf';

	if(arguments.length > 1)
		s_url += "&session_id=" + arguments[1];
	if(arguments.length > 2 && arguments[2] > -1)
		s_url += "&pos=" + parseInt(arguments[2]);

	window.open(s_url, 'category_pdf', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_review_instructions_popup(role) {
	var i_width = 860;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../popup/popup.php?page=review_instructions&role=' + role;

	if(arguments.length > 1)
		s_url += "&session_id=" + arguments[1];
	if(arguments.length > 2 && arguments[2] > -1)
		s_url += "&pos=" + parseInt(arguments[2]);

	window.open(s_url, 'payment', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_category_pdf_popup() {
	var i_width = 860;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../../popup/popup.php?page=category_pdf';

	if(arguments.length > 1)
		s_url += "&session_id=" + arguments[1];
	if(arguments.length > 2 && arguments[2] > -1)
		s_url += "&pos=" + parseInt(arguments[2]);

	window.open(s_url, 'category_pdf', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_review_instructions_popup(role) {
	var i_width = 860;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../popup/popup.php?page=review_instructions&role=' + role;

	if(arguments.length > 1)
		s_url += "&session_id=" + arguments[1];
	if(arguments.length > 2 && arguments[2] > -1)
		s_url += "&pos=" + parseInt(arguments[2]);

	window.open(s_url, role + '_instructions', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_publication_renumber_popup(pub_ids) {
	var i_width = 900;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../../popup/popup.php?page=publication_renumber&pub_ids=' + pub_ids;
	window.open(s_url, 'posters', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_link(link) {
	var i_width = 900;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	window.open(link, 'link', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_poster_print_invoice(order_id, path) {
	var i_width = 900;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = path + 'popup/popup.php?page=poster_print_invoice&order_id=' + order_id;
	window.open(s_url, 'posters', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_poster_print_pickup(order_id, path) {
	var i_width = 900;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = path + 'popup/popup.php?page=poster_print_pickup&order_id=' + order_id;
	window.open(s_url, 'posters', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_poster_print_instructions() {
	var i_width = 900;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../popup/popup.php?page=poster_print_instructions';
	window.open(s_url, 'posters', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_poster_print_templates() {
	var i_width = 900;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../popup/popup.php?page=poster_print_templates';
	window.open(s_url, 'posters', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function open_poster_print_uploaded_file(file_name, path) {
	var i_width = 900;
	var i_height = 600;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = path + 'popup/popup.php?page=poster_print_uploaded_file&file_name=' + file_name;
	window.open(s_url, 'posters', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

/*
function mediafile_browser() {
	var i_width = 640;
	var i_height = 480;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../../popup/popup.php?page=mediafile_browser&thumbs_only=true';
	var mediafilebrowser = window.open(s_url, 'mediafilebrowser', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}
*/

function edit_mediafile(id) {
	var i_width = 640;
	var i_height = 480;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../../popup/popup.php?page=edit_mediafile&edit=true&id=' + id;
	window.open(s_url, 'mediafile_group', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function edit_mediafile_group(id) {
	var i_width = 640;
	var i_height = 480;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = '../../popup/popup.php?page=edit_mediafile_group&id=' + id;
	window.open(s_url, 'mediafile_group', 'width='+i_width+',height='+i_height+',resizeable=yes,scrollbars=yes,status=yes,left='+i_left+',top='+i_top);
}

function view_mediafile(i_id, s_type, rootpath) {
	var rootpath = (rootpath == null) ? '../../' : rootpath;
	var i_width = 200;
	var i_height = 200;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;
	var s_url = rootpath + 'popup/popup.php?page=mediafile&id=' + i_id + '&type=' + s_type;
	window.open(s_url, 'viewmedia'+i_id, 'width='+i_width+',height='+i_height+',left='+i_left+',top='+i_top+',resizeable=no,scrollbars=yes,status=no');
}

function insert_placeholder(placeholder, el) {
	el.value += '[:' + placeholder + ':] ';
}

function add_person_popup() {
	var i_width = 700;
	var i_height = 620;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;

	var s_url = '../../popup/popup.php?page=person';
	window.open(s_url, 'add_person', 'width='+i_width+',height='+i_height+',left='+i_left+',top='+i_top+',resizeable=yes,scrollbars=yes,status=yes');
}

function edit_person_popup(id, affiliation_manager) {
	var i_width = 700;
	var i_height = 620;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;

	var s_url = '../../popup/popup.php?page=person&person_id=' + id; // + '&publication_id=' + publication_id;
	if(arguments.length > 1)
		s_url += "&affiliation_manager=" + affiliation_manager;

	window.open(s_url, 'add_person', 'width='+i_width+',height='+i_height+',left='+i_left+',top='+i_top+',resizeable=yes,scrollbars=yes,status=yes');
}

function open_publication_preview(id) {
	var i_width = 480;
	var i_height = 640;
	var i_left = (screen.availWidth - i_width) / 2;
	var i_top = (screen.availHeight - i_height) / 2;

	var s_url = '../../popup/popup.php?page=rate_publication_view&id=' + id;
	window.open(s_url, 'pubprev' + id, 'width='+i_width+',height='+i_height+',left='+i_left+',top='+i_top+',resizeable=yes,scrollbars=yes,status=yes,dependent=no');
}


function getnrasstring(pos) {
	var postfix = "th";
	switch(pos) {
		case 1: postfix = "st"; break;
		case 2: postfix = "nd"; break;
		case 3: postfix = "rd"; break;
		default: break;
	}
	return pos + "<sup>" + postfix + "</sup>";
}

// DATE CHECK FUNCTIONS
// Usage: if(!isDate(dtStr)) { alert("ERROR"); }
// Declaring valid date character, minimum year and maximum year
var dtCh= ".";
var minYear=1900;
var maxYear=2100;
// Declaring error messages
var date_wrong_format = "The date format should be: dd" + dtCh + "mm" + dtCh + "yyyy";
var date_wrong_month = "Please enter a valid month";
var date_wrong_year = "Please enter a valid 4 digit year between "+minYear+" and "+maxYear;
var date_wrong_day = "Please enter a valid day";
var date_invalid = "Please enter a valid date";

function isInteger(s){
	var i;
	for (i = 0; i < s.length; i++){
		// Check that current character is number.
		var c = s.charAt(i);
		if (((c < "0") || (c > "9"))) return false;
	}
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){
        var c = s.charAt(i);
		if (bag.indexOf(c) == -1) returnString += c;
	}
	return returnString;
}

function daysInFebruary(year){
	// February has 29 days in any year evenly divisible by four,
	// EXCEPT for centurial years which are not also divisible by 400.
	return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
	}
	return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert(date_wrong_format)
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert(date_wrong_month)
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert(date_wrong_day)
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert(date_wrong_year)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert(date_invalid)
		return false
	}
	return true
}

function array_indexof(array_var, search_var) {
	for (i = 0; i < array_var.length; i++) {
		if (array_var[i] == search_var)
			return i;
	}
	return -1;
}

function set_pagination(s_page_number_field_name, i_page_number, s_res_per_page_field_name, i_results_per_page, s_form_name, b_submit, s_submit_action) {
	var o_form = eval('document.' + s_form_name);
	var o_page_number = eval('document.' + s_form_name + '.' + s_page_number_field_name);
	o_page_number.value = i_page_number;
	var o_rpp = eval('document.' + s_form_name + '.' + s_res_per_page_field_name);

	var i_old_results_per_page = parseInt(o_rpp.value);

	i_results_per_page = parseInt(i_results_per_page);
	if (isNaN(i_results_per_page))
		i_results_per_page = i_old_results_per_page;

	if (i_results_per_page!=i_old_results_per_page) {
		o_page_number.value = 1;
	}

	o_rpp.value = i_results_per_page;

	if (b_submit) {
		if (s_submit_action=='')
			o_form.submit();
		else
			eval(s_submit_action);
	}
}

function set_dosearch()
{
	document.getElementById('dosearch_2').value = 'show';
	var o_form = document.forms[0];
	o_form.submit();
}

function loadComplete() {
	document.getElementById('loader').style.display = 'none';
}

function is_hidden(element){
	if (element.style.display == 'none')
		return true;
	else
		return false;
}
function show(element){
	element.style.display = '';
}
function hide(element){
	element.style.display = 'none';
}

