function displayMultipleCategoryWindow()
{                                    
    if(Form1.dlstCategory.selectedIndex == 2){
		var new_window = window.open('CategorySubCategorySelect.aspx', '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=380,height=400,left=212,top=50');
		new_window.focus();
		document.Form1.dlstCategory.selectedIndex = 0;
    }            
}

function displayMultipleLocationWindow(){                                    
    if(document.Form1.dlstLocation.selectedIndex == 2){
        /*If there is a value on the document that holds a location format...get it*/
        /*This field should be on the CalendarNOW.aspx & EventList.aspx pages.*/
        var hiddenLocationFormatField=document.getElementById("p_LocationColumnField");
        var locationFormat="";
        if(hiddenLocationFormatField!=null){locationFormat=hiddenLocationFormatField.value;}
        
		var new_window = window.open('LocationBuildingSelect.aspx?lFormat='+locationFormat, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=380,height=400,left=212,top=50');
		new_window.focus();
		document.Form1.dlstLocation.selectedIndex = 0;
    }       
}

function eventdetailsview(Eid,Iid){
	//Show the onscreen form element for this item
	document.getElementById("ifrmDetails").src = "eventdetailsview.aspx?Eid=" + Eid + "&Iid=" + Iid;
	document.getElementById("ifrmDetails").style.visibility="visible";
	document.getElementById("divDetails").style.visibility="visible";
	
	var contentwidth = document.getElementById("CalendarPanel").clientWidth;
	var contentoffsettop = document.getElementById("divContent").offsetTop;
	var scrolloffset = document.body.scrollTop;
	var detailswidth = document.getElementById("divDetails").clientWidth;
	
	if((parseInt(contentwidth) - parseInt(detailswidth)) > 0){
		//Offset the popup the different of the two values from the left
		document.getElementById("divDetails").style.left = (parseInt(contentwidth) - parseInt(detailswidth)) / 2;
	}
	else{
		//Do not offset the popup from the left
		document.getElementById("divDetails").style.left = 0;
	}
	
	if((parseInt(scrolloffset) - parseInt(contentoffsettop)) > 0){
		//Offset the popup the different of the two values from the top
		document.getElementById("divDetails").style.top = parseInt(scrolloffset) - parseInt(contentoffsettop);
	}
	else{
		//Do not offset the popup
		document.getElementById("divDetails").style.top = 0;
	}
}

function closeIFrame(){
	document.getElementById("ifrmDetails").style.visibility="hidden";
	document.getElementById("divDetails").style.visibility="hidden";
}

function eventdetailsview_popup(Eid,Iid,Print){
	if(Print == "Y"){
		var new_window = window.open("EventDetailsView.aspx?Eid=" + Eid + "&Iid=" + Iid + "&print=print", "", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width=650,height=480,left=50,top=50");
		new_window.focus();
	}
	else{
		var new_window = window.open("EventDetailsView.aspx?Eid=" + Eid + "&Iid=" + Iid, "", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width=650,height=480,left=50,top=50");
		new_window.focus();
	}
}

function openInternetBrowser(link){
	var new_window = window.open(link, "", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600");
	new_window.focus();
}

function openInternetBrowserResizable(link){
	var new_window = window.open(link, "", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600");
	new_window.focus();
}

function displaySelectedCategoriesWindow(){                                    
	var new_window = window.open('SelectedCategoryList.aspx', 'Category\SubCategory', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=380,height=228,left=212,top=50');
	new_window.focus();
	document.Form1.dlstCategory.selectedIndex = 0;
}

function displayEmailToFriend(Eid,Iid,Dt)
{
	var new_window = window.open('emailtofriend.aspx?Eid=' + Eid + '&Iid=' + Iid + '&Dt=' + Dt, "Email", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');
	new_window.focus();
}

function iCalendarHowTo(Eid,Iid)
{
	var new_window = window.open('outlookhowto.aspx?Eid=' + Eid + '&Iid=' + Iid, "ICalendar", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');
	new_window.focus();
}

function notifyMe(Eid, Iid)
{
	var new_window = window.open('notifyme.aspx?Eid=' + Eid + '&Iid=' + Iid, "Notify", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');
	new_window.focus();
}

function RemindMe(Eid, Iid)
{
	var new_window = window.open('RemindMe.aspx?Eid=' + Eid + '&Iid=' + Iid, "Notify", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');
	new_window.focus();
}

function registerMe(Rid, Iid)
{
	var new_window = window.open('EventRegistration.aspx?Rid=' + Rid + '&Iid=' + Iid, "Register", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');
	new_window.focus();
}

function downloadType(qstring,e)
{
	var new_window = window.open('downloadtype.aspx' + qstring , "Download", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,left=' + (e.screenX - 375) + ',top=' + (e.screenY - 70));
	new_window.focus();
}

function commentLogView(Eid)
{
	var new_window = window.open('EventCommentLogView.aspx?Eid=' + Eid, "Comments", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=300,left = 25,top = 25');
	new_window.focus();
}

function calendarSubscription(){
    var new_window = window.open("subscribetocalendar.aspx", "Subscribe", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=300,left=25,top=25");
	new_window.focus();
}