﻿function submit_search(){
	document.searchform.action.value = "search";
	document.searchform.submit();
}
//CALENDAR FUNCTIONS
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_openBrWindow(id) {
  document.searchform.id.value = id;
  document.searchform.submit();
}
function cal_remove(rid) {
  if (confirm("Are you sure you want to remove this event?")) {
  document.searchform.action.value = "remevent";
  document.searchform.rid.value = rid;
  document.searchform.submit();
  }
}
function add_calemail(id){
	document.searchform.action.value = "addcalemail";
	document.searchform.id.value = id;
	document.searchform.submit();
}
function update_calemail(uid,id){
	document.searchform.action.value = "updatecalemail";
	document.searchform.uid.value = uid;
	document.searchform.id.value = id;
	document.searchform.submit();
}
function remove_calemail(id){
	document.searchform.action.value = "removecalemail";
	document.searchform.id.value = id;
	document.searchform.submit();
}
function add_calsms(id){
	document.searchform.action.value = "addcalsms";
	document.searchform.id.value = id;
	document.searchform.submit();
}
function update_calsms(uid,id){
	document.searchform.action.value = "updatecalsms";
	document.searchform.uid.value = uid;
	document.searchform.id.value = id;
	document.searchform.submit();
}
function remove_calsms(id){
	document.searchform.action.value = "removecalsms";
	document.searchform.id.value = id;
	document.searchform.submit();
}
//END CALENDAR FUNCTIONS
function submit_searchpopofficial(){
	document.popform.action.value = "selectofficial";
	document.popform.submit();
}

function submit_searchpopblock(){
	document.popform.action.value = "blockslot";
	document.popform.submit();
}

function popcontact(URL) {
	var popup_width = 700
	var popup_height = 400
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width='+popup_width+',height='+popup_height+'');");
}
function submit_draftee_search(tID,trmID,sID,lID){
	document.searchform.action.value = "search";
	document.searchform.tID.value = tID;
	document.searchform.trmID.value = trmID;
	document.searchform.sID.value = sID;
	document.searchform.lID.value = lID;
	document.searchform.submit();
}
function submit_blog_search(sID, trmID, lID, tID){
	document.searchform.action.value = "search";
	document.searchform.sID.value = sID;
	document.searchform.trmID.value = trmID;
	document.searchform.lID.value = lID;
	document.searchform.tID.value = tID;
	document.searchform.submit();
}
function page_blog_search(admPage,teamPage,sID, trmID, lID, tID){
	document.searchform.action.value = "search";
	document.searchform.apage.value = admPage;
	document.searchform.tpage.value = teamPage;
	document.searchform.sID.value = sID;
	document.searchform.trmID.value = trmID;
	document.searchform.lID.value = lID;
	document.searchform.tID.value = tID;
	document.searchform.submit();
}
function page_player_search(admPage, pid, lname, fname, emailadd){
	document.searchform.action.value = "search";
	document.searchform.apage.value = admPage;
	document.searchform.pid.value = pid;
	document.searchform.lname.value = lname;
	document.searchform.fname.value = fname;
	document.searchform.emailadd.value = emailadd;
	document.searchform.submit();
}
function page_glb_blog_search(glbPage){
	document.searchform.action.value = "search";
	document.searchform.gpage.value = glbPage;
	document.searchform.submit();
}
function submit_blog_post(sID, trmID, lID, tID){
	document.searchform.action.value = "postblog";
	document.searchform.sID.value = sID;
	document.searchform.trmID.value = trmID;
	document.searchform.lID.value = lID;
	document.searchform.tID.value = tID;
	document.searchform.submit();
}
function submit_global_blog_post(){
	document.searchform.action.value = "globalblog";
	document.searchform.submit();
}
function remove_post(blogID){
if (confirm("Are you sure you want to delete this post?")) {
	document.searchform.action.value = "removeblog";
	document.searchform.bID.value = blogID;
	document.searchform.submit();
}
}

//ADD ADMIN ACCOUNT
function submit_addadminaccount(){
if (confirm("Are you sure you want to add this admin account?")) {
	document.searchform.action.value = "addadminaccount";
	document.searchform.submit();
}
}

