  var MouseOver,MouseOut;
  
  ///////////////////////////////////////////////////////// ANIMATING ON MOUSEOVER
function anim(){
	clearTimeout(MouseOut);
	o=document.getElementById('tip_top');
	l=o.offsetHeight;

	if(l<75){
		o.style.height=(l+3)+"px";

		MouseOver=setTimeout("anim()",5);
		
	}
}

///////////////////////////////////////////////////////// ANIMATING ON MOUSEOUT

function danim(){
	clearTimeout(MouseOver);
	o=document.getElementById('tip_top');

	l=o.offsetHeight;
	
	if(l>45){
		o.style.height=(l-3)+"px";
		MouseOut=setTimeout("danim()",5);

	}
}



 
 









///////////////////////////////////////////////////////// SLIDER CODING


var path, o;
var width=screen.width;


var prev=0; 
var next=1;

	
	///////////////////////////////////////////////////////// INITITALIZATION OF THE SLIDER DIV'S APPLYING THE STYLES , WIDTH,HEIGHT,OVERFLOW
	
	
	
	///////////////////////////////////////////////////////// SETTING THE STYLES FOR INNER DIV OF "WIDESLIDER"

	var slider = document.getElementById('slider1');

	slider.style.width = width+'px';
		slider.style.height = '100%';
		
			var slider2 = document.getElementById('slider2');

	slider2.style.width = width+'px';
		slider2.style.height = '100%';
		
		var slider3 = document.getElementById('slider3');

	slider3.style.width = width+'px';
		slider3.style.height = '100%';
		
		var slider4 = document.getElementById('slider4');

	slider4.style.width = width+'px';
		slider4.style.height = '100%';
		
		var slider5 = document.getElementById('slider5');

	slider5.style.width = width+'px';
		slider5.style.height = '100%';
		
		
		
		///////////////////////////////////////////////////////// SETTING THE STYLES FOR "WIDESLIDER" DIV
				var yourImg1 = document.getElementById('wideslider');
		var width=screen.width*5;

yourImg1.style.width = width+'px';
yourImg1.style.backgroundColor="black";
yourImg1.style.overflow="hidden";


var t1,t2;
var twice = screen.width*2;
var thrice = screen.width*3;
var four = screen.width*4;
var five = screen.width*5;
function animate()
{
	clearTimeout(t2);
	var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);



if(j<-screen.width && j>-twice )
{

o.style.marginLeft=-(screen.width)+"px";
removeanimate();
	
	
}
else
{
	o.style.marginLeft=(j-30)+"px";
t1=setTimeout("animate()",1);	
}

}


///////////////////////////////////////////////////////// ANIMATING THE SLIDERS

function animate1()
{
	clearTimeout(t2);
	var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);



if(j<-twice && j>-thrice)
{

o.style.marginLeft=-((screen.width)*2)+"px";
removeanimate();
	
	
}
else
{
	o.style.marginLeft=(j-30)+"px";
t1=setTimeout("animate1()",1);	
}


}
///////////////////////////////////////////////////////////////////


function animate2()
{
	clearTimeout(t2);
	var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);



if(j<-thrice && j>-four )
{

o.style.marginLeft=-((screen.width)*3)+"px";
removeanimate();
	
	
}
else
{
	o.style.marginLeft=(j-30)+"px";
t1=setTimeout("animate2()",1);	
}


}
///////////////////////////////////////////////////////////////////

function animate3()
{
	clearTimeout(t2);
	var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);



if(j<-four && j>-five )
{

o.style.marginLeft=-((screen.width)*4)+"px";
removeanimate();
	
	
}
else
{
	o.style.marginLeft=(j-30)+"px";
t1=setTimeout("animate3()",1);	
}


}
///////////////////////////////////////////////////////////////////


