function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {
  document.getElementById('alert').innerHTML='<B><font color="white" size="3">' + alerttxt + '</font></B>';
  return false
  }
else {return true}
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_required(yourname,"Your Name must be filled out!")==false)
  {
  document.getElementById('yourname').style.backgroundColor="FAF8CC";
  yourname.focus();
  return false
  }
if (validate_required(number,"Phone Number must be filled out!")==false)
  {
  document.getElementById('number').style.backgroundColor="FAF8CC";
  number.focus();
  return false
  }
if (validate_required(sender,"Sender Email must be filled out!")==false)
  {
	document.getElementById('sender').style.backgroundColor="FAF8CC";
	sender.focus();
	return false
  }
if (validate_required(affiliation,"Affiliate must be chosen!")==false)
  {
	document.getElementById('affiliation').style.backgroundColor="FAF8CC";
	affiliation.focus();
	return false
  }
if (validate_required(agreement,"Agreement must be checked!")==false)
  {
	document.getElementById('agreement').style.backgroundColor="FAF8CC";
	agreement.focus();
	return false
  }
}
}

function pageclaim(url, title) {

	var newWindow=window.open("",'','height=700,width=500');
	var urltest = url.toLowerCase();
	var matchPos2 = 0;
	var matchPos = urltest.search("sitepage=productchooser");
	if (matchPos < 0)
	{
		var matchPos2 = urltest.search("sitepage=proof");
	}

if( (matchPos + matchPos2) < 0) {
	newWindow.document.write('<html><head><meta content="text/html; charset=UTF-8"><title>Victoryteamspirit.com: Claim this page</title>');
	newWindow.document.write('<link href="http://www.victoryteamspirit.com/teamstyle2.css" rel="stylesheet" type="text/css">');
	newWindow.document.write('<script language="javascript" src="http://www.victoryteamspirit.com/inviteafriend.js" type="text/javascript"></script>');
	newWindow.document.write('</head><body background="http://www.victoryteamspirit.com/images/pageclaim.gif">');
	newWindow.document.write('<br /><br /><br /><br /><br /><br /><br /><br /><br />');
	newWindow.document.write('<form action="http://www.victoryteamspirit.com/forms/pageclaim.php?url='+ url + '" method="post" onsubmit="return validate_form(this)">');
	newWindow.document.write('<table border="0" cellpadding="0" cellspacing="0" width="400">');
	newWindow.document.write('<tr height="48">');
	newWindow.document.write('<td width="15">&nbsp;</td>');
	newWindow.document.write('<td width="185" colspan="2"><h1>Claim This Page</h1></td>');
	newWindow.document.write('<td width="15">&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('<tr height="38">');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('<td colspan="2"><b><a href="' + url + '" target="_blank">' + title + '</a></b></td>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('<tr height="35">');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('<td><b>Your Name:</b></td>');
	newWindow.document.write('<td><input type="text" name="yourname" id="yourname" maxlength="50" size="30"></td>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('<tr height="35">');
	newWindow.document.write('<td><input type="hidden" name="fullurl" value="' + url + '">&nbsp;</td>');
	newWindow.document.write('<td><b>Your E-mail Address:</b></td>');
	newWindow.document.write('<td><input type="text" name="sender" id="sender" maxlength="50" size="30"></td>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('<tr height="35">');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('<td><b>Your Phone Number:</b></td>');
	newWindow.document.write('<td><input type="text" name="number" id="number" maxlength="50" size="30"></td>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('</tr>');
        newWindow.document.write('<tr>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('<td><b>Comments:</b></td>');
	newWindow.document.write('<td><textarea name="note" id="note" cols=25 rows=3></textarea></td>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('<tr height="35">');
	newWindow.document.write('<td><input type="hidden" name="fullurl" value="' + url + '">&nbsp;</td>');
	newWindow.document.write('<td><b>Affiliation:</b></td>');
	newWindow.document.write('<td><select name="affiliation" id="affiliation"><option value="Booster Club">Booster Club</option><option value="Principal">Principal</option><option value="Atheletic Director">Athletic Director</option><option value="Superintendent">Superintendent</option><option value="Other">Other</option></selct></td>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('<tr height="80">');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('<td colspan="2">');
		newWindow.document.write('<div style="overflow:auto; height:70px; background-color:gray"><b>Terms and Conditions</b><br />lkdjlf jasl jslk jlskj lkj lksj lkjl kjljl jlsd jfljlsdkj flak jlsakj flksjd lsaj lfj;sk jl jl jsl kjflsjl jsl kjfsdlkj flsdkj lsdkj flsdkj lksjd lksafoi whflksnvrh ljsdlk jhldskh lkdsh lksdh lhdso ihaosi hofehrlesh flkhdliusovlhwflshoihvloihvlsrehflewhf oes hfoiwe hvclsdhv ldxzhvlhs oviwsh lvshlv hefi</div>');
	newWindow.document.write('</td>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('<tr height="35">');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('<td colspan="2" align="center"><b>I Agree:</b><input type="checkbox" name="agreement" id="agreement"></td>');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('<tr height="60">');
	newWindow.document.write('<td>&nbsp;</td>');
	newWindow.document.write('<td colspan="2"><input type="submit" value="Claim This Page" style="background-color: #f89828; color: black;"></td>');
	newWindow.document.write('<td width="25">&nbsp;</td>');
	newWindow.document.write('</tr>');
	newWindow.document.write('</table>');
	newWindow.document.write('</form>');
	newWindow.document.write('<div style="position: absolute; bottom: 26px; right: 20px; "><a href="javascript:self.close()"><img src="http://www.victoryteamspirit.com/images/close.gif" border="0" alt="close window"></a></div>');
	newWindow.document.write('<div id="alert" name="alert" style="position: absolute; top: 560px; left: 93px; "></div>');
	newWindow.document.write('</body></html>');
	}
else
	{
		newWindow.document.write('<html><head><meta content="text/html; charset=UTF-8"><title>Victoryteamspirit.com: E-mail a Friend</title>');
		newWindow.document.write('<script language="javascript" src="http://www.victoryteamspirit.com/pageclaim.js" type="text/javascript"></script>');
		newWindow.document.write('</head><body background="http://www.victorystore.com/send2friend/email-friend.jpg">');
		newWindow.document.write('<br /><br /><br /><br /><br />');
		newWindow.document.write("<p style='padding-left:20px;padding-right:20px;'>We are sorry!  You are not able to send this page to your friend!</p>");
		if (matchPos > 0 )
		{
			newWindow.document.write("<p style='padding-left:20px;padding-right:20px;'>If you would like to send one of the designs to your friend, click on the design below and from the editor, click on the Email To Friend option.</p>");
		}
		if (matchPos2 > 0 )
		{
			newWindow.document.write("<p style='padding-left:20px;padding-right:20px;'>If you would like to send this design to your friend, go back one page to the editor and from there, click on the Email To Friend option.</p>");
		}
		newWindow.document.write("<p style='padding-left:20px;padding-right:20px;'>Again, we are sorry!  Thank you for using our system!</p>");
		newWindow.document.write('<div style="position: absolute; bottom: 26px; right: 20px; "><a href="javascript:self.close()"><img src="http://www.victorystore.com/send2friend/close.jpg" border="0" alt="close window"></a></div>');
		newWindow.document.write('<div id="alert" name="alert" style="position: absolute; top: 560px; left: 93px; "></div>');
		newWindow.document.write('</body></html>');
	}
	newWindow.document.close();
	newWindow.focus();
}


