

	function ltrim(s){
		return s.replace( /^\s*/, "" );
	}
		
	function rtrim(s){
		return s.replace( /\s*$/, "" );
	}
		
	function trim(s){
		return ltrim(rtrim(s));
	}
	

	
	function jumpToMonth(thispage){
		
		jumpMonth = document.jumpdate.jmonth.value;
		jumpYear = document.jumpdate.jyear.value;
		
		document.location = thispage + "?layout=calendar&month=" + jumpYear + jumpMonth;
		
	}
	
	function checkLogin(msg)
	{
		if(trim(document.fLogin.log_user.value)=="" || trim(document.fLogin.log_pass.value)=="")
			alert(msg);
		else
			return true;
			
		return false;

	}
	
	function changeFolder(id){
		document.location="default.asp?layout=album&fid=" + id;
	}
	
	function showImage(id){
		document.location="default.asp?layout=album&iid=" + id;
	}
	
	function igalwin(URL) {
		TheNewIgalWinWin =window.open(URL,'','fullscreen=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); 
	}
	
	function sendImageWin(URL) {
	    if (document.all)
	        var xMax = screen.width, yMax = screen.height;
	    else
	        if (document.layers)
	            var xMax = window.outerWidth, yMax = window.outerHeight;
	        else
	            var xMax = 640, yMax=480;
	
	    var xOffset = (xMax - 250)/2, yOffset = (yMax - 220)/2;
	
	    igalpop = window.open(URL,'igalpop','width=270,height=220,screenX='+xOffset+',screenY='+yOffset+', top='+yOffset+',left='+xOffset+'');
	}
	
	function popPrint(id) {
		windowHandle = window.open("printfriendly.asp?id=" + id)
	}