function animate4()
{
	clearTimeout(t2);
	var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=Number(l.substr(0,(l.length)-2));



if(j>0)
{

o.style.marginLeft="0px";
removeanimate();
	
	
}
else
{
	o.style.marginLeft=(j+30)+"px";
t1=setTimeout("animate4()",1);	
}


}
///////////////////////////////////////////////////////////////////


var counts=0; // VARAIABLE DECLARATION FOR PREVIOUS SLIDER
var nextcounts=0; // VARIABLE DECLATION FOR NEXT SLIDER


///////////////////////////////////////////////////////// REMOVING THE ANIMATION
function removeanimate()

{
	
	clearTimeout(t1);
		var o=document.getElementById('wideslider');
		var k=o.style.marginLeft;



var h=k.substr(0,(k.length)-2);

if(h==0)
{
	counts=0;
	nextcounts=0;
		t2=setTimeout("animate()",5000);

}
else if(h==-(screen.width))
{
	counts=1;
	nextcounts=1;
	t2=setTimeout("animate1()",5000);
	
}
else if(h==-(screen.width)*2)
{
	counts=2;
	nextcounts=2;
	 
	t2=setTimeout("animate2()",5000);
	
}
else if(h==-(screen.width)*3)
{
	counts=3;
	 nextcounts=3;
	t2=setTimeout("animate3()",5000);
	
}

else if(h==-(screen.width)*4)
{
	 counts=4;
	 nextcounts=4;
	t2=setTimeout("animate4()",5000);
	
}

else if(h==-(screen.width)*5)
{
	 
	t2=setTimeout("animate5()",5000);
	
}
	
	
	
	
}

///////////////////////////////////////////////////////// PREVIOUS AND NEXT FUNCTIONS

function Previous()
{
	
clearTimeout(t1);
clearTimeout(t2);

prevanimate();
	
}


function Next()
{
	
clearTimeout(t1);
clearTimeout(t2);

nextanimate();
	
}



///////////////////////////////////////////////////////// ANIMATION FOR PREVIOUS BUTTOM


function prevanimate()
{

if(counts==0)
{
		
	var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);





if(j<=-four)
{

o.style.marginLeft=-(four)+"px";
clearTimeout(t1);
clearTimeout(t2);
counts=4;
nextcounts=4;
}
else
{
	
o.style.marginLeft=(j-20)+"px";
t1=setTimeout("prevanimate()",5);
	
}


}
else if(counts==1)
{
	
		var o=document.getElementById('wideslider');
		
	var l=o.style.marginLeft;

	var len=l.length;

var j=Number(l.substr(0,(l.length)-2));





if(j>=0)
{

o.style.marginLeft="0px";
clearTimeout(t1);
clearTimeout(t2);
counts=0;
nextcounts=0;
}
else
{
	
o.style.marginLeft=(j+20)+"px";

t1=setTimeout("prevanimate()",5);
	
}
	
}
else if(counts==2)
{	

		var o=document.getElementById('wideslider');
		
	var l=o.style.marginLeft;

	var len=l.length;

var j=Number(l.substr(0,(l.length)-2));





if(j>=-screen.width)
{

o.style.marginLeft=-(screen.width)+"px";
clearTimeout(t1);
clearTimeout(t2);
counts=1;
nextcounts=1;
}
else
{
	
o.style.marginLeft=(j+20)+"px";

t1=setTimeout("prevanimate()",5);
	
}
	
}
else if(counts==3)

{
	
			var o=document.getElementById('wideslider');
		
	var l=o.style.marginLeft;

	var len=l.length;

var j=Number(l.substr(0,(l.length)-2));





if(j>=-twice)
{

o.style.marginLeft=-(twice)+"px";
clearTimeout(t1);
clearTimeout(t2);
counts=2;
nextcounts=2;
}
else
{
	
o.style.marginLeft=(j+20)+"px";

t1=setTimeout("prevanimate()",5);
	
}

}
else if(counts==4)
{
	
	
				var o=document.getElementById('wideslider');
		
	var l=o.style.marginLeft;

	var len=l.length;

var j=Number(l.substr(0,(l.length)-2));





if(j>=-thrice)
{

o.style.marginLeft=-(thrice)+"px";
clearTimeout(t1);
clearTimeout(t2);
counts=3;
nextcounts=3;
}
else
{
	
o.style.marginLeft=(j+20)+"px";

t1=setTimeout("prevanimate()",5);
	
}

}

}