//REMOVE ADMIN ACCOUNT
function submit_removeadminaccount(editid){
if (confirm("Are you sure you want to REMOVE this admin account?")) {
	document.searchform.action.value = "removeadminaccount";
	document.searchform.editid.value = editid;
	document.searchform.submit();
}
}

//ADD SPORTS CHAIR ACCOUNT
function submit_addchairaccount(){
if (confirm("Are you sure you want to add this sports chair account?")) {
	document.searchform.action.value = "addchairaccount";
	document.searchform.submit();
}
}

//REMOVE SPORTS CHAIR ACCOUNT
function submit_removechairaccount(editid){
if (confirm("Are you sure you want to REMOVE this sports chair account?")) {
	document.searchform.action.value = "removechairaccount";
	document.searchform.editid.value = editid;
	document.searchform.submit();
}
}

//SHOW UPDATE SPORTS CHAIR ACCOUNT
function submit_updatechairaccount(editid,houseid){
if (confirm("Are you sure you want to UPDATE this sports chair account?")) {
	document.searchform.action.value = "search";
	document.searchform.editid.value = editid;
	document.searchform.houseid.value = houseid;
	document.searchform.submit();
}
}

//UPDATE SPORTS CHAIR ACCOUNT
function submit_updatechairaccountperm(houseid){
if (confirm("Are you sure you want to UPDATE this sports chair account?")) {
	document.searchform.action.value = "updatechair";
	document.searchform.houseid.value = houseid;
	document.searchform.submit();
}
}

//ADD PLAYER TO ROSTER
function addroster(lnID, sID){
if (confirm("Are you sure you want to add this player to your roster?")) {
	document.searchform.action.value = "addroster";
	document.searchform.lnID.value = lnID;
	document.searchform.sID.value = sID;
	document.searchform.submit();
}
}

//REMOVE PLAYER FROM ROSTER
function removeroster(sID){
if (confirm("Are you sure you want to remove this player from your roster?")) {
	document.searchform.action.value = "removeroster";
	document.searchform.sID.value = sID;
	document.searchform.submit();
	}
}

//SUBMIT TEAM ENTRY FORM
function submit_addteamsearch(){
if (confirm("Are you sure you want to create this team?")) {
	document.searchform.action.value = "addteam";
	document.searchform.submit();
	}
}

//SUBMIT TEAM ENTRY FORM
function submit_addgreekteamsearch(){
if (confirm("Are you sure you want to create this greek team?")) {
	document.searchform.action.value = "addgreekteam";
	document.searchform.submit();
	}
}

//SCHEDULEING FUNCTIONS
function submit_popsearch(action){
	document.popform.action.value = action;
	document.popform.submit();
}

function submit_sportsearch(sportid){
	document.searchform.sportid.value = sportid;
	document.searchform.submit();
}

function submit_sportofficialsearch(sportidid,officialid){
	document.searchform.sportid.value = sportid;
	document.searchform.officialid.value = officialid;
	document.searchform.submit();
}

var thesport;
var theperiod;
var theshift;
var thelocation;
var theworkdate;
var theblockstatus;
var newwin;
function popedit(sportid,periodid,tshiftID,editschedule,tlocationID,tworkdateID,blockstatus)
{
document.searchform.sportid.value = sportid;
document.searchform.periodid.value = periodid;
document.searchform.tshiftID.value = tshiftID;
document.searchform.editschedule.value = editschedule;
document.searchform.tlocationID.value = tlocationID;
document.searchform.tworkdateID.value = tworkdateID;
document.searchform.blockstatus.value = blockstatus;

thesport = document.searchform.sportid.value
theperiod = document.searchform.periodid.value
theshift = document.searchform.tshiftID.value
thelocation = document.searchform.tlocationID.value
theworkdate = document.searchform.tworkdateID.value
theblockstatus = document.searchform.blockstatus.value

newwin = window.open("schedule_choose_pop.php","","width=300,height=400,resizable")
}

function writedata()
{
document.popform.sportid.value = opener.thesport
document.popform.periodid.value = opener.theperiod
document.popform.shiftID.value = opener.theshift
document.popform.locationID.value = opener.thelocation
document.popform.workdateID.value = opener.theworkdate
document.popform.blockstatus.value = opener.theblockstatus
}

