

///////////////////////////////////
///    Disable right click     ////
///////////////////////////////////
var message="Function Disabled!";

function clickIE4(){
if (event.button==2){
//alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
//alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false")

///////////////////////////////////
///        Pop Up Window       ////
///////////////////////////////////
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

///////////////////////////////////
///        Validate Form       ////
///////////////////////////////////

function checkformml ( form )
{
    if (form.emaillist.value == "") {
    alert( "St. Peters Church: \n\nPlease Complete." );
    form.emaillist.focus();
	return false ;
  }
  return true ;
}

///////////////////////////////////
///        Random Picture      ////
///////////////////////////////////
function splashpic_home (){
var length = 2;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/home_pages_splash/"+ran_num+".jpg";
document.images['splash'].src = source;
}

function splashpic_about (){
var length = 10;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/about/"+ran_num+".jpg";
document.images['splash'].src = source;
}

function splashpic_contact (){
var length = 6;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/contact/"+ran_num+".jpg";
document.images['splash'].src = source;
}

function splashpic_ministries_christian_education (){
var length = 9;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/ministries/christian_education/"+ran_num+".jpg";
document.images['splash'].src = source;
}

function splashpic_ministries_day_school (){
var length = 13;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/ministries/day_school/"+ran_num+".jpg";
document.images['splash'].src = source;
}
function splashpic_ministries_outreach_ministries (){
var length = 6;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/ministries/outreach_ministries/"+ran_num+".jpg";
document.images['splash'].src = source;
}
function splashpic_ministries_parish_life (){
var length = 6;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/ministries/parish_life/"+ran_num+".jpg";
document.images['splash'].src = source;
}
function splashpic_ministries_worship_ministries (){
var length = 6;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/ministries/worship_ministries/"+ran_num+".jpg";
document.images['splash'].src = source;
}

function splashpic_worship (){
var length = 6;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/worship/worship/"+ran_num+".jpg";
document.images['splash'].src = source;
}

function splashpic_worship_music (){
var length = 4;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/worship/music_program/"+ran_num+".jpg";
document.images['splash'].src = source;
}

function splashpic_gallery (){
var length = 10;
var ran_num = Math.round((length-1)*Math.random());
ran_num=ran_num+1;
var source = "/html/images/gallery/"+ran_num+".jpg";
document.images['splash'].src = source;
}