///////////////////////////////////////////////////////// ANIMATION FOR NEXT BUTTOM


function nextanimate()
{

if(nextcounts==0)
{
		
	var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);





if(j<=-screen.width)
{

o.style.marginLeft=-(screen.width)+"px";
clearTimeout(t1);
clearTimeout(t2);
nextcounts=1;
counts=1;
}
else
{
	
o.style.marginLeft=(j-20)+"px";
t1=setTimeout("nextanimate()",5);
	
}


}
else if(nextcounts==1)
{
	
	var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);





if(j<=-twice)
{

o.style.marginLeft=-(twice)+"px";
clearTimeout(t1);
clearTimeout(t2);
nextcounts=2;
counts=2;
}
else
{
	
o.style.marginLeft=(j-20)+"px";
t1=setTimeout("nextanimate()",5);
	
}

	
}
else if(nextcounts==2)
{	

		var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);





if(j<=-thrice)
{

o.style.marginLeft=-(thrice)+"px";
clearTimeout(t1);
clearTimeout(t2);
nextcounts=3;
counts=3;
}
else
{
	
o.style.marginLeft=(j-20)+"px";
t1=setTimeout("nextanimate()",5);
	
}

	
}
else if(nextcounts==3)

{
	
		var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=l.substr(0,(l.length)-2);





if(j<=-four)
{

o.style.marginLeft=-(four)+"px";
clearTimeout(t1);
clearTimeout(t2);
nextcounts=4;
counts=4;
}
else
{
	
o.style.marginLeft=(j-20)+"px";
t1=setTimeout("nextanimate()",5);
	
}

}
else if(nextcounts==4)
{
	
	
				var o=document.getElementById('wideslider');
	var l=o.style.marginLeft;

	var len=l.length;

var j=Number(l.substr(0,(l.length)-2));





if(j>=0)
{

o.style.marginLeft="0px";
clearTimeout(t1);
clearTimeout(t2);
nextcounts=0;
counts=0;
}
else
{
	
o.style.marginLeft=(j+20)+"px";

t1=setTimeout("nextanimate()",5);
	
}

}

}


// VALIDATION FOR THE REGISTRATION FORM //