function updateit()
{

opener.document.searchform.sportid.value = document.popform.sportid.value
opener.document.searchform.periodid.value = document.popform.periodid.value
opener.document.searchform.shiftID.value = document.popform.shiftID.value
opener.document.searchform.locationID.value = document.popform.locationID.value
opener.document.searchform.dateID.value = document.popform.workdateID.value
opener.document.searchform.officialID.value = document.popform.officialid.value

opener.document.searchform.action.value = "addworkshift";
opener.document.searchform.submit();
window.close()

}

function blockupdateit()
{

opener.document.searchform.sportid.value = document.popform.sportid.value
opener.document.searchform.periodid.value = document.popform.periodid.value
opener.document.searchform.shiftID.value = document.popform.shiftID.value
opener.document.searchform.locationID.value = document.popform.locationID.value
opener.document.searchform.dateID.value = document.popform.workdateID.value

opener.document.searchform.action.value = "blockworkshift";
opener.document.searchform.submit();
window.close()

}

function unblockupdateit()
{

opener.document.searchform.sportid.value = document.popform.sportid.value
opener.document.searchform.periodid.value = document.popform.periodid.value
opener.document.searchform.shiftID.value = document.popform.shiftID.value
opener.document.searchform.locationID.value = document.popform.locationID.value
opener.document.searchform.dateID.value = document.popform.workdateID.value

opener.document.searchform.action.value = "unblockworkshift";
opener.document.searchform.submit();
window.close()

}

function submit_addlocation(){
	if (confirm("Are you sure you want to add this location?")) {
		document.searchform.action.value = "addlocation";
		document.searchform.submit();
	}
}

function submit_removelocation(removeID){
	if (confirm("Are you sure you want to REMOVE this location?")) {
		document.searchform.action.value = "removelocation";
		document.searchform.removeID.value = removeID;
		document.searchform.submit();
	}
}

function submit_addshift(){
if (confirm("Are you sure you want to add this shift?")) {
	document.searchform.action.value = "addshift";
	document.searchform.submit();
	}
}

function submit_removeshift(removeID){
if (confirm("Are you sure you want to REMOVE this shift?")) {
	document.searchform.action.value = "removeshift";
	document.searchform.removeID.value = removeID;
	document.searchform.submit();
	}
}

function submit_addperiod(){
if (confirm("Are you sure you want to add this period?")) {
	document.searchform.action.value = "addperiod";
	document.searchform.submit();
	}
}

function submit_removeperiod(removeID){
if (confirm("Are you sure you want to REMOVE this period?")) {
	document.searchform.action.value = "removeperiod";
	document.searchform.removeID.value = removeID;
	document.searchform.submit();
	}
}

function submit_removetimeblock(blockID){
if (confirm("Are you sure you want to remove this time block?")) {
	document.searchform.action.value = "removetimeblock";
	document.searchform.blockID.value = blockID;
	document.searchform.submit();
	}
}

function submit_removeofficial(rsID){
if (confirm("Are you sure you want to remove this official? This will completly remove their schedule from the database!")) {
	document.searchform.action.value = "removeofficial";
	document.searchform.rsID.value = rsID;
	document.searchform.submit();
	}
}

function submit_removescheduletime(srsportID, rsID, scheduleID, workdayID){
if (confirm("Are you sure you want to remove this time block?")) {
	document.searchform.action.value = "removescheduletime";
	document.searchform.srsportID.value = srsportID;
	document.searchform.rsID.value = rsID;
	document.searchform.scheduleID.value = scheduleID;
	document.searchform.workdayID.value = workdayID;
	document.searchform.submit();
	}
}

function submit_addhours(sID, startID, endID){
	document.searchform.action.value = "addhours";
	document.searchform.sID.value = sID;
	document.searchform.startID.value = startID;
	document.searchform.endID.value = endID;
	document.searchform.submit();
}

function submit_removehours(scheduleID){
if (confirm("Are you sure you want to remove these hours?")) {
	document.searchform.action.value = "removehours";
	document.searchform.scheduleID.value = scheduleID;
	document.searchform.submit();
	}
}

function submit_addofficial(){
	document.searchform.action.value = "addofficial";
	document.searchform.submit();
}

