function getExampleSession(value){

	var attribute = value;
	
	FacadeAjaxSession.exampleSession1(attribute, {
		callback:function(str){
			DWRUtil.setValue("msgSession", str);
		},
		errorHandler:function(errorString, e){
			DWRUtil.setValue("msgSession", errorString);
		},
		timeout:50000
	});
}

function createSession(){
	
	var bean = DWRUtil.getValues("formCreateSession");
	
	FacadeAjaxSession.createSession(bean.attribute, bean.value,{
		callback:function(){
			DWRUtil.setValue("msgSession", "Session create !");
		},
		errorHandler:function(errorString, e){
			DWRUtil.setValue("msgSession", errorString);
		},
		timeout:50000
	});
}

function getExampleSession2(value){
	var attribute = value;
	
	FacadeAjaxSession.exampleSession2(attribute,{
		callback:function(str){
			DWRUtil.setValue("msgSession", str);
		},
		errorHandler:function(errorString, e){
			DWRUtil.setValue("msgSession", errorString);
		},
		timeout:50000
	});
}

function addValue(){
	
	var bean = DWRUtil.getValues("formCreateMapSession");
	
	FacadeAjaxSession.addMapSession(bean,{
		callback:function(){
			DWRUtil.setValue("msgSession", "Value add !");
			listMap();
		},
		errorHandler:function(errorString, e){
			DWRUtil.setValue("msgSession", errorString);
		},
		timeout:50000
	});
}

function listMap(){
	
	FacadeAjaxSession.listMapSession({
		callback:function(map){
			DWRUtil.removeAllRows("mapList");

			var cellFuncs = [
								function(bean) { return bean.keyMap; },
								function(bean) { return bean.id; },
								function(bean) { return bean.name; }
							];
		
			DWRUtil.addRows( "mapList", map, cellFuncs, {
		  		rowCreator:function(options) {  		
		    		row = document.createElement("tr");
			    	row.id = options.rowData.keyMap;
					
					row.style.cursor = "pointer";
						
					if(validateBrowser()){
						row.attachEvent("onmouseover", function(e){changeto(e, '#ff0000')});
		    			row.attachEvent("onmouseout", function(e){changeback(e, '')});
						row.attachEvent("onclick", function(e){removeValue(this.id)});
					}else{
						row.addEventListener("mouseover", function(e){changeto(e, '#ff0000')}, false);
						row.addEventListener("mouseout", function(e){changeback(e, '')}, false);
						row.addEventListener("click",function(e){removeValue(this.id)},true);
					}
					
		    		return row;
		  		},
		  		cellCreator:function(options) {
		    		var td = document.createElement("td");   
		    		return td;
		  		}
			});
		},
		errorHandler:function(errorString, e){
			DWRUtil.setValue("msgSession", errorString);
		},
		timeout:50000
	});
	
}

function removeValue(key){
	var bean = { keyMap:key };
	
	FacadeAjaxSession.removeValueMap(bean,{
		callback:function(){
			DWRUtil.setValue("msgSession", "Remove success !");
			listMap();
		},
		errorHandler:function(errorString, e){
			DWRUtil.setValue("msgSession", errorString);
		},
		timeout:50000
	});
}		