function validateregister()
{
var count=0;

// EMAIL VALIDATION //

var email=document.getElementById('email').value;
 var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;  
   if(!emailPattern.test(email))
   {
	   document.getElementById('email').style.border="1px solid red";
	    document.getElementById('email').focus();
		count+=1;
   }
   else
   {
	   
		   document.getElementById('email').style.border="1px solid green";
	    document.getElementById('email').focus();
		   
   }
   
// --------------------------------------------------------------- FIRSTNAME VALIDATION //

var fname=document.getElementById('fname').value;
if(fname=="" || fname.length<3)
{
	 document.getElementById('fname').style.border="1px solid red";
	    document.getElementById('fname').focus();
		count+=1;
}
else
{
	 document.getElementById('fname').style.border="1px solid green";
	
}


// --------------------------------------------------------------- LAST NAME VALIDATION //

var lname=document.getElementById('lname').value;
if(lname=="" || lname.length<3)
{
	 document.getElementById('lname').style.border="1px solid red";
	    document.getElementById('lname').focus();
		count+=1;
}
else
{
	 document.getElementById('lname').style.border="1px solid green";
	
}

// ---------------------------------------------------------------- ADDRESS VALIDATION //

var address = document.getElementById('street_address').value;

if(address=="")
{
	
	
	 document.getElementById('street_address').style.border="1px solid red";
	    document.getElementById('street_address').focus();
		count+=1;
}
else
{
	 document.getElementById('street_address').style.border="1px solid green";
	
}

// --------------------------------------------------------------- CITY VALIDATION //

var city=document.getElementById('city').value;

if(city=="")
{
	 document.getElementById('city').style.border="1px solid red";
	    document.getElementById('city').focus();
		count+=1;
}
else
{
	 document.getElementById('city').style.border="1px solid green";
	
}

//---------------------------------------------------------------- STATE VALIDATION //

var state=document.getElementById('state').value;

if(state=="")
{

	 document.getElementById('state').style.border="1px solid red";
	    document.getElementById('state').focus();
		count+=1;
}
else
{
	 document.getElementById('state').style.border="1px solid green";
	
}


// -------------------------------------------------------------- ZIP / POSTAL VALIDATION //


var zip=document.getElementById('postal').value;

if(zip=="")
{
	
	 document.getElementById('postal').style.border="1px solid red";
	    document.getElementById('postal').focus();
		count+=1;
}
else
{
	 document.getElementById('postal').style.border="1px solid green";
	
}



// ----------------------------------------------------------------- PHONE VALIDATION //


var phone=document.getElementById('tele_1').value;

if(phone=="")
{
	 document.getElementById('tele_1').style.border="1px solid red";
	    document.getElementById('tele_1').focus();
		count+=1;
}
else
{
	 document.getElementById('tele_1').style.border="1px solid green";
	
}

var tele_1_type=document.getElementById('tele_1_type').value;

if(tele_1_type=="")
{
	 document.getElementById('tele_1_type').style.border="1px solid red";
	    document.getElementById('tele_1_type').focus();
		count+=1;
}
else
{
	 document.getElementById('tele_1_type').style.border="1px solid green";
	
}


var tele_2=document.getElementById('tele_2').value;
var tele_2_type=document.getElementById('tele_2_type').value;

if(tele_2=="" && tele_2_type!="")
{
	 document.getElementById('tele_2').style.border="1px solid red";
	    document.getElementById('tele_2').focus();
		count+=1;
}
else if(tele_2!="" && tele_2_type=="")
{
document.getElementById('tele_2_type').style.border="1px solid red";
	    document.getElementById('tele_2_type').focus();
		count+=1;
}
else if(tele_2!="" && tele_2_type!="")
{
document.getElementById('tele_2').style.border="1px solid green";
document.getElementById('tele_2_type').style.border="1px solid green";
}

// ------------------------------------------------------------------ PASSWORD VALIDATION //

var password=document.getElementById('password').value;

if(password=="" || password.length<8)
{

		 document.getElementById('password').style.border="1px solid red";
	    document.getElementById('password').focus();
		count+=1;
	}


else
{
	 document.getElementById('password').style.border="1px solid green";
	
}

// -------------------------------------------------------------------- CONFIRM PASSWORD VALIDATION //

var confirmpass=document.getElementById('confirm').value;

if(confirmpass!="")
{

if(confirmpass!=password || confirmpass.length<8)	
{
	 document.getElementById('confirm').style.border="1px solid red";
	    document.getElementById('confirm').focus();
		count+=1;
}
else
{
	 document.getElementById('confirm').style.border="1px solid green";
	
}

	
}
else
{

document.getElementById('confirm').style.border="1px solid red";
document.getElementById('confirm').focus();
count+=1;	
	
}

/*
// ------------------------------------- CONVENANT PARTNER VALIDATION //

var partner=document.getElementById('partner').value;

/*if(partner=="")
{
	
	 document.getElementById('partner').style.border="1px solid red";
	    document.getElementById('partner').focus();
		count+=1;
}
else
{
	 document.getElementById('partner').style.border="1px solid green";
	
//}

// ----------------------------------------------------- PARTNER SINCE //

var partner_month=document.getElementById('partner_month').value
var partner_day=document.getElementById('partner_day').value
var partner_year=document.getElementById('partner_year').value

if(partner=="Yes" && partner_month=="")
{
		 document.getElementById('partner_month').style.border="1px solid red";
	    document.getElementById('partner_month').focus();
		count+=1;
}
else if(partner=="Yes" && partner_month!="")
{
	 document.getElementById('partner_month').style.border="1px solid green";
	
}


// --------------------------

if(partner=="Yes" && partner_day=="")
{
		 document.getElementById('partner_day').style.border="1px solid red";
	    document.getElementById('partner_day').focus();
		count+=1;
}
else if(partner=="Yes" && partner_day!="")
{
	 document.getElementById('partner_day').style.border="1px solid green";
	
}

// ----------------------------------

if(partner=="Yes" && partner_year=="")
{
		 document.getElementById('partner_year').style.border="1px solid red";
	    document.getElementById('partner_year').focus();
		count+=1;
}
else if(partner=="Yes" && partner_year!="")
{
	 document.getElementById('partner_year').style.border="1px solid green";
	
}



// ------------------------------------------- // GENDER VALIDATION //

/*var gender=document.getElementById('gender').value;

if(gender=="")
{
		 document.getElementById('gender').style.border="1px solid red";
	    document.getElementById('gender').focus();
		count+=1;
}
else
{
	 document.getElementById('gender').style.border="1px solid green";
	
}*/

//-------------------------------------------------- MARITAL STATUS //

/*var status=document.getElementById('status').value;

if(status=="")
{
		 document.getElementById('status').style.border="1px solid red";
	    document.getElementById('status').focus();
		count+=1;
}
else
{
	 document.getElementById('status').style.border="1px solid green";
	
}

// --------------------------------------------------- BAPTISED //

var baptised=document.getElementById('baptised').value;

/*if(baptised=="")
{
		 document.getElementById('baptised').style.border="1px solid red";
	    document.getElementById('baptised').focus();
		count+=1;
}
else
{
	 document.getElementById('baptised').style.border="1px solid green";
	
//}

// ----------------------------------------------------- DATE BAPTISED //

var baptised_month=document.getElementById('baptised_month').value
var baptised_day=document.getElementById('baptised_day').value
var baptised_year=document.getElementById('baptised_year').value

if(baptised=="Yes" && baptised_month=="")
{
		 document.getElementById('baptised_month').style.border="1px solid red";
	    document.getElementById('baptised_month').focus();
		count+=1;
}
else if(baptised=="Yes" && baptised_month!="")
{
	 document.getElementById('baptised_month').style.border="1px solid green";
	
}


// --------------------------

if(baptised=="Yes" && baptised_day=="")
{
		 document.getElementById('baptised_day').style.border="1px solid red";
	    document.getElementById('baptised_day').focus();
		count+=1;
}
else if(baptised=="Yes" && baptised_day!="")
{
	 document.getElementById('baptised_day').style.border="1px solid green";
	
}

// ----------------------------------

if(baptised=="Yes" && baptised_year=="")
{
		 document.getElementById('baptised_year').style.border="1px solid red";
	    document.getElementById('baptised_year').focus();
		count+=1;
}
else if(baptised=="Yes" && baptised_year!="")
{
	 document.getElementById('baptised_year').style.border="1px solid green";
	
}


// ------------------------------------------------- CHILDREN //

var children=document.getElementById('children').value;

/*if(children=="")
{
		 document.getElementById('children').style.border="1px solid red";
	    document.getElementById('children').focus();
		count+=1;
}
else
{
	 document.getElementById('children').style.border="1px solid green";
	
//}


// ------------------------------------------------------  CHILDREN _ NUMBERS //

var children_num=document.getElementById('children_num').value;

if(children=="Yes" && children_num=="")
{
		 document.getElementById('children_num').style.border="1px solid red";
	    document.getElementById('children_num').focus();
		count+=1;
}
else if(children=="Yes" && children_num!="")
{
	 document.getElementById('children_num').style.border="1px solid green";
	
}


*/


if(count==0)
{
return true;	
}
else
{
	return false;
}


return false;





}