function submit_addsupervisorstatus(){
if (confirm("Are you sure you want to ADD supervisor status?")) {
	document.searchform.action.value = "addsuperstatus";
	document.searchform.submit();
}
}

function submit_removesupervisorstatus(){
if (confirm("Are you sure you want to REMOVE supervisor status?")) {
	document.searchform.action.value = "removesuperstatus";
	document.searchform.submit();
}
}

function submit_addofficialrating(sID,rateID){
	document.searchform.action.value = "officialrating";
	document.searchform.sID.value = sID;
	document.searchform.shiftID.value = rateID;
	document.searchform.submit();
}

function submit_addofficialshift(sID,shiftID){
	//if (confirm("Are you sure you want to add this shift?")) {
		document.searchform.action.value = "addshift";
		document.searchform.sID.value = sID;
		document.searchform.shiftID.value = shiftID;
		document.searchform.submit();
	//}
}


function submit_removeofficialshift(sID,shiftID){
	if (confirm("Are you sure you want to remove this shift?")) {
		document.searchform.action.value = "removeshift";
		document.searchform.sID.value = sID;
		document.searchform.shiftID.value = shiftID;
		document.searchform.submit();
	}
}

function submit_removeofficial(sID){
if (confirm("Are you sure you want to remove this official from the official's database? Removing this official will also remove them from any schedule they are currently on!")) {
	document.searchform.action.value = "removeofficial";
	document.searchform.sID.value = sID;
	document.searchform.submit();
	}
}

function submit_acceptworkshift(workdateID, shiftID){
if (confirm("Are you sure you want to ACCEPT this shift? Once you ACCEPT a shift, it CANNOT be undone!")) {
	document.searchform.action.value = "acceptworkshift";
	document.searchform.workdateID.value = workdateID;
	document.searchform.shiftID.value = shiftID;
	document.searchform.submit();
	}
}

function submit_declineworkshift(workdateID, shiftID){
if (confirm("Are you sure you want to DECLINE this shift? Once you DECLINE a shift, it CANNOT be undone!")) {
	document.searchform.action.value = "declineworkshift";
	document.searchform.workdateID.value = workdateID;
	document.searchform.shiftID.value = shiftID;
	document.searchform.submit();
	}
}

function submit_requestoff(requestdateID){
if (confirm("Are you sure you want to REQUEST this day off?")) {
	document.searchform.action.value = "requestoff";
	document.searchform.requestdateID.value = requestdateID;
	document.searchform.submit();
	}
}

function submit_cancelrequestoff(requestdateID){
if (confirm("Are you sure you want to CANCEL this request?")) {
	document.searchform.action.value = "cancelrequestoff";
	document.searchform.requestdateID.value = requestdateID;
	document.searchform.submit();
	}
}

function submit_approverequestoff(requestID,requestdateID){
if (confirm("Are you sure you want to APPROVE this request?")) {
	document.searchform.action.value = "approverequestoff";
	document.searchform.requestID.value = requestID;
	document.searchform.requestdateID.value = requestdateID;
	document.searchform.submit();
	}
}

function submit_declinerequestoff(requestID,requestdateID){
if (confirm("Are you sure you want to DECLINE this request?")) {
	document.searchform.action.value = "declinerequestoff";
	document.searchform.requestID.value = requestID;
	document.searchform.requestdateID.value = requestdateID;
	document.searchform.submit();
	}
}

function submit_acceptworkshiftadd(workdateID, shiftID, oldagentID){
if (confirm("Are you sure you want to ACCEPT this EXTRA shift? Once you ACCEPT a shift, it CANNOT be undone!")) {
	document.searchform.action.value = "acceptworkshiftadd";
	document.searchform.workdateID.value = workdateID;
	document.searchform.shiftID.value = shiftID;
	document.searchform.oldagentID.value = oldagentID;
	document.searchform.submit();
	}
}

function submit_addofficialwork(sID,shiftID,locationID,dateID){
	if (confirm("Are you sure you want to add this shift?")) {
		document.searchform.action.value = "addworkshift";
		document.searchform.dateID.value = dateID;
		document.searchform.sID.value = sID;
		document.searchform.shiftID.value = shiftID;
		document.searchform.locationID.value = locationID;
		document.searchform.submit();
	}
}

