function Flash(_swf, _w, _h)
{
   document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+_w+'" height="'+_h+'" id="mainpage" align="middle">');
   document.write('<param name="allowScriptAccess" value="sameDomain" />');
   document.write('<param name="movie" value="Atimo_s/news/'+_swf+'" />');
   document.write('<param name="menu" value="false" />');
   document.write('<param name="wmode" value="opaque" />');   
   document.write('<param name="quality" value="high" />');
   document.write('<param name="scale" value="noscale" />');
   document.write('<embed src="Atimo_s/news/'+_swf+'" menu="false" quality="high" scale="noscale" width="'+_w+'" height="'+_h+'" name="mainpage" align="middle" allowScriptAccess="sameDomain" wmode="opaque" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
   document.write('</object>');
}

function jumpPage(newLoc) {
	newPage = newLoc.options[newLoc.selectedIndex].value
	if (newPage != "") {
		window.location = "ip.asp?op=Search_PS&id="+newPage
	}
}

function newWindow2(picture, v_width, v_height) {
	picwindow = window.open(picture,"Picture","width="+ v_width + ", height="+ v_height +", left=50, top=50, location=no, resizable=yes, menubar=no, toolbar=no, scrollbars=no")
	picwindow.focus()
}	

var r_ajax='';
function call_ajax(v_url, v_div) {
	$(v_div).update('<img border="0" src="http://www.atimo.us/e_system_02/images/loading.gif">');
	var url='atimo_s/Ajax/'+v_url;   					 
		new Ajax.Request(url, {method: 'get', asynchronous:false, onComplete: function(transport) {
		 if (200 == transport.status) {  	
		 	$(v_div).update(transport.responseText);	
			r_ajax = transport.responseText;
			//alert(r_ajax);
			}
			else
			{
				alert(transport.responseText)
			}	 				
	 	}});	
	}
	
/*Jqurey*/
var JcallAjaxReturn='';
function Jcall_ajax(v_url,v_div,v_imageProcess) {
	  r_ajax='';	
	  if ((v_imageProcess=='')||(v_imageProcess==undefined)) {
	  	  v_imageProcess='http://www.atimo.us/e_system_02/images/loading.gif'
	  } 
	  $J(v_div).html('<img border="0" src="'+v_imageProcess+'">');
	  $J.ajax({url:'atimo_s/Ajax/'+v_url,method:'get',cache:false,async:true,complete:function(transport) { 
       if (transport.status == 200) 
       { 
       	$J(v_div).html(transport.responseText);
       	r_ajax = transport.responseText;
       	JcallAjaxReturn=true;
       } 
       else 
       { alert(transport.responseText); 
       	 $J(v_div).html(''); 
       	 JcallAjaxReturn=false;
       	}}})
       	
       	return JcallAjaxReturn;   	 	 
	}		
	
function EventsFx(id) {
   window.open('EventsMailAction.asp?id='+id,'EventsInfo','height=380,width=525,top='+(window.screen.height/2-425/2)+',left='+(window.screen.width/2-525/2)+',toolbar=no, location=no, scrollbars=no, resizable=no, menubar=no')
}	

/*-------------------------------------------- FUNCTIONS USED FOR MY ACCOUNT (RESTRCITED) ---------------------------------------------------------------*/

/*-------------------------------------------- END OF FUNCTIONS USED FOR MY ACCOUNT (RESTRCITED) -----------------------------------------------------*/
 
 function f_edit_my_article() {
	 var title=$('title').value;
	 var article=$('article').value;
	 var dt=$('f_date').value;
	 var subtitle=$('subtitle').value;
	 
	if(dt.replace(/^\s*/,'')=="")
		{
		   alert("Please select Date");
		   return false;
		}
		if(title.replace(/^\s*/,'')=="")
		{
		   alert("Please enter Title ");
		   return false;
		}
		if(subtitle.replace(/^\s*/,'')=="")
		{
		   alert("Please enter Subtitle ");
		   return false;
		}
		if(article.replace(/^\s*/,'')=="")
		{
		   alert("Please enter Article");
		   return false;
		}
		
		document.Atimo_form.submit();
		
	}
		
		
		
