/********************************************************************/
/*********** G l o b a l   D e c l a r a t i o n s ******************/
/********************************************************************/
var OpenWindow=null;
var prno='xx00';

var bFirst=false;
var bLast=false;

var sectmax=0;
var bbmax=0;
var sbmax=0;
var brmax=0;
var cbrmax=0;
var crmax=0;
var trmax=0;
var swmax=0;
var rlmax=0;

var strsql='';

/********************************************************************/
/********************************************************************/

function hi()
{
//alert("screen.width-350="+(screen.width-350));
	var WelcomeWindow=window.open('', 'welcome', 'height=340,width=300,top=20,left=160,scrollbars=1');
	WelcomeWindow.document.write("<HTML>\n")
	WelcomeWindow.document.write("<HEAD><TITLE>What's New @ JLC</TITLE></HEAD>\n")
	WelcomeWindow.document.write("<BODY bgcolor=#eaeaea>\n")
	WelcomeWindow.document.write("<table width=100%><tr><td>\n")
	WelcomeWindow.document.write("<center><font color=navy><font size=4><b>Welcome to the New<br>Jesus Loves Cowboys Website !</b></center></font><hr>\n")
	WelcomeWindow.document.write("This is where we'll tell you about all the new stuff. <p>\n")
	WelcomeWindow.document.write("<u><b>2004-Feb-20</b></u><br>\n")
	WelcomeWindow.document.write("Well if you've been here before, you didn't get here the same way as before. Unfortunately we lost our old web address, but God blessed us with 2 (<b><i> ! </i></b>)new ones:<br>\n")
	WelcomeWindow.document.write("<center>www.jesuslovescowboys.com<br>and<br>www.susiegraham.org</center><p>\n")
	WelcomeWindow.document.write("While we were changing things around, we figured we might as well change a lot. We're still in the process of getting all the new stuff done, so please bear with us.<p>\n")
	WelcomeWindow.document.write("We've added a entirely new photo gallery including photos from outside the sport of rodeo that you can browse through and purchase photo quality prints. <font size=-1>(<i>I know it's hard to believe, but there is life outside of rodeo</i>.) </font><p>\n")
	WelcomeWindow.document.write("We'll be adding pages of inspirational reading, tributes to those of our ministry who have lost their lives, prayer requests and a place where you can sign up to be notified of news and additions to the site.<p>\n")
	WelcomeWindow.document.write("We're just being blessed with new ideas right & left, so stayed tuned !<p>\n")
	WelcomeWindow.document.write("God Bless...<br>\n")
	WelcomeWindow.document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/_susie.jpg'>&nbsp;<p>\n")
	WelcomeWindow.document.write("</td></tr><tr><td><center><p><table border cellpadding=10><tr><tr><td align=center valign=bottom><font face=arial,helvetica size=2><a href='javascript:window.close()' onfocus='this.blur()'><b>Close</b></a></td></tr></table></BODY></center>\n")
	WelcomeWindow.document.write("</td></tr></table>\n")
	WelcomeWindow.document.write("</HTML>\n")
}
/********************************************************************/

