var d;
function showConferenceList()
{

			if(!d)
			d=new dijit.Dialog({id:"dlg1",title: "Select",style:"width:50%"});
			
			//dojo.connect(this.d,"hide",this.removeField);
		dojo.xhrGet({
		url: "conference_showList.action",
		handleAs: "text",
		preventCache:true,
		load: function(data,args){
						d.setContent(data);
						d.show();	
						
				}});
		
}

function test()
{
if(!d)
			d=new dijit.Dialog({id:"dlg1",title: "Select",style:"width:50%"});
			
			//dojo.connect(this.d,"hide",this.removeField);
		dojo.xhrGet({
		url: "conference_showList.action",
		handleAs: "text",
		preventCache:true,
		load: function(data,args){
						d.setContent(data);
						d.show();	
						
				}});
}

function goToLeft()
{
 
		for(var j=(dojo.byId('confEmployeeList').length-1) ;  j>=0; j--)
		{
			if (dojo.byId('confEmployeeList').options[j].selected)
			{
				 dojo.byId('confEmployeeList').options[j] = null;		
				
				}
				
			}
	
}

function goToRight()
{
		var selId='';
		var selText='';
            
for(var i=0;i<dojo.byId('employeeList').length;i++)
{

	if(dojo.byId('employeeList').options[i].selected)
	{
	    selId = dojo.byId('employeeList').options[i].value;
	    selText = dojo.byId('employeeList').options[i].text;
	 
	    var k=0;
	    for(var j=(dojo.byId('confEmployeeList').length-1) ;  j>=0; j--)
		{
				if(dojo.byId('confEmployeeList').options[j].text==selText)
				{
				k=k+1;
				}
		}
		if(k==0)
		{
				
	            var newRow = new Option(selText,selId);
				dojo.byId('confEmployeeList').options[dojo.byId('confEmployeeList').length] = newRow;
				// ss1.options[i] = null;		
				
		}
  	}
}
 
}

function inviteOther()
{

}

function selectAll()
{
var tempVal="";
for(var i=0;i<dojo.byId('confEmployeeList').length;i++)
{
	dojo.byId('confEmployeeList').options[i].selected=true;
	if(dojo.byId('confEmployeeList').options[i].selected)
	{
	
	    var temp=dojo.byId('confEmployeeList').options[i].value+";";
	    tempVal=tempVal+temp;
	}
}
	inviteForConference(tempVal);
}

var dialog;
function inviteForConference(list)
{

var xmlHttp2;
var url="";
url='conference_inviteForConference.action?list='+list+'&confName='+document.getElementById('confName').value+'&confMsg='+document.getElementById('confMsg').value;
 
//var tempContent=document.getElementById('contentdispaly'+dname).innerHTML;

                    if(window.XMLHttpRequest)
                    {
                     // For Mozilla, Safari, ...
                   
	                          xmlHttp2 = new XMLHttpRequest();
	                }
	                 else if(window.ActiveXObject)
	                 { // For Internet Explorer 6
                     xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
                     }
	                   
	                    xmlHttp2.open('POST', url, true);
	                    xmlHttp2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	                    xmlHttp2.onreadystatechange = function()
	                    {
	                   
				        //document.getElementById('contentdispaly'+dname).innerHTML=tempContent+"<br>"+"Please Wait...............";
	                     if (xmlHttp2.readyState == 4)
	                     {
	                     if(d)
	                     d.hide();
	                    
	                     document.getElementById('confDiv').innerHTML=xmlHttp2.responseText;
	                     refreshConfDiv();
	                     refreshConfMsg();
						 }
	                    }
	                    
	                  if(window.XMLHttpRequest)
                    {
	                    xmlHttp2.send(null);
	                    }
	                     else if(window.ActiveXObject)
	                 { 
	                 xmlHttp.send();
	                 }
	                    
                    
   }
var confDivTimer;   
function refreshConfDiv()
{
var xmlHttp1;
var url='conference_refreshConfStatus.action';

                   if(window.XMLHttpRequest)
                    {
                     // For Mozilla, Safari, ...
                   
	                          xmlHttp1 = new XMLHttpRequest();
	                }
	                 else if(window.ActiveXObject)
	                 { // For Internet Explorer 6
                     xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
                     }
                          
                    xmlHttp1.open('POST', url, true);
                    xmlHttp1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    xmlHttp1.onreadystatechange = function(){
                         if (xmlHttp1.readyState == 4)
                         {
                         
                         document.getElementById('confDiv').innerHTML=xmlHttp1.responseText;
                        
                         confDivTimer=setTimeout("refreshConfDiv();", 10000); 
                        
                         }
                    }
                    if(window.XMLHttpRequest)
                    {
	                    xmlHttp1.send(null);
	                    }
	                     else if(window.ActiveXObject)
	                 { 
	                 xmlHttp1.send();
	                 }
}