// DISPLAYING THE DIV ON SELECTING YES FOR BAPTISED AND CONVENANT PARTNER //

function displaydiv(selectid,divid)
{
var div=document.getElementById(selectid).value;

if(div=="Yes")
{
document.getElementById(divid).style.display="block";	
}
else
{
document.getElementById(divid).style.display="none";	
} 

return false;
}


// END OF REGISTRATION VALIDATION //




// PRAYER FORM VALIDATION START //


function validateprayerform()
{
var count=0;
var prayer=document.getElementById('prayer').value;
var fname=document.getElementById('fname').value;
var contact_option=document.getElementById('contact_option').value;
var email=document.getElementById('email').value;
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;  


// ---------------------------------------- PRAYER TEXT //
if(prayer=="")
{
	   document.getElementById('prayer').style.border="1px solid red";
	    document.getElementById('prayer').focus();
		count+=1;
   }
   else
   {
   document.getElementById('prayer').style.border="1px solid green";
   }
   
// ----------------------------------------------- FIRST NAME //  
 if(fname=="")
{
	   document.getElementById('fname').style.border="1px solid red";
	    document.getElementById('fname').focus();
		count+=1;
   }
   else
   {
   document.getElementById('fname').style.border="1px solid green";
   }
   
// -------------------------------------------------- CONTACT OPTION //
if(contact_option=="")
{
	   document.getElementById('contact_option').style.border="1px solid red";
	    document.getElementById('contact_option').focus();
		count+=1;
   }
   else
   {
   document.getElementById('contact_option').style.border="1px solid green";
   }
   
   
// ------------------------------------------------------------ EMAIL TESTING //  
   if(!emailPattern.test(email))
   {
	   document.getElementById('email').style.border="1px solid red";
	    document.getElementById('email').focus();
		count+=1;
   }
   else
   {
   document.getElementById('email').style.border="1px solid green";
   }

if(count==0)
{
return true;	
}
else
{
	return false;
}


return false;


}

