
//Default image format, used if none is specified
var FORMAT_DEFAULT="image/png";
var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;


CustomGetTileUrl=function(a,b,c) {
	if (this.myFormat == undefined) {
    	this.myFormat = FORMAT_DEFAULT;
	}

	if (typeof(window['this.myStyles'])=="undefined") this.myStyles="";
	var lULP = new GPoint(a.x*256,(a.y+1)*256);
	var lLRP = new GPoint((a.x+1)*256,a.y*256);
	var lUL = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lULP,b,c);
	var lLR = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lLRP,b,c);
	
	var lBbox=lUL.x+","+lUL.y+","+lLR.x+","+lLR.y;
	var lSRS="EPSG:4326";
		
	var lURL=this.myBaseURL;
	lURL+="&REQUEST=GetMap";
	lURL+="&SERVICE=WMS";
	lURL+="&VERSION=1.1.1";
	lURL+="&LAYERS="+this.myLayers;
	lURL+="&STYLES="+this.myStyles;
	lURL+="&FORMAT="+this.myFormat;
	lURL+="&BGCOLOR=0xFFFFFF";
	lURL+="&TRANSPARENT=TRUE";
	lURL+="&SRS="+lSRS;
	lURL+="&BBOX="+lBbox;
	lURL+="&WIDTH=256";
	lURL+="&HEIGHT=256";
	lURL+="&reaspect=false";
	//lURL=encodeURI(lURL);
	//document.write(lURL + "<br/>")
	//alert(" url is " + lURL);
	//return "http://localhost/cgi-bin/mapserv.exe?map=marius.map&&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=TP&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE";
	return lURL;
}

function customOpacity() { return this.myOpacity; }