function submit_removeofficialwork(sID,shiftID,locationID,dateID,periodid,editschedule){
	if (confirm("Are you sure you want to remove the official from this shift?")) {
		document.searchform.action.value = "removeworkshift";
		document.searchform.dateID.value = dateID;
		document.searchform.sID.value = sID;
		document.searchform.shiftID.value = shiftID;
		document.searchform.locationID.value = locationID;
		document.searchform.periodid.value = periodid;
		document.searchform.editschedule.value = editschedule;
		document.searchform.submit();
	}
}

function submit_modifyschedule(mdates,mlocation,mstart,mend){
document.searchform.action.value = "search";
document.searchform.mdates.value = mdates;
document.searchform.mlocation.value = mlocation;
document.searchform.mstart.value = mstart;
document.searchform.mend.value = mend;
document.searchform.submit();
}

function submit_modifyscheduledate(editschedule){
document.searchform.action.value = "search";
document.searchform.editschedule.value = editschedule;
document.searchform.submit();
}

//END SCHEDULING FUNCTIONS

function opp_stat(aID){
	document.searchform.action.value = "oppteam";
	document.searchform.aID.value = aID;
	document.searchform.submit();
}
function submit_draft(dID,tID,trmID,sID,lID){
	document.searchform.action.value = "draft";
	document.searchform.draftee.value = dID;
	document.searchform.tID.value = tID;
	document.searchform.trmID.value = trmID;
	document.searchform.sID.value = sID;
	document.searchform.lID.value = lID;
	document.searchform.submit();
}
function submit_undraft(dID,tID,trmID,sID,lID){
	if (confirm("Are you sure you want to undraft this player?")) {
		document.searchform.action.value = "undraft";
		document.searchform.draftee.value = dID;
		document.searchform.tID.value = tID;
		document.searchform.trmID.value = trmID;
		document.searchform.sID.value = sID;
		document.searchform.lID.value = lID;
		document.searchform.submit();
	}
}
function submit_accept(sID, trmID, lID, dID, tID, divID){
	if (confirm("Are you sure you want to ACCEPT this draft?")) {
		document.searchform.action.value = "accept";
		document.searchform.sID.value = sID;
		document.searchform.trmID.value = trmID;
		document.searchform.lID.value = lID;
		document.searchform.draftee.value = dID;
		document.searchform.tID.value = tID;
		document.searchform.divID.value = divID;
		document.searchform.submit();
	}
}
function submit_decline(sID, trmID, lID, dID, tID){
	if (confirm("Are you sure you want to DECLINE this draft?")) {
		document.searchform.action.value = "decline";
		document.searchform.sID.value = sID;
		document.searchform.trmID.value = trmID;
		document.searchform.lID.value = lID;
		document.searchform.draftee.value = dID;
		document.searchform.tID.value = tID;
		document.searchform.submit();
	}
}
function submit_registration(){
	if (validate_reg()) {
		document.searchform.action.value = "registerplayer";
		document.searchform.submit();
	}
}
function submit_enroll(term, leagueName, sportName){
	document.searchform.action.value = "enroll";
	document.searchform.tID.value = term;
	document.searchform.lID.value = leagueName;
	document.searchform.sID.value = sportName;
	document.searchform.submit();
}
function submit_teamenroll(termid, sportid, leagueid){
	if (confirm("Are you sure you want to CREATE this team?")) {
    document.searchform.action.value = "enroll";
	document.searchform.trmID.value = termid;
	document.searchform.sID.value = sportid;
	document.searchform.lID.value = leagueid;
	document.searchform.submit();
	}
}
function submit_searchtime(sportName, term, leagueName){
	document.searchform.action.value = "search";
	document.searchform.sID.value = sportName;
	document.searchform.trmID.value = term;
	document.searchform.lID.value = leagueName;
	document.searchform.submit();
}
function submit_disenroll(term,leagueName, sportName){
	document.searchform.action.value = "disenroll";
	document.searchform.tID.value = term;
	document.searchform.lID.value = leagueName;
	document.searchform.sID.value = sportName;
	document.searchform.submit();
}
function submit_admin_disenroll(leagueName, sportName, studentid){
	if (confirm("Are you sure you want to REMOVE this player from the draft?")) {
		document.searchform.action.value = "disenroll";
		document.searchform.lID.value = leagueName;
		document.searchform.sID.value = sportName;
		document.searchform.stuID.value = studentid;
		document.searchform.submit();
	}
}
function submit_addteam(vID){
	if (confirm("Are you sure you want to CREATE this team?")) {
    document.searchform.action.value = "addteam";
	document.searchform.varID.value = vID;
	document.searchform.submit();
	}
}
function submit_addplayer(sID, trmID, lID, tID, divID){
	if (confirm("Are you sure you want to ADD this player to your team?")) {
    document.searchform.action.value = "addplayer";
	document.searchform.sID.value = sID;
	document.searchform.trmID.value = trmID;
	document.searchform.lID.value = lID;
	document.searchform.tID.value = tID;
	document.searchform.divID.value = divID;
	document.searchform.submit();
	}
}
function submit_teamstat_search(sID, trmID, lID, tID, divID){
	document.searchform.action.value = "search";
	document.searchform.sID.value = sID;
	document.searchform.trmID.value = trmID;
	document.searchform.lID.value = lID;
	document.searchform.tID.value = tID;
	document.searchform.divID.value = divID;
	document.searchform.submit();
}
function submit_player(rID){
	document.searchform.action.value = "registerplayer";
	document.searchform.player.value = rID;
	document.searchform.submit();
}
function submit_captain(cID){
	document.searchform.action.value = "captain";
	document.searchform.captain.value = cID;
	document.searchform.submit();
}
function update_email(vID){
	if (confirm("Are you sure you want to UPDATE your email address?")) {
	document.searchform.action.value = "updateemail";
	document.searchform.updateemail.value = vID;
	document.searchform.submit();
	}
}
function update_sms(vID, smsID){
	if (confirm("Are you sure you want to UPDATE your SMS address?")) {
	document.searchform.action.value = "updatesms";
	document.searchform.updatesms.value = vID;
	document.searchform.smsID.value = smsID;
	document.searchform.submit();
	}
}
function test_sms(){
	if (confirm("This will send a test message to the SMS address you supplied. Continue?")) {
	document.searchform.action.value = "testsms";
	document.searchform.submit();
	}
}
function update_phone(vID){
	if (confirm("Are you sure you want to UPDATE your phone number?")) {
	document.searchform.action.value = "updatephone";
	document.searchform.updatephone.value = vID;
	document.searchform.submit();
	}
}
function update_password(vID){
	if (confirm("Are you sure you want to CHANGE your password?")) {
	document.searchform.action.value = "updatepassword";
	document.searchform.updatepassword.value = vID;
	document.searchform.submit();
	}
}
function update_teamname(){
	if (confirm("Are you sure you want to CHANGE this team name?")) {
	document.searchform.action.value = "updateteamname";
	document.searchform.submit();
	}
}
function add_player(vID){
	if (confirm("Are you sure you want to ADD this player to your team?")) {
	document.searchform.action.value = "addplayer";
	document.searchform.addplayer.value = vID;
	document.searchform.submit();
	}
}
function submit_playersearch(vID){
	document.searchform.action.value = "playersearch";
	document.searchform.submit();
}
function submit_addgreekroster(vID){
	if (confirm("Are you sure you want to add this player to your house roster?")) {
		document.searchform.action.value = "addgreekplayer";
		document.searchform.submit();
	}
}
function submit_addgreekpteam(){
	if (confirm("Are you sure you want to add this player to this team?")) {
		document.searchform.action.value = "addgreektoteam";
		document.searchform.submit();
	}
}
function submit_removegreekplayer(vID){
	if (confirm("Are you sure you want to remove this player from the roster?")) {
		document.searchform.action.value = "removegreekplayer";
		document.searchform.removeplayer.value = vID;
		document.searchform.submit();
	}
}
function teamname(vID){
	if (confirm("Are you sure you want to CHANGE this team name?")) {
	document.searchform.action.value = "updateteamname";
	document.searchform.updateteamname.value = vID;
	document.searchform.submit();
	}
}