// PRAYER FORM VALIDATION END //


// CONTACT FORM VALIDATION START //

function validatecontactform()
{
var count=0;
var subject=document.getElementById('subject').value;
var message=document.getElementById('contact_message').value;
var fname=document.getElementById('fname').value;
var lname=document.getElementById('lname').value;
var contact_option=document.getElementById('contact_option').value;
var email=document.getElementById('email').value;
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;  

if(subject=="")
   {
	   document.getElementById('subject').style.border="1px solid red";
	    document.getElementById('subject').focus();
		count+=1;
   }
   else
   {
   document.getElementById('subject').style.border="1px solid green";
   }

// -------------------------------------------------------- MESSAGE VALIDATION //

if(message=="")
   {
	   document.getElementById('contact_message').style.border="1px solid red";
	    document.getElementById('contact_message').focus();
		count+=1;
   }
   else
   {
   document.getElementById('contact_message').style.border="1px solid green";
   }
   
// --------------------------------------------------------- FIRST NAME VALIDATION //

if(fname=="")
   {
	   document.getElementById('fname').style.border="1px solid red";
	    document.getElementById('fname').focus();
		count+=1;
   }
   else
   {
   document.getElementById('fname').style.border="1px solid green";
   }
   
   
// ---------------------------------------------------------------LAST NAME VALIDATION //

if(lname=="")
   {
	   document.getElementById('lname').style.border="1px solid red";
	    document.getElementById('lname').focus();
		count+=1;
   }
   else
   {
   document.getElementById('lname').style.border="1px solid green";
   }


// ---------------------------------------------------------------contact_option VALIDATION //

if(contact_option=="")
   {
	   document.getElementById('contact_option').style.border="1px solid red";
	    document.getElementById('contact_option').focus();
		count+=1;
   }
   else
   {
   document.getElementById('contact_option').style.border="1px solid green";
   }


// ------------------------------------------------------------ EMAIL TESTING //  
   if(!emailPattern.test(email))
   {
	   document.getElementById('email').style.border="1px solid red";
	    document.getElementById('email').focus();
		count+=1;
   }
   else
   {
   document.getElementById('email').style.border="1px solid green";
   }

if(count==0)
{
return true;	
}
else
{
	return false;
}


return false;
}


