// JavaScript Document

function resizeForScreenWidth()
{
if (document.body.offsetWidth<1280)
{
document.body.style.fontSize="100%";	
}

if (document.body.offsetWidth<1024 && document.body.offsetWidth>801)
{
document.body.style.fontSize="80%";	
}


if (document.body.offsetWidth<801)
{

document.body.style.fontSize="67%";
}
}
function refreshMenus()
{

top.SCPmenus.location.reload();

}
function centreTitle()
{
var pageWidth=document.body.clientWidth;

var slWidth=document.getElementById("subscribeLink").offsetWidth;
var showsWidth=document.getElementById("shows").offsetWidth;


var subscribeLinkML=((pageWidth-slWidth)/2)+"px";
var showsML=((pageWidth-showsWidth)/2)+"px";

document.getElementById("pageTitle").style.marginLeft=subscribeLinkML;
document.getElementById("shows").style.marginLeft=showsML;

var ptWidth=document.body.clientWidth;
var blurbWidth=document.getElementById("showFourBlurb").offsetWidth;
var blurbML=((ptWidth-blurbWidth)/2);
document.getElementById("showFourBlurb").style.left=blurbML;

}
function centreTitle33()
{
var pageWidth=document.body.clientWidth;

var slWidth=document.getElementById("subscribeLink").offsetWidth;
var showsWidth=document.getElementById("shows").offsetWidth;


var subscribeLinkML=((pageWidth-slWidth)/2)+"px";
var showsML=((pageWidth-showsWidth)/2)+"px";

document.getElementById("pageTitle").style.marginLeft=subscribeLinkML;
document.getElementById("shows").style.marginLeft=showsML;

var ptWidth=document.body.clientWidth;
var blurbWidth=document.getElementById("showOne33Blurb").offsetWidth;
var blurbML=((ptWidth-blurbWidth)/2);
document.getElementById("showOne33Blurb").style.left=blurbML;

}
function centreActorBio()
{
//get browser (client) width
var cW=document.body.clientWidth;
//get width of content box
var divWidth=document.getElementById("outerWrap").offsetWidth;
// calculate the div's left margin position
var mL=(cW-divWidth)/2;

//assign this left margin value to the div
document.getElementById("outerWrap").style.marginLeft=mL+"px";

//get the width of the actor name div
var actorNameWidth=document.getElementById("nameFG").offsetWidth;

//calculate the left margin for the actor name div
var actorML=(divWidth-actorNameWidth)/2;

//assign this left margin value to the actor name div
document.getElementById("nameFG").style.marginLeft=actorML+"px";
document.getElementById("nameBG").style.marginLeft=actorML+"px";


document.getElementById("captionWrapper").style.width=document.getElementById("imageBig").offsetWidth;


//adjust the width of the image container for FF
if (navigator.appName.indexOf('Netscape')!=-1)
{
document.getElementById("pictureWrapper").style.width="25%";
document.getElementById("imageBig").style.width="90%";
document.getElementById("captionWrapper").style.width="90%";
}
}
function showImage(e)
{
var ptWidth=document.body.clientWidth;
var imgName=e.getAttribute("title");

document.getElementById(imgName).offetTop=e.offsetTop;
document.getElementById(imgName).style.visibility="visible";

document.getElementById(imgName).style.right="5%"
}
function hideImage(e)
{
var imgName=e.getAttribute("title");
document.getElementById(imgName).style.visibility="hidden";
}
function calculateOrderFull(selector)
{
var selName=selector.name;

var subTotFullBox=document.subscriberForm.SubtotalFull;

var adultFullBox=document.subscriberForm.TotAdultFull;
var seniorFullBox=document.subscriberForm.TotSeniorFull;
var studentFullBox=document.subscriberForm.TotStudentFull;

switch(selName)
{
case "AdultFull":

var adultFullAmt=selector.value*100;
var seniorFullAmt=seniorFullBox.value;
var studentFullAmt=studentFullBox.value;
break;

case "SeniorFull":

adultFullAmt=adultFullBox.value;
seniorFullAmt=selector.value*80;
studentFullAmt=studentFullBox.value;
break;

case "StudentFull":

studentFullAmt=selector.value*60;
adultFullAmt=adultFullBox.value;
seniorFullAmt=seniorFullBox.value;
}

adultFullBox.value=adultFullAmt;
seniorFullBox.value=seniorFullAmt;
studentFullBox.value=studentFullAmt;

subTotFullBox.value=parseInt(adultFullBox.value)+parseInt(seniorFullBox.value)+parseInt(studentFullBox.value);
}
function calculatePick3Order(selector)
{

var selName=selector.name;

var subTotPick3Box=document.subscriberForm.SubtotalPick3;

var adultPick3Box=document.subscriberForm.TotAdultPick3;
var seniorPick3Box=document.subscriberForm.TotSeniorPick3;
var studentPick3Box=document.subscriberForm.TotStudentPick3;

switch(selName)
{
case "AdultPick3":

var adultPick3Amt=selector.value*67;
var seniorPick3Amt=seniorPick3Box.value;
var studentPick3Amt=studentPick3Box.value;
break;

case "SeniorPick3":

adultPick3Amt=adultPick3Box.value;
seniorPick3Amt=selector.value*54;
studentPick3Amt=studentPick3Box.value;
break;

case "StudentPick3":

studentPick3Amt=selector.value*40;
adultPick3Amt=adultPick3Box.value;
seniorPick3Amt=seniorPick3Box.value;
}

adultPick3Box.value=adultPick3Amt;
seniorPick3Box.value=seniorPick3Amt;
studentPick3Box.value=studentPick3Amt;

subTotPick3Box.value=parseInt(adultPick3Box.value)+parseInt(seniorPick3Box.value)+parseInt(studentPick3Box.value);
}
function calculateGrandTotal()
{

//references the grand total text box
var grandTotalBox=document.subscriberForm.SubscriptionTotal;
//references the subtotal box for full subscriptions
var subTotFullBox=document.subscriberForm.SubtotalFull;
//references the subtotal box for Pick3 subscriptions
var subTotPick3Box=document.subscriberForm.SubtotalPick3;
//references the donations box
var donationsBox=document.subscriberForm.Donation;


grandTotalBox.value=parseInt(subTotFullBox.value)+parseInt(subTotPick3Box.value)+parseInt(donationsBox.value);
}
function resetFullValues()
{
var subTotFullBox=document.subscriberForm.SubtotalFull;

var adultFullBox=document.subscriberForm.TotAdultFull;
var seniorFullBox=document.subscriberForm.TotSeniorFull;
var studentFullBox=document.subscriberForm.TotStudentFull;

document.subscriberForm.AdultFull.options[0].selected=true;
document.subscriberForm.SeniorFull.options[0].selected=true;
document.subscriberForm.StudentFull.options[0].selected=true;
subTotFullBox.value=0;
adultFullBox.value=0;
seniorFullBox.value=0;
studentFullBox.value=0;
}
function resetUpickValues()
{
var subTotPick3Box=document.subscriberForm.SubtotalPick3;

var adultPick3Box=document.subscriberForm.TotAdultPick3;
var seniorPick3Box=document.subscriberForm.TotSeniorPick3;
var studentPick3Box=document.subscriberForm.TotStudentPick3;

document.subscriberForm.AdultPick3.options[0].selected=true;
document.subscriberForm.SeniorPick3.options[0].selected=true;
document.subscriberForm.StudentPick3.options[0].selected=true;
subTotPick3Box.value=0;
adultPick3Box.value=0;
seniorPick3Box.value=0;
studentPick3Box.value=0;
}

