
function SubmitCulture()
{
    var theForm = document.forms['frmHome'];
    if (!theForm) {
        theForm = document.frmHome;
    }
    var currentIndex = theForm.ddlLanguageCulture.selectedIndex;
    var culture = theForm.ddlLanguageCulture.options[currentIndex].value;
    window.location.href = "default.aspx?culture="+ culture;
}

function OpenAddToOutlook(blnRegistered, eventIdFallback, cultureFallback)
{
   var outlookurl;
   
   outlookurl = "AddToOulook.aspx";
   
   if (blnRegistered)
   {
      outlookurl = outlookurl + "?RegistrationID=" + document.all("hdnRegID").value;
   }
   else
   {
      var eventIdHdn = document.all("hdnEventID");
      var eventId = eventIdFallback;
      if (eventIdHdn)
      {
        eventId = eventIdHdn.value;
      }
      
      outlookurl += "?EventID=" + eventId;
   }

   var hdnCulture = document.all("hdnCulture");
   var culture = cultureFallback;
   if (hdnCulture) {
       culture = hdnCulture.value;
   }
 
   outlookurl += "&culture=" + culture;
   
   
   window.open(outlookurl,null,'height=0,width=0');
}


function OpenPopup(blnOpenPopup,recFormat)
{
	var theform = document.forms[0]; 
	//var iframe = document.frames[0];
	var joinurl;
	
	joinurl = "JoinMeeting.aspx";
	if (blnOpenPopup)
	{
		 //Open the popup and get the confirmation from the user
		 var strAttendeeName = null;
		 var url = "AttendeePopupFrame.aspx?culture=" + document.getElementById('hdnCulture').value;//document.all("hdnCulture").value;
		 strAttendeeName  = window.showModalDialog(url,null,"dialogWidth:370pt;dialogHeight:180pt;status=no;resizable=no");
		 if (strAttendeeName == null || strAttendeeName == "")
		 {
			return;
		 }
		 joinurl = joinurl + "?EventID=" + document.getElementById('hdnEventID').value; //document.all("hdnEventID").value;
		 joinurl = joinurl + "&AttendeeName=" + escape(strAttendeeName);
	}
	else
	{
	    
	        joinurl = joinurl + "?RegistrationID=" + document.getElementById('hdnRegID').value;	//document.all("hdnRegID").value;
	    
	}
	
	if (recFormat != 0)
	{
	  joinurl = joinurl + "&RecordingFmt=" + recFormat;
	}	
	joinurl = joinurl + "&culture=" + document.getElementById('hdnCulture').value; //document.all("hdnCulture").value;	
	//if (iframe != null)
	//{
	//	iframe.location=joinurl;    
	//} 
	
	window.location.href= joinurl;
	
	//window.showModalDialog(joinurl,window,"dialogWidth:320pt;dialogHeight:155pt;status=no");	
}

function StartDownload()
{	
	var joinurl;
	joinurl = "StartLMDownload.aspx";
	joinurl = joinurl + "?RegistrationID=" + document.getElementById('hdnRegID').value;	//document.all("hdnRegID").value;
	joinurl = joinurl + "&EventID=" + document.getElementById('hdnEventID').value;		//document.all("hdnEventID").value;
	joinurl = joinurl + "&recordingID=" + document.getElementById('recordingID').value;	//document.all("recordingID").value;
	joinurl = joinurl + "&culture=" + document.getElementById('hdnCulture').value;		//document.all("hdnCulture").value;
	
	window.location.href=joinurl;	
}

function CheckFormat(blnOpenPopup,format1,format2,format3,format4)
{
	var joinurl;
	
	joinurl = "JoinMeeting.aspx";
	if (blnOpenPopup)
	{
		 var strAttendeeName = null;
		 var url = "AttendeePopupFrame.aspx?culture=" + document.getElementById('hdnCulture').value;//document.all("hdnCulture").value;
		 strAttendeeName  = window.showModalDialog(url,null,"dialogWidth:370pt;dialogHeight:180pt;status=no;resizable=no");
		 if (strAttendeeName == null || strAttendeeName == "")
		 {
			return;
		 }
		 joinurl = joinurl + "?EventID=" + document.getElementById('hdnEventID').value; //document.all("hdnEventID").value;
		 joinurl = joinurl + "&AttendeeName=" + escape(strAttendeeName);
	}
	else
	{   
		joinurl = joinurl + "?RegistrationID=" + document.getElementById('hdnRegID').value;	//document.all("hdnRegID").value;
	}
	
	var counter = 0;
	var tmpFormat = "";
	var recFormat = "";
	if(format1 == true){ counter++; tmpFormat = "1"; }
	if(format2 == true){ counter++; tmpFormat = "2"; }
	if(format3 == true){ counter++; tmpFormat = "3"; }
	if(format4 == true){ counter++; tmpFormat = "4"; }
	
	if(counter > 1)
	{
		var recUrl = "RecordingFormat.aspx?culture=" + document.getElementById('hdnCulture').value;
		recUrl = recUrl + "&f1=" + format1 + "&f2=" + format2 + "&f3=" + format3 + "&f4=" + format4;	
		recFormat = window.showModalDialog(recUrl,null,"dialogWidth:370pt;dialogHeight:180pt;status=no;resizable=no;dialogHide:true;help:no;scroll:no");
	}
	else
	{
		recFormat = tmpFormat;
	}
	
	if (recFormat != "")
	{
		joinurl = joinurl + "&RecordingFmt=" + recFormat;
		joinurl = joinurl + "&culture=" + document.getElementById('hdnCulture').value; //document.all("hdnCulture").value;	
		window.location.href= joinurl;
	}
}

function RedirectToCancelUrl(url)
{
    location.href = url;
}