/*-------------------------------------------- FUNCTIONS USED FOR MY PARISH (RESTRCITED) -----------------------------------------------------------*/
/*-------------------------------------------- END OF FUNCTIONS USED FOR MY ACCOUNT (RESTRCITED) --------------------------------------------------------*/
/*-------------------------------------------- FUNCTIONS USED FOR MY EVENTS (EVENT_REQUEST-RESTRCITED) -------------------------------------------------*/
	
	function f_muda_calendario(v_month,v_year,v_id_m10) {			
	  var url='MyEvents/event_calendar_input2_ajax.asp?nMonth='+v_month+'&nYear='+v_year+'&id_m10='+v_id_m10;
	  Jcall_ajax(url,'#div_calendar');
  }
/*-------------------------------------------- END OF THE FUNCTIONS USED FOR MY EVENTS (EVENT_REQUEST-RESTRCITED) ----------------------------------------*/
/*-------------------------------------------- FUNCTIONS USED FOR MY EVENTS (EVENT_CHANGE-RESTRCITED) ----------------------------------------------------*/
/*--------------------------------------------END OF FUNCTIONS USED FOR MY EVENTS (EVENT_CHANGE-RESTRCITED) ---------------------------------------------*/

function fxAjax()
{
	
	var eventVal=document.getElementById('combo_events').options[document.getElementById('combo_events').selectedIndex].value;
	call_ajax ('MyEvents/events.asp?eventVal='+eventVal,'events');
}


function clearInputFields()
{
	var len=document.searchArticles.length-3;
	for (var x=0; x<len; x++){
		document.searchArticles.elements[x].value = '';}
	var action=document.getElementById('action').value;
	if (action=='articleslist.asp'){
		document.getElementById('rss').checked=false;}	
	if (action=='events.asp'){
		document.getElementById('combo_events').value='B';}	
}

function calfx(){
	var cal = Calendar.setup({
      	showTime     : 24,
        onSelect: function(cal) { cal.hide() }
      });
	  cal.manageFields('f_date1', 'date1', '%m/%d/%Y');
      cal.manageFields('f_date2', 'date2', '%m/%d/%Y');
}

/*------------------------------------------------------PDF UPLOAD--------------------------------------------------------------------------*/


function fxSpanish(){
		var stitle=$('stitle').value;
		var s=document.Atimo.Spanish.value;
		if(stitle=='') {
			alert('Inform Title !!');
			return false;
		}
		if(s=='') {
			alert('Inform Spanish Translation !!');
			return false;
		}
	}
	
	
function f_sadd_my_article() { 
	var article=document.Atimo_form.article.value;
	if (article==""){
		alert("Please Enter Spanish Translation");
		return false;}}
		
function fs_change_position(v_id)
		{		 							
			window.open('http://www.miamiarch.org/atimo_s/ajax/articles/test_article2.asp?id_image='+v_id,'Upload_image','height=80,width=350,top='+(window.screen.height/2-80/2)+',left='+(window.screen.width/2-350/2)+',toolbar=no, location=no,resizable=no, menubar=no');
			
		}

function f_caption(v_id,m_id) {		 							
			window.open('http://www.miamiarch.org/atimo_s/ajax/articles/scaption.asp?id_image='+v_id,'Upload_image','height=150,width=450,top='+(window.screen.height/2-150/2)+',left='+(window.screen.width/2-450/2)+',toolbar=no, location=no,resizable=no, menubar=no');

}
function assignedCombo_changed(sel) {
    if (sel == '900') {//.options[this.selectedIndex].value
        var combo = document.getElementById('relatedtoCombo');
        document.getElementById('lbRelatedto').style.display = 'block';
        combo.selectedIndex = 0;
        combo.style.display = 'block';
    } else {
        document.getElementById('lbRelatedto').style.display = 'none';
        document.getElementById('relatedtoCombo').style.display = 'none';
        document.getElementById('lbMiamiLink').style.display = 'none';
        document.getElementById('miamiLink').style.display = 'none';
    }
}
function relatedtoCombo_changed(sel) {
        if (sel == 'notinlist') {//.options[this.selectedIndex].value
            document.getElementById('lbMiamiLink').style.display = 'block';
            document.getElementById('miamiLink').style.display = 'block';
        } else {
            document.getElementById('lbMiamiLink').style.display = 'none';
            document.getElementById('miamiLink').style.display = 'none';
        }
}