var confMsgTimer;   
function refreshConfMsg()
{
var xmlHttp1;
var url='conference_refreshConfMsg.action';

                   if(window.XMLHttpRequest)
                    {
                     // For Mozilla, Safari, ...
                   
	                          xmlHttp1 = new XMLHttpRequest();
	                }
	                 else if(window.ActiveXObject)
	                 { // For Internet Explorer 6
                     xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
                     }
                          
                    xmlHttp1.open('POST', url, true);
                    xmlHttp1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    xmlHttp1.onreadystatechange = function(){
                         if (xmlHttp1.readyState == 4)
                         {
                         
                         document.getElementById('chatbox').innerHTML=xmlHttp1.responseText;
                        
                         confMsgTimer=setTimeout("refreshConfMsg();", 10000); 
                        
                         }
                    }
                    if(window.XMLHttpRequest)
                    {
	                    xmlHttp1.send(null);
	                    }
	                     else if(window.ActiveXObject)
	                 { 
	                 xmlHttp1.send();
	                 }
}


/*var confMsgTimer;   
function refreshConfMsg()
{
var xmlHttp1;
var url='conference_refreshConfMsg.action';

                   if(window.XMLHttpRequest)
                    {
                     // For Mozilla, Safari, ...
                   
	                          xmlHttp1 = new XMLHttpRequest();
	                }
	                 else if(window.ActiveXObject)
	                 { // For Internet Explorer 6
                     xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
                     }
                          
                    xmlHttp1.open('POST', url, true);
                    xmlHttp1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    xmlHttp1.onreadystatechange = function(){
                         if (xmlHttp1.readyState == 4)
                         {
                         
                         document.getElementById('chatbox').innerHTML=xmlHttp1.responseText;
                        
                         confMsgTimer=setTimeout("refreshConfMsg();", 10000); 
                        
                         }
                    }
                    if(window.XMLHttpRequest)
                    {
	                    xmlHttp1.send(null);
	                    }
	                     else if(window.ActiveXObject)
	                 { 
	                 xmlHttp1.send();
	                 }
}

var dialog;
function inviteForConference(list)
{

var xmlHttp2;
var url="";
url='conference_inviteForConference.action?list='+list+'&confName='+document.getElementById('confName').value+'&confMsg='+document.getElementById('confMsg').value;
 
//var tempContent=document.getElementById('contentdispaly'+dname).innerHTML;

                    if(window.XMLHttpRequest)
                    {
                     // For Mozilla, Safari, ...
                   
	                          xmlHttp2 = new XMLHttpRequest();
	                }
	                 else if(window.ActiveXObject)
	                 { // For Internet Explorer 6
                     xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
                     }
	                   
	                    xmlHttp2.open('POST', url, true);
	                    xmlHttp2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	                    xmlHttp2.onreadystatechange = function()
	                    {
	                   
				        //document.getElementById('contentdispaly'+dname).innerHTML=tempContent+"<br>"+"Please Wait...............";
	                     if (xmlHttp2.readyState == 4)
	                     {
	                     if(d)
	                     d.hide();
	                    
	                     document.getElementById('confDiv').innerHTML=xmlHttp2.responseText;
	                     refreshConfDiv();
	                     refreshConfMsg();
						 }
	                    }
	                    
	                  if(window.XMLHttpRequest)
                    {
	                    xmlHttp2.send(null);
	                    }
	                     else if(window.ActiveXObject)
	                 { 
	                 xmlHttp.send();
	                 }
	                    
                    
   }
var confDivTimer;   
function refreshConfDiv()
{
var xmlHttp1;
var url='conference_refreshConfStatus.action';

                   if(window.XMLHttpRequest)
                    {
                     // For Mozilla, Safari, ...
                   
	                          xmlHttp1 = new XMLHttpRequest();
	                }
	                 else if(window.ActiveXObject)
	                 { // For Internet Explorer 6
                     xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
                     }
                          
                    xmlHttp1.open('POST', url, true);
                    xmlHttp1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    xmlHttp1.onreadystatechange = function(){
                         if (xmlHttp1.readyState == 4)
                         {
                         
                         document.getElementById('confDiv').innerHTML=xmlHttp1.responseText;
                        
                         confDivTimer=setTimeout("refreshConfDiv();", 10000); 
                        
                         }
                    }
                    if(window.XMLHttpRequest)
                    {
	                    xmlHttp1.send(null);
	                    }
	                     else if(window.ActiveXObject)
	                 { 
	                 xmlHttp1.send();
	                 }
}

var d;
function showConferenceList()
{

			if(!d)
			d=new dijit.Dialog({id:"dlg1",title: "Select",style:"width:50%"});
			
			//dojo.connect(this.d,"hide",this.removeField);
		dojo.xhrGet({
		url: "conference_showList.action",
		handleAs: "text",
		preventCache:true,
		load: function(data,args){
						d.setContent(data);
						d.show();	
						
				}});
		
}

function test()
{
if(!d)
			d=new dijit.Dialog({id:"dlg1",title: "Select",style:"width:50%"});
			
			//dojo.connect(this.d,"hide",this.removeField);
		dojo.xhrGet({
		url: "conference_showList.action",
		handleAs: "text",
		preventCache:true,
		load: function(data,args){
						d.setContent(data);
						d.show();	
						
				}});
}

function goToLeft()
{
 
		for(var j=(dojo.byId('confEmployeeList').length-1) ;  j>=0; j--)
		{
			if (dojo.byId('confEmployeeList').options[j].selected)
			{
				 dojo.byId('confEmployeeList').options[j] = null;		
				
				}
				
			}
	
}

function goToRight()
{
		var selId='';
		var selText='';
            
for(var i=0;i<dojo.byId('employeeList').length;i++)
{

	if(dojo.byId('employeeList').options[i].selected)
	{
	    selId = dojo.byId('employeeList').options[i].value;
	    selText = dojo.byId('employeeList').options[i].text;
	 
	    var k=0;
	    for(var j=(dojo.byId('confEmployeeList').length-1) ;  j>=0; j--)
		{
				if(dojo.byId('confEmployeeList').options[j].text==selText)
				{
				k=k+1;
				}
		}
		if(k==0)
		{
				
	            var newRow = new Option(selText,selId);
				dojo.byId('confEmployeeList').options[dojo.byId('confEmployeeList').length] = newRow;
				// ss1.options[i] = null;		
				
		}
  	}
}
 
}

function inviteOther()
{

}

function selectAll()
{
var tempVal="";
for(var i=0;i<dojo.byId('confEmployeeList').length;i++)
{
	dojo.byId('confEmployeeList').options[i].selected=true;
	if(dojo.byId('confEmployeeList').options[i].selected)
	{
	
	    var temp=dojo.byId('confEmployeeList').options[i].value+";";
	    tempVal=tempVal+temp;
	}
}
	inviteForConference(tempVal);
}




*/


