/*-----------------------------------------------------------------------
User JavaScript File

version: 	4.1
author:		sebastian kupke
email:		sebastian.kupke@baral-geohaus.de
website:	http://www.baral.de
-----------------------------------------------------------------------*/

/* =namespace usr
-----------------------------------------------------------------------*/
ws.usr = {
	
	/* =c namespace
	-----------------------------------------------------------------------*/
	c: {
		/* =onload
	    Fired after web sis has been fully loaded. You can access the dom and all js objects.
		-----------------------------------------------------------------------*/
		onload: function() {
			
		}
	},
	
	/* =t namespace (for tools)
	-----------------------------------------------------------------------*/
	t: {
		
		/* =identify
		-----------------------------------------------------------------------*/
		identify: {
		
			/* =end
			 * Fired when the user uses the identify tool
			 * @param point
			-----------------------------------------------------------------------*/
			end: function(point) {
				alert('x: ' + point.x + '\ny: ' + point.y);
			}
		},
		
		/* =selectRect
		-----------------------------------------------------------------------*/
		selectRect: {
		
			/* =end
			 * Fired when the user uses the selectRect tool
			 * @param rect
			-----------------------------------------------------------------------*/
			end: function(rect) {
				alert('rectangle:\nlower left: ' + rect.ll.x + ' ' + rect.ll.y + '\nupper right: ' + rect.ur.x + ' ' + rect.ur.y);
				
				$('#t_select_div').css('z-index', '2200').empty();
			}
		},
		
		/* =selectPolygon
		-----------------------------------------------------------------------*/
		selectPolygon: {
		
			/* =end
			 * Fired when the user uses the selectPolygon tool
			 * @param polygon
			-----------------------------------------------------------------------*/
			end: function(polygon) {
				var pointStr = '';
			    
			    for (var i = 0; i < polygon.points.length; i++) {
			        
			        pointStr += i + '. ' + polygon.points[i].x + ' ' + polygon.points[i].y + '\n';
			    }
			    
			    alert(pointStr + '\ndrag vertexes? ' + polygon.dragVertexes);
			    
			    $('#t_select_div').css('z-index', '2200').empty();
			}
		},
		
		/* =selectCircle
		-----------------------------------------------------------------------*/
		selectCircle: {
		
			/* =end
			 * Fired when the user uses the selectCircle tool
			 * @param circle
			-----------------------------------------------------------------------*/
			end: function(circle) {
				alert('center: ' + circle.center.x + ' ' + circle.center.y + '\nradius: ' + circle.r);
			    
			    $('#t_select_div').css('z-index', '2200').empty();
			}
		}
	},
	
	/* =m namespace (for modules)
	-----------------------------------------------------------------------*/
	m: {
		
	}
	
	
}

function reloadMap(service, layer) {
  var curService = ws.map.getService();
  var curLayer = curService.getLevel().getLayer();
  if (curService.id != service || curLayer.id != layer) {
    ws.i.map({service: service, layer: layer, load: true});
    ws.i.m.layer({load: true});
  }
}

function help(title,message){
ws.tst.show('<u>' + title + '</u>',message); 
}
function showbus(title,id,language){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/bus.jsp?id=' + id + '&language=' + language + '" name="Busframe" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function showvelo(title,id,language){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/velo.jsp?id=' + id +'&language=' + language + '" name=Veloframe" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function showparking(title,id,language){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/parking.jsp?id=' + id +'&language=' + language + '" name=Parkingframe" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function showtaxis(title,id,language){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/taxis.jsp?id=' + id +'&language=' + language + '" name=Taxisgframe" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function showadrbus(title,language,x,y,street){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/bus.jsp?adr=1&x=' + x + '&y=' + y + '&language=' + language + '&street=' + street + '" name="adresseframe" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function showadrvelo(title,language,x,y,street){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/velo.jsp?adr=1&x=' + x + '&y=' + y + '&language=' + language + '&street=' + street + '" name="adresseframe" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function showadrparking(title,language,x,y,street){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/parking.jsp?adr=1&x=' + x + '&y=' + y + '&language=' + language + '&street=' + street + '" name="adresseframe" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function ing2009a(title){
ws.tst.show('ING-Marathon 2009','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/data/objects_luxemburg/downloads/ing/ing-2009.pdf" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function ing2009b(title){
ws.tst.show('ING-Semi-marathon 2009','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/data/objects_luxemburg/downloads/ing/ing-sm-2009.pdf" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function veloh_route(title,language){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/veloh_route.jsp?language=' + language + '" name="Velohframe" width="100%" height="450" align="left" scrolling="yes" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function show_movie(movie,title,copy,width,height){ 
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://topo-websis-a:8081/websis/data/objects_luxemburg/movies/movie.jsp?movie=' + movie + '&title=' + title + '&cright=' + copy + '&width=' + width + '&height=' + height + '" name="Velohframe" width="100%" height="400" align="left" scrolling="yes" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}
function show_faq(quest,lang){ 
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/faq.jsp?quest=' + quest + '&lang=' + lang + '" name="legendeframe" width="100%" height="450" align="left" scrolling="yes" marginheight="0" marginwidth="0" frameborder="0"></iframe>');
}
function showhp(title,language,x,y,street){
ws.tst.show('','<iframe style=";padding:0px;border:0px;margin:auto;background-image:url(http://www.topographie.lu/websis/style/hotcity/img/map_load.gif);background-repeat:no-repeat;background-position:30px 20px;" src="http://www.topographie.lu/websis/parkinghp.jsp?adr=1&x=' + x + '&y=' + y + '&language=' + language + '&street=' + street + '" name="adresseframe" width="100%" height="400" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>'); 
}