function sCart()
    {
	var OpenWindow=window.open('', 'scart', 'height=520,width=367,top=10,left=100', 'prno');


	var picName=prno;
	OpenWindow.document.write("<HTML>\n")
	OpenWindow.document.write("<HEAD><TITLE>Susie Graham Rodeo Photography Order Info</TITLE></HEAD>\n")
	OpenWindow.document.write("<BODY background='images/orderbg2.jpg'>\n")
	OpenWindow.document.write("<center><font size=4 color=navy><b>Susie Graham Rodeo Photography</b></font></center>\n")
	OpenWindow.document.write("<table width=350 border>\n")
	OpenWindow.document.write("	<tr><td align=center>\n")
	OpenWindow.document.write("	<table width=100%>\n")
	OpenWindow.document.write("		<tr>\n")
	OpenWindow.document.write("			<td align=center width=225>\n")
	OpenWindow.document.write("				<font color=navy><b>Confirm your Selection:<p>"+prno+"</b></font>\n")
	OpenWindow.document.write("			</td>\n")
	OpenWindow.document.write("			<td>\n")
//	if (tw=='')
//		{
		OpenWindow.document.write("				<img src='images/"+picName.toLowerCase()+"s.jpg' align=right alt='"+at+"'>\n")
//		}
//	else
//		{
//		OpenWindow.document.write("				<img src='images/"+picName.toLowerCase()+"s.jpg' align=right height="+tw+" width="+th+" alt='"+at+"'>\n")
//		}
	OpenWindow.document.write("			</td>\n")
	OpenWindow.document.write("		</tr>\n")

// order a print
	OpenWindow.document.write("		<tr>\n")
	OpenWindow.document.write("			<td align=center valign=center>\n")
	OpenWindow.document.write("				<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>\n")
	OpenWindow.document.write("				<input type='hidden' name='on0' value='Print #'>\n")
	OpenWindow.document.write("				<input type='hidden' name='os0' value="+prno+">\n")

	if (th==100)
		{OpenWindow.document.write("&nbsp;<br>\n")}

	OpenWindow.document.write("				<input type='image' src='images/btnPrt.jpg' border='0' height=23 width=130 width=90 height=21 name='submit' alt='Click here to order an 8x10 print'>\n")
	OpenWindow.document.write("				<input type='hidden' name='add' value='1'>\n")
	OpenWindow.document.write("				<input type='hidden' name='cmd' value='_cart'>\n")
	OpenWindow.document.write("				<input type='hidden' name='business' value='whohl@techsupportservices.biz'>\n")
	OpenWindow.document.write("				<input type='hidden' name='item_name' value='Digital Photo Print'>\n")
	OpenWindow.document.write("				<input type='hidden' name='amount' value='20.00'>\n")
	OpenWindow.document.write("				<input type='hidden' name='page_style' value='PayPal'>\n")
	OpenWindow.document.write("				<input type='hidden' name='currency_code' value='USD'><br>&nbsp;\n")
	OpenWindow.document.write("			</td>\n")
	if (th==100)
		{OpenWindow.document.write("<td valign=top><font color=navy>&nbsp;<br><b>$20.00</b></td>\n")}
	else
		{OpenWindow.document.write("<td valign=top><font color=navy><b>$20.00</b></td>\n")}

	OpenWindow.document.write("		</tr>\n")
	OpenWindow.document.write("		</form>\n")

// order a frame
	OpenWindow.document.write("		<tr>\n")
	OpenWindow.document.write("			<td align=center valign=center>\n")
	OpenWindow.document.write("				<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>\n")
	OpenWindow.document.write("				<input type='image' src='images/btnFrm.jpg' border='0' height=23 width=130 width=90 height=21 name='submit' alt='Click here to order a frame'>\n")
	OpenWindow.document.write("				<input type='hidden' name='add' value='1'>\n")
	OpenWindow.document.write("				<input type='hidden' name='cmd' value='_cart'>\n")
	OpenWindow.document.write("				<input type='hidden' name='business' value='whohl@techsupportservices.biz'>\n")
	OpenWindow.document.write("				<input type='hidden' name='item_name' value='White Mat Frame'>\n")
	OpenWindow.document.write("				<input type='hidden' name='amount' value='5.00'>\n")
	OpenWindow.document.write("				<input type='hidden' name='page_style' value='PayPal'>\n")
	OpenWindow.document.write("				<input type='hidden' name='currency_code' value='USD'><br>&nbsp;\n")
	OpenWindow.document.write("			</td>\n")
	if (th==100)
		{OpenWindow.document.write("<td valign=top><font color=navy><b>&nbsp;<br><b>&nbsp;&nbsp;$5.00</b></td>\n")}
	else
		{OpenWindow.document.write("<td valign=top><font color=navy><b><b>&nbsp;&nbsp;$5.00</b></td>\n")}
	OpenWindow.document.write("		</tr>\n")
	OpenWindow.document.write("		</form>\n")


//	OpenWindow.document.write("		<tr>\n")
//	OpenWindow.document.write("			<td align=center><input type='hidden' name='on1' value='Matte Frame'><input type='image' src='images/btnFrm.jpg' name='on1' value='Matte Frame'><font color=navy></font></td>\n")
//	OpenWindow.document.write("			<td align=right><font color=navy><b>$5.00</b></td>\n")
//	OpenWindow.document.write("		</tr>\n")
//	OpenWindow.document.write("		<tr>\n")
//	OpenWindow.document.write("			<td colspan=2><input type='hidden' name='on1' value='10 Asst Cards'><input type='checkbox' name='on1' value='Matte Frame'><font color=navy><b>10 Assorted Inspirational Cards &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$20.00</b></font></td>\n")
//	OpenWindow.document.write("		</tr>\n")
	OpenWindow.document.write("		<tr>\n")

	OpenWindow.document.write("			<td colspan=2 align=center>\n")
//	OpenWindow.document.write("				<br>\n")
	OpenWindow.document.write("				<hr color=navy></td>\n")

	OpenWindow.document.write("		</tr>\n")
	OpenWindow.document.write("		<tr>\n")
	OpenWindow.document.write("			<td colspan=2 align=center><font color=navy>Orders are shipped in 24-48 hrs.<br><center>* * * Satisfaction Guaranteed * * *<br>A portion of the proceeds are used to support<br><img src='images/jlc_min.gif'></center></font></td>\n")
	OpenWindow.document.write("		</tr>\n")
	OpenWindow.document.write("		<tr>\n")
	OpenWindow.document.write("			<td colspan=2 align=center valign=center><font face=arial,helvetica color=navy><br><a href='mailto:admin@susiegraham.org'><b>Ordering Questions</A><br>410.661.7253</b><hr color=navy></td>\n")
	OpenWindow.document.write("		</tr>\n")

	OpenWindow.document.write("<!-- Begin View Cart -->\n")
	OpenWindow.document.write("		<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>\n")
	OpenWindow.document.write("		<input type='hidden' name='cmd' value='_cart'><input type='hidden' name='business' value='whohl@techsupportservices.biz'>\n")
	OpenWindow.document.write("		<tr>\n")
	OpenWindow.document.write("			<td colspan=2 align=center>\n")
	OpenWindow.document.write("				&nbsp;<br><input type='image' src='images/btnCart.jpg' border='0' width=154 height=29 name='submit' alt='Payments processed by PayPal'>&nbsp;<p>\n")
	OpenWindow.document.write("				<input type='hidden' name='display' value='1'>\n")
	OpenWindow.document.write("				<input type='hidden' name='page_style' value='PayPal'>\n")
	OpenWindow.document.write("			</td>\n")
	OpenWindow.document.write("		</tr>\n")
	OpenWindow.document.write("		</form>\n")
	OpenWindow.document.write("		<!-- End View Cart -->\n")

	OpenWindow.document.write("	</table>\n")
	OpenWindow.document.write("	</td></tr>\n")
	OpenWindow.document.write("</table>\n")

	OpenWindow.document.write("</BODY>\n")
	OpenWindow.document.write("</HTML>\n")
    }

