
function go_to(mod){	
			document.frm_general.module.value=mod
			document.frm_general.submit()
		}
function go_to_post(mod) {	
				document.frm_general.module.value=mod
				document.frm_general.method='post'
				document.frm_general.submit()
				
			}
function go_to_post_message(mod, mes) {	
				document.frm_general.module.value=mod
				document.frm_general.hmessage.value=mes
				
				document.frm_general.method='post'
				
				document.frm_general.submit()
				
			}
					

function form_validation_news()
	{
		var a = document.frm_general;
		if(Trim(a.newsletter.value) == "")
		{
			document.getElementById('val_txt_newsletter').style.display='inline'
			a.newsletter.value=Trim(a.newsletter.value)
			a.newsletter.focus();
			return false;
		}
		return true;
	}		
					
function Trim(s) 
			{
			  // Remove leading spaces and carriage returns
			  
			  while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
			  {
				s = s.substring(1,s.length);
			  }
			
			  // Remove trailing spaces and carriage returns
			
			  while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
			  {
				s = s.substring(0,s.length-1);
			  }
			  return s;
			}				
			


function add_newsletter() {
	var a = document.frm_general;
	if(Trim(a.txt_newsletter.value) == "") {
		alert ('Completati va rugam campul newsletter !')
		a.txt_newsletter.value=""
		a.txt_newsletter.focus();
	}
	else {
		a.module.value='home';
		a.submit();
	}
}

function litera_dictionar(litera) {
	var a = document.frm_general;
	 	a.dictionar_litera.value=litera
		a.module.value='view_dictionar';
		a.submit();
}

function cauta_dictionar() {
	var a = document.frm_general;
	if(Trim(a.txt_dictionar.value) == "") {
		alert ('Completati va rugam campul cuvant cheie !')
		a.txt_dictionar.value=""
		a.txt_dictionar.focus();
	}
	else {
		a.module.value='view_dictionar';
		a.submit();
	}
}



function cauta_harta(localitate) {
	var a = document.frm_general;
	a.txt_keyword.value=localitate;
	a.ddl_tip_cautare.value="dupa_locatie";
	a.module.value='view_evenimente';
	a.submit();
	
}

function popup (picture) {
						//var newPop
						//newPop = window.open ('popup.php?pic_id='+picture+'','d',' scroolbars=yes, menubar=no, height=400, width=400, resizable=no, toolbar=no, location=no, status=no')
						//newPop.close()
						var newPop_elem
						//newPop_elem = window.open ('popup_elementi.php?pic_id='+picture+'','s',' scroolbars=yes, menubar=no, height=700, width=600, resizable=yes, toolbar=no, location=no, status=no')
						//newPop_elem.close()
						newPop_elem = window.open ('popup.php?pic_id='+picture+'','s',' scrollbars=yes, menubar=no, height=520, width=820,  resizable=yes, toolbar=no, location=no, status=no')
					    x = (screen.width-820)/2;
						x = x < 0 ? 0 : x;
						y = (screen.height-520)/2;
						y = y < 0 ? 0 : y;
						newPop_elem.moveTo(x,y);
						
					}
function verify_username (vrr) {
			var a = document.frm_general;
			if(Trim(a.username.value) != "") {
				var newPop_elem
				newPop_elem = window.open ('verify_username.php?usr='+vrr+'','s',' scrollbars=yes, menubar=yes, height=400, width=520,  resizable=yes, toolbar=yes, location=no, status=no')
				x = (screen.width-820)/2;
				x = x < 0 ? 0 : x;
				y = (screen.height-520)/2;
				y = y < 0 ? 0 : y;
				newPop_elem.moveTo(x,y);
			}
			else { alert ("Please fill username fill first !")}
			
		}