//commented by nagarjuna ,21-04-2010
/*
function sendConfMessage(message,conMsgId)
{

var xmlHttp1;
var url='conference_sendConfMessage.action?message='+message;

   

                    if(window.XMLHttpRequest){ // For Mozilla, Safari, ...
                          xmlHttp1 = new XMLHttpRequest();
                         xmlHttp1.open('POST', url, true);
                    xmlHttp1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    xmlHttp1.onreadystatechange = function(){
                         if (xmlHttp1.readyState == 4){
                       
                      
                         document.getElementById(conMsgId).value='';
                         document.getElementById(conMsgId).focus();

                      //  refreshEmpChatMessages();
                        
                         }
                    }
                    xmlHttp1.send(null);
                    }
                    else if(window.ActiveXObject){ // For Internet Explorer
                         var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                         xmlHttp.open('POST', strURL, true);
                    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    xmlHttp.onreadystatechange = function(){
                         if (xmlHttp.readyState == 4){
                         document.getElementById(conMsgId).value='';
                         document.getElementById(conMsgId).focus();
                         
                         }
                    }
                    xmlHttp.send();
                    }
}



var empchattimer;
function refreshEmpChatMessages()
{
var xmlHttp1;
var url='conference_refreshEmpChatMessages.action';

                    if(window.XMLHttpRequest){ // For Mozilla, Safari, ...
                    	 if(xmlHttp1==null)
                          xmlHttp1 = new XMLHttpRequest();
                       }
                    else if(window.ActiveXObject){ // For Internet Explorer
                          if(xmlHttp1==null) 
                          xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
                     }

                    xmlHttp1.open('POST', url, true);
                    xmlHttp1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    xmlHttp1.onreadystatechange = function(){
                         if (xmlHttp1.readyState == 4){
                           //document.getElementByName('headbg').innerHTML=xmlHttp1.responseText;
                       //    document.getElementById('chatbox').innerHTML=xmlHttp1.responseText;
                         document.getElementById('chatboxrefresh').innerHTML=xmlHttp1.responseText;
                        
                         empchattimer=setTimeout("refreshEmpChatMessages();", 5000); 
                         
                         //setTimeout("refreshFriendList('contentdispaly5');", 10000); 
                         }
                    }
                     if(window.XMLHttpRequest)
                    {
                     xmlHttp1.send(null);
                    }
                    else if(window.ActiveXObject){ // For Internet Explorer
                     
                    xmlHttp1.send();
                    }
}

*/