/********************************************************************/

function nLarge(recno,sql)
    {
	var pic="nLarge.php?recno="+recno+"&sql="+sql;
	var nLargeWindow=window.open(pic, 'nLargeWindow', 'height=405,width=630,top=20,left=100');
	}

/********************************************************************/
function retreat()
    {
	var OpenWindow=window.open('', 'retreat', 'height=480,width=550,top=20,left=100,scrollbars=yes');

	OpenWindow.document.write("<HTML>\n")
	OpenWindow.document.write("<HEAD><TITLE>Christian Cowboy Retreat 06/14/2003</TITLE></HEAD>\n")
	OpenWindow.document.write("<BODY bgcolor=#eaeaea>\n")
	OpenWindow.document.write("<center>\n")
	OpenWindow.document.write("<img src='images/jlcbanner.jpg' width=500 height=100><p>\n")
	OpenWindow.document.write("<table cellpadding=5>\n")
	OpenWindow.document.write("	<tr><td align=center colspan=2><FONT FACE=times new roman SIZE=6 color=navy><b><i>2nd Annual<br>COWBOY CHRISTIAN RETREAT</i></b><hr color=navy width=85%></td></tr>\n")
	OpenWindow.document.write("	<tr><td align=right><FONT FACE=times new roman SIZE=5 color=navy><b>DATE:</b></td><td align=left><FONT FACE=times new roman SIZE=4 color=navy>Saturday, June 19, 2004</td></tr>\n")
	OpenWindow.document.write("	<tr><td align=right><FONT FACE=times new roman SIZE=5 color=navy><b>TIME:</b></td><td align=left><FONT FACE=times new roman SIZE=4 color=navy>10:30am to 4:00pm  Rain or Shine</td></tr>\n")
	OpenWindow.document.write("	<tr><td align=right valign=top><FONT FACE=times new roman SIZE=5 color=navy><b>PLACE:</b></td><td align=left><FONT FACE=times new roman SIZE=4 color=navy>Home of Paul and Susie Graham<br>53 North Golfwood Road<br>Penns Grove, NJ  08069<br>Phone: 856-299-3475<br><A HREF='mailto:susieg@susiegraham.org'>susieg@susiegraham.org</a><br><a href='http://www.jesuslovescowboys.com' target=new>www.jesuslovescowboys.com</a><br></td></tr>\n")
	OpenWindow.document.write("	<tr><td align=center colspan=2><FONT FACE=times new roman SIZE=5 color=navy>* * * All Are Welcome * * *<br>Lots of Great Country & Gospel Music<br>to enjoy and heart-felt testimonies to inspire</td></tr>\n")
	OpenWindow.document.write("	<tr><td align=center colspan=2><hr width=65%></font></td></tr>\n")
	OpenWindow.document.write("	<tr><td align=center colspan=2><FONT FACE=times new roman SIZE=5 color=navy>Special Guests:<br>Darlene & Mike Fletcher<br><FONT SIZE=3><i>3 Time World Champion <br>Saddle Bronc Rider from Okeechobee, FL</i></font></td></tr>\n")
	OpenWindow.document.write("	<tr><td align=center colspan=2><hr width=65%></font></td></tr>\n")
	OpenWindow.document.write("	<tr><td align=center><FONT FACE=times new roman SIZE=5 color=navy>Lunch Provided</td><td align=right><FONT FACE=times new roman SIZE=5 color=navy>Love Offering Accepted</td></tr>\n")
	OpenWindow.document.write("	<tr><td align=center colspan=2><FONT FACE=times new roman SIZE=5 color=navy>Please bring a lawn chair<hr width=65%></font></td></tr>\n")
	OpenWindow.document.write("	<tr><td align=center valign=top colspan=2><FONT FACE=times new roman SIZE=4 color=navy>Phone: 856-299-3475<br><A HREF='mailto:susieg@susiegraham.org'>susieg@susiegraham.org</a><br><a href='http://www.jesuslovescowboys.com' target=new>www.jesuslovescowboys.com</a><br></td></tr>\n")
	OpenWindow.document.write("	<tr><td align=center colspan=2><hr width=65%></font></td></tr>\n")
	OpenWindow.document.write("</table>\n")
	OpenWindow.document.write("<table border cellpadding=5<tr><td align=center><a href='' onClick='self.close()'><b>Close This Window</b></a></td></tr></table>")
	OpenWindow.document.write("</center>\n")
	OpenWindow.document.write("</BODY>\n")
	OpenWindow.document.write("</HTML>\n")

	}

