function init(){
}
function showPopup(){
	if(show_popup == 1){
		window.open(popup_link, 'home_popup', 'width='+ popup_x +',height='+ popup_y +',menubar=0,toolbar=0,scrollbars=no,resizable=yes,status=no');
	}
}

function changeLocale(url){
	window.location.href = url;
}

function oldOpenPrint(){
	printContent = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
	printContent += '<html>';
	printContent += '<head>';
	printContent += document.getElementsByTagName('head')[0].innerHTML;
	printContent += '</head>';
	printContent += '<body style="width:450px;text-align:left;">';
	printContent += document.getElementById('pagecont').innerHTML;
	printContent += '</body>';
	printContent += '</html>';
	t_p_win = window.open("","printwindow","width=450,height=500,menubar=1,toolbar=1,scrollbars=1,resizable=1,");
	t_p_win.document.open();
	t_p_win.document.write(printContent);
	t_p_win.document.close();
}
function openPrint( what ){
	printContent = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
	printContent += "\n"+"<html>"+"\n";
	printContent += '<head>'+"\n";
	printContent += document.getElementsByTagName('head')[0].innerHTML;
	printContent += '<link rel="stylesheet" type="text/css" href="/css/pprint.css">';
	printContent += '</head>'+"\n";
	printContent += '<body style="width:450px;text-align:left;margin:10px;padding: 10px;">'+"\n";
	printContent += document.getElementById( what ).innerHTML;
	tmp = document.getElementById('rcol');
	if ( tmp ) {
	    printContent += document.getElementById('rcol').innerHTML;
	}
	printContent += '</body>';
	printContent += '</html>';
	t_p_win = window.open("","printwindow","width=450,height=500,menubar=1,toolbar=1,scrollbars=1,resizable=1,");
	t_p_win.document.open();
	t_p_win.document.write(printContent);
	t_p_win.document.close();
}
function openPrintHP(){
	printContent = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
	printContent += '<html>';
	printContent += '<head>';
/*	printContent += document.getElementsByTagName('head')[0].innerHTML; */
	printContent += '<link rel="stylesheet" type="text/css" href="/css/pprint.css">';
	printContent += '</head>';
	printContent += '<body style="width:450px;text-align:left;">';
	printContent += document.getElementById('wrapperhp').innerHTML;
	printContent += '</body>';
	printContent += '</html>';
	t_p_win = window.open("","printwindow","width=450,height=500,menubar=1,toolbar=1,scrollbars=1,resizable=1,");
	t_p_win.document.open();
	t_p_win.document.write(printContent);
	t_p_win.document.close();
}
function doSearch(searchpath){
	t_str = document.getElementById('searchfield').value;
	document.location.href = searchpath + '?searchand=' + t_str;
}
function submitSearch(pg_num, cat_name){
	document.getElementById('pg').value = pg_num;
	document.getElementById('cat').value = cat_name;
	document.getElementById('search_form').submit();
}
function do_credit() {
	window.open('/lib/arhel.php', 'Arhel', 'width=200,height=200,menubar=0,toolbar=0,scrollbars=no,resizable=no,status=no');
	return false;
}
function loginClick(url, locale) {
    url += url + '?locale=' + locale;  
    window.open(url, 'MailForm', 'width=400,height=510,menubar=0,toolbar=0,resizable=0,scrollbars=1,status=0,screenX=300,screenY=300');
}
function isblank(s){
  for (var i=0 ; i < s.length; i++){
    var c = s.charAt(i);
    if ((c != ' ') && (c != '\n') && (c != '\t')) return false;	
  }	
  return true;
}
function submitSearch(pg_num, cat_name){
	document.getElementById('pg').value = pg_num;
	document.getElementById('cat').value = cat_name;
	document.getElementById('search_form').submit();
}
function prepareForBasicSearch() {
	if (!isblank(document.getElementById("searchandFake").value)) {		
		document.getElementById("searchand").value = cir2lat(document.getElementById("searchandFake").value);		
		return true;		
	}
	return false;
}
function prepareForSearch() {
	if (!isblank(document.getElementById("searchand2").value) || !isblank(document.getElementById("searchfraze").value) || !isblank(document.getElementById("searchor").value)) {			
		document.getElementById("searchand2").value = cir2lat(document.getElementById("searchand2").value);		
		document.getElementById("searchor").value = cir2lat(document.getElementById("searchor").value);
		document.getElementById("searchfraze").value = cir2lat(document.getElementById("searchfraze").value);
		return true;		
	}
	return false;
}