//FORUM OPTIONS
function submit_searchforum(sportid){
	document.searchform.action.value = "search";
	document.searchform.sportid.value = sportid;
	document.searchform.submit();
}

function submit_addforumresponse(addresponseID,sportid,topicid){
	if (confirm("Are you sure you want to SUBMIT this response?")) {
		document.searchform.action.value = "addforumresponse";
		document.searchform.addresponseID.value = addresponseID;
		document.searchform.sportid.value = sportid;
		document.searchform.topicid.value = topicid;
		document.searchform.submit();
	}
}

function submit_addforumquestion(sportid,topicid){
	if (confirm("Are you sure you want to SUBMIT this question?")) {
		document.searchform.action.value = "addforumquestion";
		document.searchform.sportid.value = sportid;
		document.searchform.topicid.value = topicid;
		document.searchform.submit();
	}
}

function submit_editforumresponse(editresponseID,sportid,topicid){
	if (confirm("Are you sure you want to EDIT this response?")) {
		document.searchform.action.value = "editforumresponse";
		document.searchform.editresponseID.value = editresponseID;
		document.searchform.sportid.value = sportid;
		document.searchform.topicid.value = topicid;
		document.searchform.submit();
	}
}

function submit_removeforumquestion(removequestionID,sportid,topicid){
	if (confirm("Are you sure you want to DELETE this question?")) {
		document.searchform.action.value = "removeforumquestion";
		document.searchform.removequestionID.value = removequestionID;
		document.searchform.sportid.value = sportid;
		document.searchform.topicid.value = topicid;
		document.searchform.submit();
	}
}

