
function writeHeader()
{	document.write("<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
	//top header
	document.write("<tr>");
	document.write("<td rowspan=\"2\" width=\"50%\" colspan='2'><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"1\" border=\"0\"></td>");
	document.write ("<td rowspan=\"2\" bgcolor=\"#C0C0C0\"><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"1\" border=\"0\"></td>");
	document.write("<td><a href=\"default.html\"><img src='images/header.gif' alt='' width='785' height='86' border='0'></td>");
	document.write ("<td rowspan=\"2\" bgcolor=\"#C0C0C0\"><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"1\" border=\"0\"></td>");
	document.write("<td rowspan=\"2\" width=\"50%\"><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"1\" border=\"0\"></td>");
	document.write("</tr>");
	
	//subheader
	document.write("<tr>");
	document.write("<td><img src='images/subheader.gif' alt='' width='785' height='78' border='0'></td>");
	document.write("</tr>");
	document.write("</table>");
}

function writeFooter(bWhite)
{	document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">");
	document.write("<tr><td><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"40\" border=\"0\"></td></tr>");
	document.write("<tr>");
	document.write("<td align=\"center\">");
	
	document.write("<a href=\"category1.html\" class=\"footer\">Category 1</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"category2.html\" class=\"footer\">Category 2</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"category3.html\" class=\"footer\">Category 3</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"category4.html\" class=\"footer\">Category 4</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"category5.html\" class=\"footer\">Category 5</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"category6.html\" class=\"footer\">Category 6</a><br>");
	
	document.write("<a href=\"#\" class=\"footer\">Contact Us</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"#\" class=\"footer\">About Us</a>");
	
	document.write("</td>");
	document.write("</tr>");
	document.write("<tr><td><img src='images/pagebottom.gif' alt='' width='785' height='45' border='0'></td></tr>");
	document.write("</table>");

}

function writeTools()
{	document.write("<table align=\"right\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
	document.write("<tr><td colspan=\"6\"><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"10\" border=\"0\"></td></tr>");
	document.write("<tr>");
	document.write("<td><a href=\"#\" class=\"tools\">Contact Us</a></td>");
	document.write("<td class=\"footer\">&nbsp;|&nbsp;</td>");
	document.write("<td><a href=\"#\" class=\"tools\">About Us</a></td>");
	//spacer from end of page
	document.write("<td><img src=\"images/spacer.gif\" alt=\"\" width=\"10\" height=\"1\" border=\"0\">");
	document.write("</tr>");
	document.write("</table>");
}

function OpenNewWindow(sURL, sName, sOptions)
{	window.open(sURL, sName, sOptions);
}

function OpenNewWindowCenter(sUrl, sName, nWidth, nHeight, sOptions)
{	var nTop = (screen.height - nHeight) / 2;
	var nLeft = (screen.width - nWidth) / 2;
	window.open(sUrl, sName, "width=" + nWidth + ",height=" + nHeight + ",top=" + nTop + ",left=" + nLeft + "," + sOptions);
}

function openNewWindowRight(sUrl, sName, nWidth, nHeight, sOptions)
{	var nTop = 20;
	var nLeft = (screen.width - nWidth) - 30;
	
	sName = window.open(sUrl, sName, "width=" + nWidth + ",height=" + nHeight + ",top=" + nTop + ",left=" + nLeft + "," + sOptions);
	sName.title = "Craig Ripley Studios"
	sName.focus();
}

function openShirtWindow(sImage, sColor)
{	var sName = "winShirt";
	var sFeatures = "width=405,height=440,top=50,left=50,scrollbars=no,menubar=no,toolbar=no"
	var sUrl =  "shirt_image.aspx?image=" + sImage + "&color=" + sColor;
	window.open(sUrl, sName, sFeatures);
}

function PrintPage()
{	window.print();
}

function ReloadPage()
{	location.reload(true);
}

function isEmpty(sString)
{	if ((sString == null) || (sString.length == 0))
	{ return true;
	}
	
	return false;
}

function isDate(sString)
{	//check for null or empty string
	if ((sString == null) || (sString.length == 0))
	{ return false;
	}
	//check for too short or too long strings
	if ((sString.length < 8) || (sString.length > 10))
	{	return false;
	}
	//check for the first instance of "/"
	var nIndex1 = sString.indexOf("/", 0);
	if ((nIndex1 != 2))
	{	return false;
	}
	else 
	{	//check for the second instance of "/"
		var nIndex2 = sString.indexOf("/", (nIndex1 + 1));
		if ((nIndex2 != 5))
		{ return false;
		}
	}
	//validate the month/day/year strings
	if (isNaN(sString.charAt(0)))
	{	return false;
	}
	if (isNaN(sString.charAt(1)))
	{	return false;
	}
	if (isNaN(sString.charAt(3)))
	{	return false;
	}
	if (isNaN(sString.charAt(4)))
	{	return false;
	}
	if (isNaN(sString.charAt(6)))
	{	return false;
	}
	if (isNaN(sString.charAt(7)))
	{	return false;
	}
	
	if (sString.length == 10)
	{
		if (isNaN(sString.charAt(8)))
		{	return false;
		}
		if (isNaN(sString.charAt(9)))
		{	return false;
		}
	}
	
	return true;
}

function RefreshMe()
{	window.location.reload(true);
}

function RefreshParent()
{	window.opener.RefreshMe();
}

function Modal()
{	self.focus()
}

function preloadImages() 
{	
	if(document.images)
	{ 
		if(!document.arrImages) 
		{
			document.arrImages = new Array();
   			var j = document.arrImages.length
   			var arguments = preloadImages.arguments; 
   			
   			for(var i = 0; i < arguments.length; i++)
   			{
   				if (arguments[i].indexOf("#")!= 0)
   				{ 
   					document.arrImages[j] = new Image; 
   					document.arrImages[j++].src = arrguments[i];
   				}
   			}
   		}
   	}
}