/********************************************************************/

function changeSect(section)
	{
	switch (section) {
		case 0:
			sectName='BB';//Bare Back';
			break;
		case 1:
			sectName='SB';//'Saddle Bronc';
			break;
		case 2:
			sectName='BR';//'Bull Riding';
			break;
		case 3:
			sectName='BF';//'Barrel Racing';
			break;
		case 4:
			sectName='CB';//'Barrel Racing';
			break;
		case 5:
			sectName='CR';//'Calf Roping';
			break;
		case 6:
			sectName='TR';//'Team Roping';
			break;
		case 7:
			sectName='SW';//'Steer Wrestling';
			break;
		case 8:
			sectName='RL';//'Rodeo Life';
			break;
		case 9:
			sectName='OT';//'Other Photos';
			break;
	}
		
	var strsql="SELECT * FROM photos WHERE left(id,2)='"+sectName+"' ORDER BY id;";

	nLarge(0,strsql);

	}

/********************************************************************/

function nav(recno)	
	{
	
		
	var picName=idx;
	var sectNm=idx.substr(0,idx.length-2);
	var picNum=idx.substr(idx.length-2,2);
	var jpgName=idx.substr(0,idx.length-2)+picNum+'.jpg';
	var jpgName=jpgName.toLowerCase();

	if (bNext)
		{
		if (Number(picNum) < sectmax) {
			var numPic=eval(Number(picNum)+1);
			var numPic=''+numPic
			if(numPic.length==1)
				{numPic='0'+numPic;}
				 picNum=numPic;	

			var nextJpg=sectNm+numPic+'.jpg'
			var nextJpg=nextJpg.toLowerCase();

			document.picSpec.src='images/'+nextJpg;
			idx=numPic;

//alert("Moving forward to\n"+nextJpg+"\n");
			nLarge('+sectNm+numPic+');	

			}
		}

	else
		{

			if (Number(picNum) > 1) {
				var numPic=eval(Number(picNum)-1);
				var numPic=''+numPic
				if(numPic.length==1)
					{numPic='0'+numPic;}
					 picNum=numPic;	
	
				var nextJpg=sectNm+numPic+'.jpg'
				var nextJpg=nextJpg.toLowerCase();
	
				document.picSpec.src='images/'+nextJpg;
				prno=sectNm+numPic;
	
//alert("Moving back to\n"+nextJpg+"\n");
				}
			}

	nLarge('+sectNm+numPic+');
	
	history.go(0);

	}

/********************************************************************/
/********************************************************************/
/********************************************************************/
/********************************************************************/
/********************************************************************/
/********************************************************************/
/********************************************************************/

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);
}

/********************************************************************/