//ONLINE TEAM VIEW OPTIONS
function submit_lookteam(term, leagueName, sportName, teamName){
	document.searchform.action.value = "look";
	document.searchform.tID.value = term;
	document.searchform.lID.value = leagueName;
	document.searchform.sID.value = sportName;
	document.searchform.teamID.value = teamName;
	document.searchform.submit();
}

function submit_lookteamcancel(vID){
	document.searchform.action.value = "lookcancel";
	document.searchform.submit();
}

function submit_lookteamremove(term, leagueName, sportName, teamName){
if (confirm("Are you sure you want to DELETE this team?")) {
	document.searchform.action.value = "removeteam";
	document.searchform.tID.value = term;
	document.searchform.lID.value = leagueName;
	document.searchform.sID.value = sportName;
	document.searchform.teamID.value = teamName;
	document.searchform.submit();
}
}

function submit_team_arch(tID, sID, trmID, lID){
	document.searchform.force_arch.value = "1";
	document.searchform.tID.value = tID;
	document.searchform.sID.value = sID;
	document.searchform.trmID.value = trmID;
	document.searchform.lID.value = lID;
	document.searchform.action = "./team_info.php";
	document.searchform.submit();
}
function submit_opp_search(trmID, lID, sID, tID){
	document.searchform.action.value = "oppinfo";
	document.searchform.trmID.value = trmID;
	document.searchform.lID.value = lID;
	document.searchform.sID.value = sID;
	document.searchform.tID.value = tID;
	document.searchform.action = "./view_opponent.php";
	document.searchform.submit();
}
function remove_blogemail(vID){
	document.searchform.action.value = "removeblogemail";
	document.searchform.submit();
}
function add_blogemail(vID){
	document.searchform.action.value = "addblogemail";
	document.searchform.submit();
}
function remove_blogsms(vID){
	document.searchform.action.value = "removeblogsms";
	document.searchform.submit();
}
function add_blogsms(vID){
	document.searchform.action.value = "addblogsms";
	document.searchform.submit();
}
function remove_globalblogemail(vID){
	document.searchform.action.value = "removeglobalblogemail";
	document.searchform.submit();
}
function add_globalblogemail(vID){
	document.searchform.action.value = "addglobalblogemail";
	document.searchform.submit();
}
function remove_globalblogsms(vID){
	document.searchform.action.value = "removeglobalblogsms";
	document.searchform.submit();
}
function add_globalblogsms(vID){
	document.searchform.action.value = "addglobalblogsms";
	document.searchform.submit();
}
function remove_draftedemail(vID){
	document.searchform.action.value = "removedraftedemail";
	document.searchform.submit();
}
function add_draftedemail(vID){
	document.searchform.action.value = "adddraftedemail";
	document.searchform.submit();
}
function remove_draftedsms(vID){
	document.searchform.action.value = "removedraftedsms";
	document.searchform.submit();
}
function add_draftedsms(vID){
	document.searchform.action.value = "adddraftedsms";
	document.searchform.submit();
}
function submit_greek_captain(studentid, teamid, termid, leagueid, sportid){
	if (confirm("Are you sure you want to make this player the team captain? Once you select this player, it CANNOT be changed. This player will be responsible for all fees associated with this team.")) {
		document.searchform.action.value = "addgreekcaptain";
		document.searchform.studentID.value = studentid;
		document.searchform.teamID.value = teamid;
		document.searchform.trmID.value = termid;
		document.searchform.lID.value = leagueid;
		document.searchform.sID.value = sportid;
		document.searchform.submit();
	}
}
function submit_greek_captaineligible(houseid){
	if (confirm("Are you sure you want to ACCEPT the team captain responsibilites? By clicking OK, I am agreeing to all responsibilites for any future team I may be captain of.")) {
		document.searchform.action.value = "greekcaptaineligible";
		document.searchform.houseID.value = houseid;
		document.searchform.submit();
	}
}
function submit_greek_captainnoteligible(houseid){
	if (confirm("Are you sure you want to REMOVE your team captain responsibilites? Any teams that you are/were captain of before you declined eligibility will still be your responsibility.")) {
		document.searchform.action.value = "greekcaptainnoteligible";
		document.searchform.houseID.value = houseid;
		document.searchform.submit();
	}
}
function verify(){
var checked=(document.searchform.captain.checked?true:false);
if(checked){
document.searchform.submit();
}else{alert("You msut agree to the terms and agreements.");
document.searchform.captain.style.backgroundColor="red";}
}

