function fp_window_openformat(href,sWindowName,sFeatures,title){
	if (hrefrel=fp_window_openformat_eval_img(href)){
		var hrefn=fp_url_get();
		hrefn+="output/img.php";
		hrefn+="?dobody=true&src="+hrefrel;
		hrefn+="&title="+title;
		href=hrefn;
	}
	window.open(href,sWindowName,sFeatures);
}

function fp_window_openformat_eval_img(href){
	var lastindexpiont=href.lastIndexOf(".");
	if (lastindexpiont>0){
		var ext=href.substring(lastindexpiont+1);
		ext=ext.toLowerCase();
		var ok=false;
		if (ext=="jpg"){
			ok= true;
		}
		if (ext=="gif"){
			ok= true;
		}
		if (ext=="png"){
			ok= true;
		}
		//ok=false;
		if (ok){
			var evaldom=false;
			if (href.substring(0,7)=="http://"){
				evaldom= true;
				var hrefsinprot=href.substring(7);
			}else if(href.substring(0,8)=="https://"){
				evaldom= true;
				var hrefsinprot=href.substring(8);
			}
			if (evaldom){
				var thisdom=document.domain;
				var thisdomlen=thisdom.length;
				var hrefdom=hrefsinprot.substring(0,thisdomlen);
				if (thisdom==hrefdom){
					return (hrefsinprot.substring(thisdomlen));	
				}
			}else{
				return(href);
			}
		}
	}
}