// CONTACT FORM VALIDATION END //

// PROFILE FORM VALIDATION //

function validateprofile()
{

var count=0;

// ------------------------------------- CONVENANT PARTNER VALIDATION //

var partner=document.getElementById('partner').value;

/*if(partner=="")
{
	
	 document.getElementById('partner').style.border="1px solid red";
	    document.getElementById('partner').focus();
		count+=1;
}
else
{*/
	 document.getElementById('partner').style.border="1px solid green";
	
//}

// ----------------------------------------------------- PARTNER SINCE //

var partner_month=document.getElementById('partner_month').value
var partner_day=document.getElementById('partner_day').value
var partner_year=document.getElementById('partner_year').value

if(partner=="Yes" && partner_month=="")
{
		 document.getElementById('partner_month').style.border="1px solid red";
	    document.getElementById('partner_month').focus();
		count+=1;
}
else if(partner=="Yes" && partner_month!="")
{
	 document.getElementById('partner_month').style.border="1px solid green";
	
}


// --------------------------

if(partner=="Yes" && partner_day=="")
{
		 document.getElementById('partner_day').style.border="1px solid red";
	    document.getElementById('partner_day').focus();
		count+=1;
}
else if(partner=="Yes" && partner_day!="")
{
	 document.getElementById('partner_day').style.border="1px solid green";
	
}

// ----------------------------------

if(partner=="Yes" && partner_year=="")
{
		 document.getElementById('partner_year').style.border="1px solid red";
	    document.getElementById('partner_year').focus();
		count+=1;
}
else if(partner=="Yes" && partner_year!="")
{
	 document.getElementById('partner_year').style.border="1px solid green";
	
}



// ------------------------------------------- // GENDER VALIDATION //

/*var gender=document.getElementById('gender').value;

if(gender=="")
{
		 document.getElementById('gender').style.border="1px solid red";
	    document.getElementById('gender').focus();
		count+=1;
}
else
{
	 document.getElementById('gender').style.border="1px solid green";
	
}*/

//-------------------------------------------------- MARITAL STATUS //

/*var status=document.getElementById('status').value;

if(status=="")
{
		 document.getElementById('status').style.border="1px solid red";
	    document.getElementById('status').focus();
		count+=1;
}
else
{
	 document.getElementById('status').style.border="1px solid green";
	
}*/

// --------------------------------------------------- BAPTISED //

var baptised=document.getElementById('baptised').value;

/*if(baptised=="")
{
		 document.getElementById('baptised').style.border="1px solid red";
	    document.getElementById('baptised').focus();
		count+=1;
}
else
{*/
	 document.getElementById('baptised').style.border="1px solid green";
	
//}

// ----------------------------------------------------- DATE BAPTISED //

var baptised_month=document.getElementById('baptised_month').value
var baptised_day=document.getElementById('baptised_day').value
var baptised_year=document.getElementById('baptised_year').value

if(baptised=="Yes" && baptised_month=="")
{
		 document.getElementById('baptised_month').style.border="1px solid red";
	    document.getElementById('baptised_month').focus();
		count+=1;
}
else if(baptised=="Yes" && baptised_month!="")
{
	 document.getElementById('baptised_month').style.border="1px solid green";
	
}


// --------------------------

if(baptised=="Yes" && baptised_day=="")
{
		 document.getElementById('baptised_day').style.border="1px solid red";
	    document.getElementById('baptised_day').focus();
		count+=1;
}
else if(baptised=="Yes" && baptised_day!="")
{
	 document.getElementById('baptised_day').style.border="1px solid green";
	
}

// ----------------------------------

if(baptised=="Yes" && baptised_year=="")
{
		 document.getElementById('baptised_year').style.border="1px solid red";
	    document.getElementById('baptised_year').focus();
		count+=1;
}
else if(baptised=="Yes" && baptised_year!="")
{
	 document.getElementById('baptised_year').style.border="1px solid green";
	
}


// ------------------------------------------------- CHILDREN //

var children=document.getElementById('children').value;

/*if(children=="")
{
		 document.getElementById('children').style.border="1px solid red";
	    document.getElementById('children').focus();
		count+=1;
}
else
{*/
	 document.getElementById('children').style.border="1px solid green";
	
//}


// ------------------------------------------------------  CHILDREN _ NUMBERS //

var children_num=document.getElementById('children_num').value;

if(children=="Yes" && children_num=="")
{
		 document.getElementById('children_num').style.border="1px solid red";
	    document.getElementById('children_num').focus();
		count+=1;
}
else if(children=="Yes" && children_num!="")
{
	 document.getElementById('children_num').style.border="1px solid green";
	
}

if(count==0)
{
return true;	
}
else
{
	return false;
}


return false;

}

