
function callback(messages){
  if(messages != ""){
    document.getElementById("lgn").style.display="none"; 
    DWRUtil.removeAllRows("lgo");  
    var cellFuncs = [
      function(messages){return messages;}
    ];
    DWRUtil.addRows("lgo",messages,cellFuncs,{escapeHtml:false});
  }
}

function findsession(){
  LoginUser.getUserMessage(callback);
  document.getElementById("visitshow").style.display="block";
  LoginUser.getVisitUser(visituser);
  pupwindow.openPopupWindow(openwindow);
  pupwindow.OpenAdverWindow(adverpages);
  //DWREngine.setTimeout();  
  /*
  adverwindow.OpenAdverWindow({
  callback:function(data){alert("it worked");},
  errorHandler:function(message){alert("it broke");},
  timeout:10
  }); */
}

function openwindow(values){
	var items;
	items = values.split(";");
	for(i=0;i<items.length-1;i++){
		window.open(items[i],'','height=205,width=400,menubar=no,scrollbars=yes, resizable=yes');
	}
  /*
  Remote.method(params,{
  callback:function(data){alert("it worked");},
  errorHandler:function(message){alert("it broke");},
  timeout:10
  });	*/
}

function adverpages(values){
	var items;
	items = values.split(";");
	for(i=0;i<items.length-1;i++){
		window.open(items[i],'','height=208,width=300,menubar=no,scrollbars=no, resizable=no');
	}
}

function visituser(t_count){
	document.getElementById("visitcount").innerText = t_count;
}

function exitlogin(){
  LoginUser.removeSession(showexit);
}

function showexit(messages){ 
  top.location.href="index.jsp";
  if(messages == "loginout"){
    //top.location.href="index.jsp";
  }
}