function calculateSingleTicketOrder(selector)
{
var selName=selector.name;


switch(selName)
{
case "singleAdult":
var adultSingleAmt=selector.value*25;
var seniorSingleAmt=document.singleticketForm.seniorSingleBox.value;
var studentSingleAmt=document.singleticketForm.studentSingleBox.value;
break;

case "singleSenior":
adultSingleAmt=document.singleticketForm.adultSingleBox.value;
seniorSingleAmt=selector.value*20;
studentSingleAmt=document.singleticketForm.studentSingleBox.value;
break;

case "singleStudent":
adultSingleAmt=document.singleticketForm.adultSingleBox.value;
seniorSingleAmt=document.singleticketForm.seniorSingleBox.value;
studentSingleAmt=selector.value*15;
}
document.singleticketForm.adultSingleBox.value=adultSingleAmt;
document.singleticketForm.seniorSingleBox.value=seniorSingleAmt;
document.singleticketForm.studentSingleBox.value=studentSingleAmt;

document.singleticketForm.subTotalSingleTicket.value=parseInt(document.singleticketForm.adultSingleBox.value)+parseInt(document.singleticketForm.seniorSingleBox.value)+parseInt(document.singleticketForm.studentSingleBox.value);
}

function calculateSingleTicketTotal()
{
document.singleticketForm.singleTicketTotal.value=parseInt(document.singleticketForm.subTotalSingleTicket.value)+parseInt(document.singleticketForm.singleDonations.value);
	
}
function resetSingleValues()
{

document.singleticketForm.singleAdult.options[0].selected=true;
document.singleticketForm.singleSenior.options[0].selected=true;
document.singleticketForm.singleStudent.options[0].selected=true;


document.singleticketForm.adultSingleBox.value=0;
document.singleticketForm.seniorSingleBox.value=0;
document.singleticketForm.studentSingleBox.value=0;

document.singleticketForm.subTotalSingleTicket.value=0;
}