$(function(){
	// Dialog			
	$('#event_export_dialog').dialog({
		autoOpen: false,
		width: 500,
		buttons: { 
			"Close": function() { 
				$(this).dialog("close"); 
			} 
		}
	});
	// Dialog Link
	$('#event_export_link').click(function(){
	     var icsurl, webcalurl;
         //icsurl = '<%=GetSetting("global", "SiteURL")%>/en/cev/ics/';
         icsurl = window.siteurl + '/en/cev/ics/';
         if ((window.siteurl).search("https://") != -1){
            webcalurl = icsurl.replace("https://", "webcal://");
         }else{
            webcalurl = icsurl.replace("http://", "webcal://");
         }
         $('#event_export_dialog').html("<p>You can export all the upcoming events "+
                "to any calendar application such as MS Outlook, Google calendar, Apple iCal and 30 Boxes with the following links.</p>  " +
                "<p ><a style=\"font-family:Arial, Helvetica, sans-serif;font-size: 12px;color: #5C7D96;margin-left:1em;\" href=\"" + 
                icsurl + "\">" + icsurl + "</a> <span style=\"font-size:smaller;color:teal;\">(For MS Outlook, Google calendar, " + 
                " etc)</span> " + "<br /><br />" +
                "<a style=\"font-family:Arial, Helvetica, sans-serif;font-size: 12px;color: #5C7D96;margin-left:1em;\" href=\"" + 
                webcalurl + "\">" + webcalurl + "</a><span style=\"font-size:smaller;color:teal;\"> (For Apple iCal, 30 Boxes, etc)</span> " + "<br />" + "</p>");
        //$('#event_export_dialog').css("font-size","11px");
        $('#event_export_dialog').dialog('open'); 
		         
            
		return false;
	});
	
});