// PROFILE FORM VALIDATION END //


// PASSWORDS FORM VALIDATION //

function validatepasswords()
{
var count=0;

// ----------------------------------------------------------------- CURRENT PASSWORD VALIDATION //

var current_password=document.getElementById('current_password').value;

if(current_password=="" || current_password.length<8)
{

		 document.getElementById('current_password').style.border="1px solid red";
	    document.getElementById('current_password').focus();
		count+=1;
	}


else
{
	 document.getElementById('current_password').style.border="1px solid green";
	
}


// ------------------------------------------------------------------ PASSWORD VALIDATION //

var password=document.getElementById('password').value;

if(password=="" || password.length<8)
{

		 document.getElementById('password').style.border="1px solid red";
	    document.getElementById('password').focus();
		count+=1;
	}


else
{
	 document.getElementById('password').style.border="1px solid green";
	
}

// -------------------------------------------------------------------- CONFIRM PASSWORD VALIDATION //

var confirmpass=document.getElementById('confirm').value;

if(confirmpass!="")
{

if(confirmpass!=password || confirmpass.length<8)	
{
	 document.getElementById('confirm').style.border="1px solid red";
	    document.getElementById('confirm').focus();
		count+=1;
}
else
{
	 document.getElementById('confirm').style.border="1px solid green";
	
}

	
}
else
{

document.getElementById('confirm').style.border="1px solid red";
document.getElementById('confirm').focus();
count+=1;	
	
}
if(count==0)
{
return true;	
}
else
{
	return false;
}


return false;


}

// PASSWORDS FORM VALIDATION END //

// MODIFY FORM VALIDATION START//

function validatemodify()
{
var count=0;
var result=validateregister();

if(result)
{
result=validateprofile();

if(result)
{
count=0;
}
else
{
count=1;
}
}
else
{
result=validateprofile();
count=1;
}



if(count==0)
{
return true;	
}
else
{
	return false;
}


return false;
}

// MODIFY FORM VALIDATION END //

// DISPLAY FORGOT PASSWORD FORM //

function displayforgotform(id)
{
if(id=="login_form")
{
document.getElementById('login_form').style.display='block';
document.getElementById('forgot_form').style.display='none';
}
else
{
document.getElementById('login_form').style.display='none';
document.getElementById('forgot_form').style.display='block';
}
return false;
}