function validate_reg()
{
	var msgTXT = "";
	if (document.searchform.lastname.value == "") {
		msgTXT = "Please enter your last name.\n";
	}
	if (document.searchform.phonenumber.value.length != 10) {
		msgTXT = msgTXT + "Please enter your 10-digit phone number.\n";
	}
	if (document.searchform.emailaddress.value == "") {
		msgTXT = msgTXT + "Please enter your email address.\n";
	}
	if (document.searchform.studentid.value.length != 8) {
		msgTXT = msgTXT + "Please enter the last 8 digits of your OSU student ID.\n";
	}
	if (document.searchform.password.value == ""||document.searchform.password.value != document.searchform.password_confirm.value) {
		msgTXT = msgTXT + "Password / Confirm Password invalid.\n";
	}
	if (msgTXT != "") {
		alert(msgTXT);
		return 0;
	}
	else {
		return 1;
	}
}


//HIDE DIVISION FUNCTION FOUND ON PROFILE PAGE
/***********************************************
* Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/
* Modified by Dynamic Drive for minor changes
* Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com
* Please keep this notice intact
***********************************************/
function textCounter(field,counter,maxlimit,linecounter) {
	// text width//
	var fieldWidth =  parseInt(field.offsetWidth);
	var charcnt = field.value.length;        

	// trim the extra text
	if (charcnt > maxlimit) { 
		field.value = field.value.substring(0, maxlimit);
	}

	else { 
	// progress bar percentage
	var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
	document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
	document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
	// color correction on style from CCFFF -> CC0000
	setcolor(document.getElementById(counter),percentage,"backgroundColor");
	}
}

function setcolor(obj,percentage,prop){
	obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
function viewfieldemail(){
document.getElementById( "email" ).style.display = "block"; 
}
function viewfieldphone(){
document.getElementById( "phone" ).style.display = "block"; 
}
function viewfieldpassword(){
document.getElementById( "password" ).style.display = "block"; 
}
function viewfieldsms(){
document.getElementById( "sms" ).style.display = "block"; 
}
function viewfieldteamname(){
document.getElementById( "teamname" ).style.display = "block"; 
}

//HIDE DIVISION FUNCTION
function hideDiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideShow').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'hidden';
}
else { // IE 4
document.all.hideShow.style.visibility = 'hidden';
}
}
}

function showDiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideShow').style.visibility = 'visible';
}
else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'visible';
}
else { // IE 4
document.all.hideShow.style.visibility = 'visible';
}
}
} 

