var daFrm = document.Form1;

function getQryItm(itmName)
{
         var theItmToRtn = "";
         var theSrchStrg = location.search;
             theSrchStrg = theSrchStrg.replace("?","&")
             theSrchStrg = theSrchStrg + "&";
        var theSrchToken = "&" + itmName + "=";
if (theSrchStrg.indexOf(theSrchToken) != -1) {
     var theSrchTokenLth = theSrchToken.length;
var theSrchTokenLocStart = theSrchStrg.indexOf(theSrchToken) + theSrchTokenLth;
 var theLocOfNextAndSign = theSrchStrg.indexOf("&",theSrchTokenLocStart);
             theItmToRtn = unescape(theSrchStrg.substring(theSrchTokenLocStart, theLocOfNextAndSign));
}
return unescape(theItmToRtn);
}
 
    
    



//----------------------------------------------------------------------------
// Code to determine the browser and version.
//----------------------------------------------------------------------------
function Browser() {

  var ua, s, s2, i;

  this.isIE    = false;  // Internet Explorer
  this.isNS    = false;  // Netscape
  this.isOldNS = false;   // Old Netscape
  this.isFireFox = false;   // Fire Fox

  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
  
  // Treat all older versions of NS the same 
  s = "Netscape";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isOldNS = true;
    this.version = 4.7;
    return;
  }
  
  // Treat all older versions of NS the same 
  s = "fox";
 s2 = "fire";
  if ((ua.toUpperCase().indexOf(s.toUpperCase())) >= 0 && (ua.toUpperCase().indexOf(s2.toUpperCase())) >= 0) {
    this.isFireFox = true;
    this.version = 4.7;
    return;
  }
  
  
}

var browser = new Browser();


    
    

 
///////////////////////////////////////////////////////
//This is cookie Stuff//[START]////////////////////////
/////////////////////////////////////////////////////// 
 
function setTheCrum(name,daVal,expires,path,domain,secure)
{
var theValu = daVal; 
var exp = new Date();
var oneYearFromNow = exp.getTime() + (365 * 24 * 60 * 60 * 1000);
exp.setTime(oneYearFromNow);
exp = exp.toGMTString();
 
 if(expires == "NOW") { 
 
document.cookie = name + "=" + escape(theValu) +
	//((expires) ? "; expires=" + exp : "") +
	((path) ? "; path=" + path : "") + 
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
	
	} else {
	
document.cookie = name + "=" + escape(theValu) +
	 ((expires) ? "; expires=" + exp : "") +
	 ((path) ? "; path=" + path : "") + 
	 ((domain) ? "; domain=" + domain : "") +
	 ((secure) ? "; secure" : "");
	
	}			 	 
				 	 
				 	 
}
 
function getCookieData(label) {
var labelLen = label.length
var cLen = document.cookie.length
var i = 0
var cEnd
while (i < cLen) {
var j = i + labelLen
if (document.cookie.substring(i,j) == label) {
cEnd = document.cookie.indexOf(";",j)
if (cEnd == -1) {
cEnd = document.cookie.length
}
var thend = unescape(document.cookie.substring(j,cEnd))
 thend = thend.replace("=","")
return thend
}
i++
}
return ""
}
 
//This function only works in IE
function passTheCrum(da_elmt)
{
if(document.cookie != '') { 


var the_form_fld = eval("document.Form1." + da_elmt)

if(document.cookie != "")
{
the_form_fld.value = getCookieData(da_elmt)
} else {
the_form_fld.value = ""
}


}
}
///////////////////////////////////////////////////////
//This is cookie Stuff////[END]////////////////////////
///////////////////////////////////////////////////////

function StripChars(theFilter,theString)
{
	var strOut,i,curChar

	strOut = ""
	for (i=0;i < theString.length; i++)
	{		
		curChar = theString.charAt(i)
		if (theFilter.indexOf(curChar) < 0)	// if it's not in the filter, send it thru
			strOut += curChar		
	}	
	return strOut
}
 
function AllInRange(x,y,theString)
{
	var i, curChar
	
	for (i=0; i < theString.length; i++)
	{
		curChar = theString.charAt(i)
		if (curChar < x || curChar > y) //the char is not in range
			return false
	}
	return true
}
 
function reformat (s)
{
    var arg;
    var sPos = 0;
    var resultString = "";

    for (var i = 1; i < reformat.arguments.length; i++) {
       arg = reformat.arguments[i];
       if (i % 2 == 1) 
           resultString += arg;
       else 
       {
           resultString += s.substring(sPos, sPos + arg);
           sPos += arg;
       }
    }
    return resultString;
}
 
function Trim(theString)
{
 var i,firstNonWhite

 if (StripChars(" \n\r\t",theString).length == 0 ) return ""

	i = -1
	while (1)
	{
		i++
		if (theString.charAt(i) != " ")
			break	
	}
	firstNonWhite = i
	//Count the spaces at the end
	i = theString.length
	while (1)
	{
		i--
		if (theString.charAt(i) != " ")
			break	
	}	

	return theString.substring(firstNonWhite,i + 1)

}

/* Declare character expression variables
** These are the various formats allowed for the form fields
** charexp = any character
** blankexp = any number of blank characters
** letterexp = any alpha character (case-insensitive)
** numexp = any number of numeric digits
** zipexp = 5 or 9 digit zip code with - or " " seperator (Ex. 55555 or 55555-5555)
** phonexp = 10 digit phone number with - or " " seperator (Ex. 555-555-5555)
** datexp = 7 digit date with -, / or " " seperator (Ex. mm-dd-yyyy)
** ssnexp = 9 digit SSN with - or " " seperator (Ex. 555-55-5555)
** taxidexp = 9 digit Tax ID Number with - or " " seperator (Ex. 55-5555555)
** dolexp = any valid dollar amount (Ex. 1000.00)
** specexp = any 9 digit number
*/

var charexp = /./
var blankexp = /^\s*$/
var letterexp = /^[A-Za-z]+(\-|\s)?([A-Za-z]+(\s|\-)?)*$/
var numexp = /^\d+$/
var zipexp = /^\d{5}$|^\d{5}[\-\s]?\d{4}$/
var phonexp =  /^\d{3}[\-\s]?\d{3}[\-\s]?\d{4}$/
var datexp = /^\d{2}[\-\s\/]?\d{2}[\-\s\/]?\d{4}$/
var ssnexp = /^\d{3}[\-\s]?\d{2}[\-\s]?\d{4}$/
var taxidexp = /^\d{2}[\-\s]?\d{7}$/
var dolexp = /^\d*\.{1}\d{2}$|^\d*$/
var specexp = /^\d{9}$/
var emailexp = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/
var accountexp = /^\d{9}$/

function isValid(pattern,str){
	return pattern.test(str)
}
 
function stripNonDigits(str){
	var i;
	var newstring = "";
	for (i = 0;  i < str.length; i++) {
		mychar = str.charAt(i);
		if (isDigits(mychar)) { 
			newstring += mychar;
		}
	}
	return newstring;
}

function val_radio(theFld,fldTitle,errMsg){
    var msg="";
    if(theFld){
        for(var i=0; i<theFld.length; i++){
            if(theFld[i].checked){
                return msg;
            }
        }
        msg="  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
        return msg;
    }
    return msg;
}

function val_date(theFld,fldTitle,errMsg){
    var msg="";
    if(theFld){
        var theDate=theFld.value;
        if(theDate.indexOf("-")>-1){ theDate=theDate.split(/-/g); }
        else if(theDate.indexOf("/")>-1){ theDate=theDate.split(/\//g); }
        else if(theDate.indexOf("\\")>-1){ theDate=theDate.split(/\\/g); }
        else if(theDate.indexOf(".")>-1){ theDate=theDate.split(/\./g); }
        else{
            msg="  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
            return msg;
        }
        if(theDate.length!=3){
            msg="  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
            return msg;
        }
        if(theDate[0]*1==1 || theDate[0]*1==3 || theDate[0]*1==5 || theDate[0]*1==7 || theDate[0]*1==8 || theDate[0]*1==10 || theDate[0]*1==12){
            if(!(theDate[1]*1>0&&theDate[1]*1)){
                msg="  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
            }
        }
        else if(theDate[0]*1==4 || theDate[0]*1==6 || theDate[0]*1==9 || theDate[0]*1==11){
            if(!(theDate[1]*1>0&&theDate[1]*1<31)){
                msg="  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
            }
        }
        else if(theDate[0]*1==2){
            if(!(theDate[1]*1>0&&theDate[1]*1<29)||((theDate[2]*1)%4==0&&theDate[1]*1==29)){
                msg="  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
            }
        }
        else{ msg="  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n"; }
        if(theDate[2].length!=4){
            msg="  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
        }
    }
    return msg;
}

function val_phoneNum(daFld,fldTitle,errMsg){
    var daPhoneNum = eval("document.Form1."+daFld+"_1").value;
    daPhoneNum += eval("document.Form1."+daFld+"_2").value;
    daPhoneNum += eval("document.Form1."+daFld+"_3").value;
    var msg = "";
    if(!isValid(phonexp,daPhoneNum)){
        msg = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
    }
    return msg;
}

/*
function val_phoneNum(daFld,fldTitle,errMsg){
    var msg = "";

    if(daFld){
        var daPhoneNum = daFld.value;
        daPhoneNum = daPhoneNum.replace("(","");
        daPhoneNum = daPhoneNum.replace(")","");
        daPhoneNum = daPhoneNum.replace("-","");
        daPhoneNum = TrimDaStrg(daPhoneNum);
        if(!isValid(phonexp,daPhoneNum)){
            msg = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
        }
    }
	return msg;
}
*/
 
 
 function val_phoneNumNOT_rqrd(daFld,fldTitle,errMsg) {
var msg = "";
var daPhoneNum = daFld.value;
    daPhoneNum = daPhoneNum.replace("(","");
    daPhoneNum = daPhoneNum.replace(")","");
    daPhoneNum = daPhoneNum.replace("-","");
    daPhoneNum = TrimDaStrg(daPhoneNum);

if (daFld) {
   if (daPhoneNum != "") {
	if (!isValid(phonexp,daPhoneNum)) {
		msg = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
	}
   }	
}

	return msg;
}
 
 
 
 
function val_ZipCode(required,daFld,fldTitle,errMsg)
{
	var msg = ""
if (daFld) {
	var theString = daFld.value;
 var msgInvalid = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";

	var theLen = StripChars(" \n\t\r",theString).length
	if (theLen == 0)	
		if (required == "") 
		{
		return ""
		}		
		else 
		{
		return msgInvalid
		}

	theString = StripChars("- \n\r",theString)		

	if (!AllInRange("0","9",theString))
	{
		msg = msgInvalid
	}
	else if (theString.length != 5 && theString.length != 9)
	{
		msg = msgInvalid
	}

	if (msg == "")
	{
		if (theString.length == 9)		
			daFld.value = reformat(theString,"",5,"-",4)
		else
   daFld.value = theString;
   
}
}


	return msg	
}

function val_email(daFld,fldTitle,errMsg){
    var msg = "";
    if(daFld&&Trim(daFld.value) != ""){
        if(!isValid(emailexp,daFld.value)){
            msg = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
        }
    }
    return msg;
}

function val_confirm_email(daFld,theEmail,fldTitle,errMsg){
    var msg = "";
    if(theEmail&&Trim(theEmail.value) != ""){
        if(Trim(daFld.value)!=Trim(theEmail.value)){
            msg = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
        }
    }
    return msg;
}
 
/*
function val_date(when,Required,daFld,fldTitle,errMsg)
{
	var msg = "";
if (daFld) {
	var theString = daFld.value;
	var dateVar = new Date(theString);
	var peavd = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";

	var theLen = StripChars(" ",theString).length
	if (theLen == 0)
	{
		if (Required != "") 
		{
		msg = "";
		} else {
		msg = peavd;
		}
	}

	if (isNaN(dateVar.valueOf()) || (dateVar.valueOf() == 0))
	{
	msg = peavd;
	}

	// Check for correct range.
	if (when == "Past")
	{
		var Today = new Date();
		if (dateVar >= Today)
		msg = peavd;
	}
	if (when == "Future")
	{
		var Today = new Date();
		if (dateVar <= Today)
		msg = peavd;
	}

	// We have a valid date. Reformat it and write it back to the control
	if (theLen != 0)
	{
	var d = dateVar;
	fullYear = d.getYear();
	if (fullYear < 100) {
		if (fullYear > 50) {
		fullYear += 1900;
		} else {
		fullYear += 2000;
		}
		}
        var date_string = (d.getMonth()+1) + "/" + d.getDate() + "/" + fullYear;
        if (Trim(msg) == "") {
	daFld.value = date_string;
	}
	}
	}
	return msg;
}
*/
 
function val_MsgBox(required,mxlngth,daFld,fldTitle,errMsg)
{
var msg = ""
if (daFld) {
if (daFld.value.length > mxlngth) { 
msg = "  - " + fldTitle.toUpperCase() + " : This text box allows a maximum of " + mxlngth.toString() + " characters entered. You entered " + daFld.value + " characters. Please shorten you message.\n\n";
}

if (required && Trim(daFld.value).length == 0) {
msg = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
}
}
return msg;
}

 


function val_RegFlds(daFld,fldTitle,errMsg)
{
var msg = "";
if (daFld) {
if (Trim(daFld.value) == "")
{
msg = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
}
}
return msg;
}
 
function val_DrpDwnMns(daFld,fldTitle,errMsg){
    var msg = "";
    if(daFld){
        if(daFld.options[daFld.selectedIndex].value == ""){
            msg = "  - " + fldTitle.toUpperCase() + " : " + errMsg + "\n\n";
        }
    }
    return msg
}

function goPhone(e,theField,maxLength,nextField){
    var k=(navigator.userAgent.toLowerCase().indexOf("gecko")>-1)?e.which:e.keyCode;
    if(theField.value.length==maxLength&&((k>47&&k<58)||(k>95&&k<106))){
        nextField.focus();
    }
}

function valItAll(CurrPageNum,daButton,valdt){
    var btnMsg = "please wait...";
    var daFrm = document.Form1;
    var errMsg = "";

    if(daButton.value!=btnMsg){
        if(valdt){  //if validate [start]
            if(CurrPageNum==2){  //fields on first form page
                errMsg += val_DrpDwnMns(daFrm.frmPage1_howDidYouFindUs,"How Did You Find Us","Please tell us how you found us.");
                errMsg += val_DrpDwnMns(daFrm.frmPage1_OccasionType,"Occasion Type","Please tell us what type of event you are planning.");
                errMsg += val_DrpDwnMns(daFrm.frmPage1_NumberOfGuests,"How Many Guests","Please tell us approximately how many guests will be attending.");
                errMsg += val_DrpDwnMns(daFrm.frmPage1_AgeRangeOfGuests,"Age Range of Guests","Please tell us the age range of guests that will be attending.");
                errMsg += val_RegFlds(daFrm.frmPage1_ClientNameFirst,"Your Billing Contact Name","Please provide your billing contact name.");
                errMsg += val_RegFlds(daFrm.frmPage1_ClientAdd,"Your Billing Address","Please enter your billing address.");
                errMsg += val_RegFlds(daFrm.frmPage1_ClientAddCity,"Your Billing City","Please enter your billing city.");
                errMsg += val_DrpDwnMns(daFrm.frmPage1_ClientAddState,"Your Billing State","Please choose your billing state.");
                errMsg += val_ZipCode("yes",daFrm.frmPage1_ClientAddZip,"Your Billing Zip Code","Please enter your billing zip code.");
                errMsg += val_phoneNum("frmPage1_ClientPhoneNumPrim","Your Primary Phone Number","Please provide a valid primary phone number.");
                errMsg += val_DrpDwnMns(daFrm.frmPage1_ClientPhoneTypePrim,"Your Primary Phone Type","Please provide your primary phone type.");
                if(daFrm.frmPage1_ClientPhoneNumSec_1.value!=""||daFrm.frmPage1_ClientPhoneNumSec_2.value!=""||daFrm.frmPage1_ClientPhoneNumSec_3.value!=""){
                    errMsg += val_phoneNum("frmPage1_ClientPhoneNumSec","Your Secondary Phone Number","Your secondary phone number is not valid. Please try again.");
                    errMsg += val_DrpDwnMns(daFrm.frmPage1_ClientPhoneTypeSec,"Your Secondary Phone Type","Please provide your secondary phone type.");
                }
                errMsg += val_email(daFrm.frmPage1_ClientEmailAdd,"your e\-mail address","If you would like to provide us with your e-mail address, please make sure it is valid. If not leave it blank.");
                errMsg += val_confirm_email(daFrm.frmPage1_ClientEmailAddConfirm,daFrm.frmPage1_ClientEmailAdd,"confirm e\-mail address","Your retyped e-mail address does not match your original address.");
                if(daFrm.frmPage1_ftrs_MAddIsDiff.checked){
                    errMsg += val_RegFlds(daFrm.frmPage1_MailingAddNameFirst,"Your Mailing Contact First Name","Please provide your mailing contact first name.");
                    errMsg += val_RegFlds(daFrm.frmPage1_MailingAddNameLast,"Your Mailing Contact Last Name","Please provide your mailing contact last name.");
                    errMsg += val_RegFlds(daFrm.frmPage1_MailingAddAdd,"Your Mailing Address","Please enter your mailing address.");
                    errMsg += val_RegFlds(daFrm.frmPage1_MailingAddAddCity,"Your Mailing City","Please enter your mailing city.");
                    errMsg += val_DrpDwnMns(daFrm.frmPage1_MailingAddAddState,"Your Mailing State","Please choose your mailing state.");
                    errMsg += val_ZipCode("yes",daFrm.frmPage1_MailingAddAddZip,"Your Mailing Zip Code","Please enter your mailing zip code.");
                }
            }
            else if(CurrPageNum==3){
                if(isWedding){
                    errMsg += val_RegFlds(daFrm.frmPage2_NameBrideFirst,"Bride\'s First Name","Please enter the bride\'s first name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameBrideLast,"Bride\'s Last Name","Please enter the bride\'s last name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameGroomFirst,"Groom\'s First Name","Please enter the groom\'s first name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameGroomLast,"Groom\'s Last Name","Please enter the groom\'s last name.");
                }
                else if(isAnniversary){
                    errMsg += val_RegFlds(daFrm.frmPage2_NameWifeFirst,"Wife\'s First Name","Please enter the wife\'s first name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameWifeLast,"Wife\'s Last Name","Please enter the wife\'s last name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameHusbandFirst,"Husband\'s First Name","Please enter the husband\'s first name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameHusbandLast,"Husband\'s Last Name","Please enter the husband\'s last name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_AnniversaryYear,"Anniversary Year","Please enter the anniversary year.");
                }
                else if(isSchoolDance){
                    errMsg += val_RegFlds(daFrm.frmPage2_SchoolGrade,"School Dance Grade(s)","Please enter the school grade(s) attending the dance.");
                }
                else if(isClassReunion){
                    errMsg += val_RegFlds(daFrm.frmPage2_ReunionYear,"Class Reunion Year(s)","Please enter the class year(s) attending the reunion.");
                }
                else if(isMitzvah){
                    errMsg += val_RegFlds(daFrm.frmPage2_NameMitzvahFirst,"Star\'s First Name","Please enter the star\'s first name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameMitzvahLast,"Star\'s Last Name","Please enter the star\'s last name.");
                }
                else if(isGraduation){
                    errMsg += val_RegFlds(daFrm.frmPage2_NameGraduationFirst,"Star\'s First Name","Please enter the star\'s first name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameGraduationLast,"Star\'s Last Name","Please enter the star\'s last name.");
                }
                else if(isBirthday){
                    errMsg += val_RegFlds(daFrm.frmPage2_NameBirthdayFirst,"Star\'s First Name","Please enter the star\'s first name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_NameBirthdayLast,"Star\'s Last Name","Please enter the star\'s last name.");
                    errMsg += val_RegFlds(daFrm.frmPage2_BirthdayAge,"Star\'s Age","Please enter the star\'s age.");
                }
                else if(isPrivateParty){
                    errMsg += val_RegFlds(daFrm.frmPage2_PrivatePartyInfo,"Private Party Information","Please describe the private party.");
                    errMsg += val_MsgBox(false,500,daFrm.frmPage2_PrivatePartyInfo,"Private Party Information","This text box allows a maximum 500 characters.");
                }
                else if(isPublicEvent){
                    errMsg += val_RegFlds(daFrm.frmPage2_PublicEventInfo,"Public Event Information","Please describe the public event.");
                    errMsg += val_MsgBox(false,500,daFrm.frmPage2_PublicEventInfo,"Public Event Information","This text box allows a maximum 500 characters.");
                }
                else if(isFundraiser){
                    errMsg += val_RegFlds(daFrm.frmPage2_FundraiserInfo,"Fundraiser Information","Please describe the fundraiser.");
                    errMsg += val_MsgBox(false,500,daFrm.frmPage2_FundraiserInfo,"Fundraiser Information","This text box allows a maximum 500 characters.");
                }
                else if(isOtherEvent){
                    errMsg += val_RegFlds(daFrm.frmPage2_OtherEventInfo,"\"Other\" Occasion Information","Please describe the \"other\" occasion.");
                    errMsg += val_MsgBox(false,500,daFrm.frmPage2_OtherEventInfo,"\"Other\" Occasion Information","This text box allows a maximum 500 characters.");
                }
                //errMsg += val_date("Future","yes",daFrm.frmPage2_Event1Date,"Date\(s\) and Time\(s\)","Please enter valid date information. \(future\)");
                //errMsg += val_DrpDwnMns(daFrm.frmPage2_Event1TimeStartForMusic,"Music Start Time","Please provide the approximate Music start time.");
                //errMsg += val_DrpDwnMns(daFrm.frmPage2_Event1TimeEndForMusic,"Music End Time","Please provide the approximate Music end time.");
                /* if(daFrm.frmPage2_Event1Date){
					if(!daFrm.frmPage2_ftrs_Event1DT.checked){
						errMsg += val_date(daFrm.frmPage2_Event1Date,"event date","Please enter valid date information.");
						errMsg += val_DrpDwnMns(daFrm.frmPage2_Event1TimeStartForMusic,"dj music start time","Please provide the approximate DJ music start time.");
						errMsg += val_DrpDwnMns(daFrm.frmPage2_Event1TimeEndForMusic,"dj music end time","Please provide the approximate DJ music end time.");
					}
					if(!daFrm.frmPage2_ftrs_Event1Loc.checked){
						errMsg += val_RegFlds(daFrm.frmPage2_Event1LocName,"event location name","Please provide the name of the event location(s).");
						errMsg += val_RegFlds(daFrm.frmPage2_Event1LocContactName,"event location contact name","Please provide the contact name of the event location(s).");
						errMsg += val_phoneNum("frmPage2_Event1LocContactPhone","event location phone number","Please provide the phone number of the event location(s).");
						errMsg += val_RegFlds(daFrm.frmPage2_Event1LocAdd,"event location address","Please enter the address of the event\'s location.");
						errMsg += val_RegFlds(daFrm.frmPage2_Event1LocAddCity,"event location city","Please enter the city of the event\'s location.");
						errMsg += val_DrpDwnMns(daFrm.frmPage2_Event1LocAddState,"event location state","Please make a selection.");
						errMsg += val_ZipCode("yes",daFrm.frmPage2_Event1LocAddZip,"event location zip code","Please enter a valid zip code for the event\'s location.");
					}
				}
                else{ //if not doing Reception validate ceremony
                    //errMsg += val_date("Future","yes",daFrm.frmPage2_Event2Date,"Date\(s\) and Time\(s\)","Please enter valid date information. \(future\)");
                    //errMsg += val_DrpDwnMns(daFrm.frmPage2_Event2TimeStartForMusic,"Music Start Time","Please provide the approximate Music start time.");
                    //errMsg += val_DrpDwnMns(daFrm.frmPage2_Event2TimeEndForMusic,"Music End Time","Please provide the approximate Music end time.");
                    if(!daFrm.frmPage2_ftrs_Event2DT.checked){
                        errMsg += val_date(daFrm.frmPage2_Event2Date,"event date","Please enter valid date information.");
                        errMsg += val_DrpDwnMns(daFrm.frmPage2_Event2TimeStartForMusic,"dj music start time","Please provide the approximate DJ music start time.");
                        errMsg += val_DrpDwnMns(daFrm.frmPage2_Event2TimeEndForMusic,"dj music end time","Please provide the approximate DJ music end time.");
                    }
                    if(!daFrm.frmPage2_ftrs_Event2Loc.checked){
                        errMsg += val_RegFlds(daFrm.frmPage2_Event2LocName,"event location name","Please provide the name of the event location(s).");
                        errMsg += val_RegFlds(daFrm.frmPage2_Event2LocContactName,"event location contact name","Please provide the contact name of the event location(s).");
                        errMsg += val_phoneNum("frmPage2_Event2LocContactPhone","event location phone number","Please provide the phone number of the event location(s).");
                        errMsg += val_RegFlds(daFrm.frmPage2_Event2LocAdd,"event location address","Please enter the address of the event\'s location.");
                        errMsg += val_RegFlds(daFrm.frmPage2_Event2LocAddCity,"event location city","Please enter the city of the event\'s location.");
                        errMsg += val_DrpDwnMns(daFrm.frmPage2_Event2LocAddState,"event location state","Please make a selection.");
                        errMsg += val_ZipCode("yes",daFrm.frmPage2_Event2LocAddZip,"event location zip code","Please enter a valid zip code for the event\'s location.");
                    }
                } */
                if(isCeremony){
                    errMsg += val_DrpDwnMns(daFrm.frmPage2_haveCoordinator,"coordinator","Please tell us if you have a coordinator for your event.");
                    errMsg += val_DrpDwnMns(daFrm.frmPage2_extraEquipmentNeeded,"needing extra microphones or equipment","Please tell us if you\'ll be needing extra equipment.");
                }
            }
            else if(CurrPageNum==4){
                errMsg += val_DrpDwnMns(daFrm.frmPage3_DJBehavior,"DJ Tone For Event","Please make a selection.");
                errMsg += val_DrpDwnMns(daFrm.frmPage3_DJArea_InOut,"DJ Setup Area","Please tell us where the DJ will be setting up.");
                //errMsg += val_DrpDwnMns(daFrm.frmPage3_DJArea_ClientHasTable,"Does Client or Venue Have 6\' table","Please make a selection.");
                //errMsg += val_DrpDwnMns(daFrm.frmPage3_DJArea_OutletDist,"distance of electrical outlet","Please make a selection.");
                //errMsg += val_DrpDwnMns(daFrm.frmPage3_DJArea_OutletGrndd,"is outlet grounded","Please make a selection.");
                //errMsg += val_DrpDwnMns(daFrm.frmPage3_DJArea_IsPrepTimeAProb,"Setup time","Please tell us if this will be a problem.");
                //errMsg += val_DrpDwnMns(daFrm.frmPage3_lightingPackage,"lighting package","Please tell us if you would like a lighting package.");
                errMsg += val_radio(daFrm.frmPage3_lightingPackage,"Dance Floor Lighting","Please make a selection.");
                errMsg += val_DrpDwnMns(daFrm.frmPage3_PhotoMontage,"Photo Montage","Please tell us if you would like to add equipment for a Photo Montage.");
                errMsg += val_DrpDwnMns(daFrm.frmPage3_BSMVideos,"Big Screen Music Videos","Please tell us if you would like to add \"Big Screen Music Videos\".");
                errMsg += val_DrpDwnMns(daFrm.frmPage3_Karaoke,"Karaoke","Please tell us if you would like to add a karaoke system to your party.");
            }
            else if(CurrPageNum==5){
                //errMsg += val_DrpDwnMns(daFrm.frmPage4_preferredPayment,"Preferred Payment Method","Please choose your preferred method of payment.");
                errMsg += val_MsgBox(false,500,daFrm.frmPage4_NotesRequestsComments,"Notes\, Requests\, or Comments","This text box allows a maximum 500 characters.");
                errMsg += val_phoneNum("frmPage4_QuoteAvalNum","Your Phone Number","Please provide a valid phone number.");
                errMsg += val_DrpDwnMns(daFrm.frmPage4_QA_PhoneType,"Your Phone Type","Please provide your phone type.");
                errMsg += val_DrpDwnMns(daFrm.frmPage4_BestTimeToCall,"best time to call","Please let us know the best time to call you.");
            }
        }

        var theAlrt = "Please complete the following information before continuing :\n";
        theAlrt += "____________________________________________________\n\n";
        theAlrt += errMsg;

        if(errMsg != ""){
            alert(theAlrt)
        }
        else{
            //daFrm.autoSaveOkToDo.value = "";
            daButton.value = btnMsg;
            daFrm.method = "POST";

            daFrm.action = "cntctBkngFrm_" + CurrPageNum + ".asp?CurrPageNum=" + CurrPageNum;
            daFrm.submit();
        }
    }
}


/*function autoSaveFlds(CurrPageNum){
    var daFrm = document.Form1;
    if (daFrm.autoSaveOkToDo) {
        var formData = "";
        if (daFrm.autoSaveOkToDo.value.toUpperCase() == "YES") {
            for (var i = 0; i < daFrm.elements.length; i++) {
                if (daFrm.elements[i].type.toUpperCase() == "CHECKBOX") {
                    if (daFrm.elements[i].checked) {
                        if (i == 0) {
                            formData += daFrm.elements[i].name + "=" + escape(daFrm.elements[i].value)
                        }
                        else {
                            formData += "&" + daFrm.elements[i].name + "=" + escape(daFrm.elements[i].value)
                        }
                    }
                }
                else if (daFrm.elements[i].type.toUpperCase() == "RADIO") {
                    if (daFrm.elements[i].checked) {
                        if (i == 0) {
                            formData += daFrm.elements[i].name + "=" + escape(daFrm.elements[i].value)
                        }
                        else {
                            formData += "&" + daFrm.elements[i].name + "=" + escape(daFrm.elements[i].value)
                        }
                    }
                }
                else {
                    if (i == 0) {
                        formData += daFrm.elements[i].name + "=" + escape(daFrm.elements[i].value)
                    }
                    else {
                        formData += "&" + daFrm.elements[i].name + "=" + escape(daFrm.elements[i].value)
                    }
                }
            }
            formData += "&CurrPageNum=" + CurrPageNum;
            //var the_specs = "height=1000,width=2000,toolbar=no,";
            //the_specs += "menubar=no,scrollbars=no,resizable=yes,";
            //the_specs += "location=no,directories=no,status=no,left=100,top=100";
 
            daFrm.autoSaveOkToDo.value = "";
            //var popUpSaveFlds;
            //popUpSaveFlds = window.open("saveFormData.asp?" + formData, "SavingFormData", config=the_specs);
            document.frames("saveFrame").location.href="saveFormData.asp?"+formData;
        }
        return true;
    }
}
*/






function clearIt(initialText,fldName)
{
eval("var theFld = document.Form1." + fldName);
if (theFld.value == initialText)
{
theFld.value = "";
}
}

function do_brsrDtct()
{
document.Form1.brwsrName.value = navigator.appName;
document.Form1.brwsrVers.value = navigator.appVersion;
}


var the_message = "For privacy purposes, do not attempt to copy or duplicate any material from ";
   the_message += "this web site! \n\nAll text, graphics, and photos are protected by strict copyright laws!";


  function disableRightClick(btnClick)
  {
    if (navigator.appName == "Netscape" && btnClick.which == 3) // check for netscape and right click
    {   
      alert(the_message);
      return false;
    }
    else if (navigator.appName =="Microsoft Internet Explorer" && event.button == 2)  // for IE and Right Click
    {
      alert(the_message);
      return false;
    }
  }

// document.onmousedown = disableRightClick;


function TrimDaStrg(daStg) 
{
while (daStg.indexOf(" ") != -1) {
daStg = daStg.replace(" ","");
}
return daStg;
}
 

function daErrMsg(daMsg)
{
daMsg = daMsg.replace("&errmsg;","");
var alldaMsg = "";
if (TrimDaStrg(daMsg) != "") {
    alldaMsg = "<CENTER><TABLE BORDER='0' CELLPADDING='3' CELLSPACING='1' BGCOLOR='#FF0000'>";
   alldaMsg += "<TR><TD class='errMsg'>" + daMsg + "</TD></TR></TABLE></CENTER>";
      }
return alldaMsg;
}


function txtBoxMaxLngth(daFld,mxlngth)
{
if (navigator.appName != "Netscape") {
if ((daFld.value).length > mxlngth) daFld.value = daFld.value.substring(0,mxlngth);
}
}

function mnTBWdth(){
    //adjust width of main table according to what the end user's screen size is
    var daWidth = "610";
    if (parseInt(navigator.appVersion)>=4) {
        if (screen.width >= 800){
            daWidth = "750";
        }
    }
    return "<table border='0' cellpadding='0' cellspacing='0' width='" + daWidth + "'>";
}


///<img border="0" src="media/sp_spacer.gif" width="560" height="1">

function mnMAIN_TBWdth()
{
//adjust width of main table according to what the end user's screen size is
var daWidth = "420";
if (parseInt(navigator.appVersion)>=4) {
if (screen.width >= 800)
{
daWidth = "560";
}
}
return "<img border='0' src='media/sp_spacer.gif' width='" + daWidth + "' height='1'>";
}



//[START] Top Tool Bar
function doTopToolBar() 
{
var i = 1;
var daCount = 2;
var itemArry = doTopToolBar.arguments;
var itemArryLngth = itemArry.length;
var daItem;
var topToolBarTxT = "";
 
topToolBarTxT += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"20\">";
topToolBarTxT += "<tr>";
 
if (itemArry[0] != "" && location.href.indexOf("cntctBkngFrm_") == -1) {
topToolBarTxT += "<td>";
topToolBarTxT += "<table class=\"topRgtBtnGreen\" ID=\"daBut_1\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"20\">";
topToolBarTxT += "<tr>";
topToolBarTxT += "<td height=\"20\" rowspan=\"2\" valign=\"bottom\"><img border=\"0\" src=\"media/sp_Tbtn_L.gif\" width=\"18\" height=\"20\"></td>";
topToolBarTxT += "<td bgcolor=\"#000000\" height=\"1\"><img border=\"0\" src=\"media/sp_spacer.gif\" width=\"1\" height=\"1\"></td>";
topToolBarTxT += "<td height=\"1\" rowspan=\"2\" valign=\"bottom\"><img border=\"0\" src=\"media/sp_Tbtn_R.gif\" width=\"9\" height=\"20\"></td>";
topToolBarTxT += "</tr>";
topToolBarTxT += "<tr>";
topToolBarTxT += "<td height=\"19\">";
topToolBarTxT += "<a class=\"topRgtBtnLnk\" href=\""; 
topToolBarTxT += "cntctBkngFrm_" + itemArry[0] + ".asp";
topToolBarTxT += "\" onmouseover=\"mouseThing_TR(this,\'topRgtBtnlightRed\');\" onmouseout=\"mouseThing_TR(this,\'topRgtBtnGreen\');\">";
topToolBarTxT += "back to booking Info";
topToolBarTxT += "</a>";
topToolBarTxT += "</td>";
topToolBarTxT += "</tr>";
topToolBarTxT += "</table>";
topToolBarTxT += "</td>";
}
 
while (i < itemArryLngth) {
daItem = itemArry[i].split("|")
topToolBarTxT += "<td>";
topToolBarTxT += "<table class=\"topRgtBtn\"  ID=\"daBut_" + daCount + "\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"20\">";
topToolBarTxT += "<tr>";
topToolBarTxT += "<td height=\"20\" rowspan=\"2\" valign=\"bottom\"><img border=\"0\" src=\"media/sp_Tbtn_L.gif\" width=\"18\" height=\"20\"></td>";
topToolBarTxT += "<td bgcolor=\"#000000\" height=\"1\"><img border=\"0\" src=\"media/sp_spacer.gif\" width=\"1\" height=\"1\"></td>";
topToolBarTxT += "<td height=\"1\" rowspan=\"2\" valign=\"bottom\"><img border=\"0\" src=\"media/sp_Tbtn_R.gif\" width=\"9\" height=\"20\"></td>";
topToolBarTxT += "</tr>";
topToolBarTxT += "<tr>";
topToolBarTxT += "<td height=\"19\">";
topToolBarTxT += "<a class=\"topRgtBtnLnk\" href=\""; 
topToolBarTxT += daItem[1];
topToolBarTxT += "\" onmouseover=\"mouseThing_TR(this,\'topRgtBtnlightRed\');\" onmouseout=\"mouseThing_TR(this,\'topRgtBtn\');\">";
topToolBarTxT += daItem[0];
topToolBarTxT += "</a>";
topToolBarTxT += "</td>";
topToolBarTxT += "</tr>";
topToolBarTxT += "</table>";
topToolBarTxT += "</td>";
i++;
daCount++;
}
topToolBarTxT += "<td><img border=\"0\" src=\"media/sp_spacer.gif\" width=\"20\" height=\"1\"></td>";
topToolBarTxT += "</tr>";
topToolBarTxT += "</table>";
 
return topToolBarTxT;
}
//[END] Top Tool Bar
function mouseThing_TR(daTB,daClassName)
{
if (navigator.appName == "Netscape" && dabrwsrVer() >= 5)
{
while (daTB.tagName!="TABLE")
{
daTB=daTB.parentNode;
}	
} else if (navigator.appName == "Microsoft Internet Explorer") {
while (daTB.tagName!="TABLE")
{
daTB=daTB.parentElement;
}
}
daTB.className = daClassName;
return true;
}


function dabrwsrVer() {
var daAppVer = navigator.appVersion.toString();
var version;
var Start_loc;
  var End_loc;

if (navigator.appName == "Microsoft Internet Explorer") {
Start_loc = daAppVer.indexOf("MSIE") + 4;
End_loc = daAppVer.indexOf(";",Start_loc);
version = parseFloat(TrimDaStrg(daAppVer.substring(Start_loc, End_loc)));
} else {
version = parseFloat(daAppVer);
}

return version;
}





var thepup = "";

//this is the pup Function/////////////////////////////////////////////////////
function pup(daSubCat,daKey,theWidth,theHeight)
{
var daPUPpage = "popUpImage.asp?";
   daPUPpage += "daKey=" + daKey;
   daPUPpage += "&daSubCat=" + daSubCat;


var theW = parseFloat(theWidth)+20;
var theH = parseFloat(theHeight)+40;
var da_win_left = 100;
var da_win_top = 225;
  
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
var da_scrn_wdth = screen.width
var da_scrn_hgth = screen.height
var hlf_theW = theW/2
var hlf_theH = theH/2
da_win_left = da_scrn_wdth/2-hlf_theW
 da_win_top = da_scrn_hgth/2-hlf_theH
}
 
var the_specs = "height=" + theH.toString() + ",width=" + theW.toString() + ",toolbar=no,";
   the_specs += "menubar=no,scrollbars=yes,resizable=no,";
   the_specs += "location=no,directories=no,status=no,left=" + da_win_left + ",top=" + da_win_top;
 
thepup = window.open(daPUPpage, "daPUP", config=the_specs);

}


function ADMIN_pup(daKey,daSubCat,theWidth,theHeight)
{
var daPUPpage = "popUpImage.asp?fromPA_ADMIN=1&";
   daPUPpage += "daKey=" + daKey;
   daPUPpage += "&daSubCat=" + daSubCat;

var theW = theWidth
var theH = theHeight
var da_win_left = 100
var da_win_top = 225
  
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
var da_scrn_wdth = screen.width
var da_scrn_hgth = screen.height
var hlf_theW = theW/2
var hlf_theH = theH/2
da_win_left = da_scrn_wdth/2-hlf_theW
 da_win_top = da_scrn_hgth/2-hlf_theH
}
 
var the_specs = "height=" + theH + ",width=" + theW + ",toolbar=no,";
   the_specs += "menubar=no,scrollbars=no,resizable=no,";
   the_specs += "location=no,directories=no,status=no,left=" + da_win_left + ",top=" + da_win_top;
 
thepup = window.open(daPUPpage, "daPUP", config=the_specs);

}


////////////////////////////////////////////////////////////////////////////////////


function clsepup() { 
//this is to close the Check window//////////////
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
if (thepup)
{
thepup.close();
}
}
///////////////////////////////////////////////
}



//Begin doAutoPAtable
function doAutoPAtable() { 
	
 
var daItems = doAutoPAtable.arguments;
var numOfItems = daItems.length-1;
var daFirstArgumentArry = daItems[0];
    daFirstArgumentArry = daFirstArgumentArry.split("|");
    
var numofTotalItems = parseFloat(daFirstArgumentArry[0]);
var theCategory = parseFloat(daFirstArgumentArry[1]);
var theSubCat = parseFloat(daFirstArgumentArry[2]);
 
var theColNum = 1;
var theColSpan = 2;
var theString = "";
var theKey = "";
var theSubCatFIXED = "";
var theWidth = "";
var theHeight = "";
var theItemCount = 1;
var theItemsSubArry;
  
var daClassNstuff = "class=\"PAthumbNail\" onmouseover=\"this.className='PAthumbNail:hover';\" onmouseout=\"this.className='PAthumbNail';\" border=\"2\" width=\"30\" height=\"30\"";
  
  
  
theString += "<td><img  src=\"media/sp_spacer.gif\" border=\"0\" width=\"10\" height=\"1\"></td><td valign=\"top\">";
theString += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
 
  
  
while (theItemCount < numOfItems) { //While Begin
theItemsSubArry = daItems[theItemCount];
theItemsSubArry = theItemsSubArry.split("|");
theSubCatFIXED = theItemsSubArry[0];
theKey = theItemsSubArry[1];
theWidth = theItemsSubArry[2];
theHeight = theItemsSubArry[3];
 
 
       if (theColNum == 1) {
theString += "<tr><td><a href=\"javascript:pup('" + theSubCatFIXED + "','" + theKey + "','" + theWidth + "','" + theHeight + "');\"><img " + daClassNstuff + " src=\"media/photoAlbum/RRImages/PICS_tbn_" + theKey + ".jpg\"></a></td>";
} else if (theColNum == theColSpan) {
theString += "<td><a href=\"javascript:pup('" + theSubCatFIXED + "','" + theKey + "','" + theWidth + "','" + theHeight + "');\"><img " + daClassNstuff + " src=\"media/photoAlbum/RRImages/PICS_tbn_" + theKey + ".jpg\"></a></td></tr>";
} else {
theString += "<td><a href=\"javascript:pup('" + theSubCatFIXED + "','" + theKey + "','" + theWidth + "','" + theHeight + "');\"><img " + daClassNstuff + " src=\"media/photoAlbum/RRImages/PICS_tbn_" + theKey + ".jpg\"></a></td>";
}
theColNum++
 
if (theColNum == theColSpan+1) {
theColNum = 1;
}
theItemCount++
} //While End

var lgthOfStrg = theString.length;
var lastBitOfStrg = theString.substring(lgthOfStrg-5,lgthOfStrg);

if (lastBitOfStrg.indexOf("</tr>") == -1) {
theString += "</tr>";
}



if (numofTotalItems > numOfItems) {
theString += "<tr><td colspan=\"" + theColSpan + "\" class=\"itemsSmallLink\">[<a class=\"itemsSmallLink\" href=\"PA_Cat_" + theCategory;
if (theSubCat != 0) {
theString += "_subCat_" + theSubCat.toString();
}
theString += ".asp\">more images</a>]</td></tr>";
}
theString += "</table>";
theString += "</tb>";
 
 
return theString;
} 
//End doAutoPAtable





function updateSite_flag(onOff) {
if (onOff) {
return setTheCrum("updateSite_flag","on","NEVER","/","",false);
} else {
return setTheCrum("updateSite_flag","off","NEVER","/","",false);
}
}
 
function siteNeedsUpdate() {
var daFlagVal = getCookieData("updateSite_flag");

if (daFlagVal == "on") {
return true;
} else {
return false;
}

}




var theUpdateSitepup = "";

//this is the [update site] Function/////////////////////////////////////////////////////
function updateSite(goTo)
{
	
if (updateSite.arguments) {

}
	
	
var daPUPpage = "a_siteUpdate.asp?goTo=" + escape(goTo);



var theW = 325
var theH = 190
var da_win_left = 100
var da_win_top = 225
  
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
var da_scrn_wdth = screen.width
var da_scrn_hgth = screen.height
var hlf_theW = theW/2
var hlf_theH = theH/2
da_win_left = da_scrn_wdth/2-hlf_theW
 da_win_top = da_scrn_hgth/2-hlf_theH
}
 
var the_specs = "height=" + theH + ",width=" + theW + ",toolbar=no,";
   the_specs += "menubar=no,scrollbars=no,resizable=no,";
   the_specs += "location=no,directories=no,status=no,left=" + da_win_left + ",top=" + da_win_top;
 
theUpdateSitepup = window.open(daPUPpage, "daPUP", config=the_specs);

}

////////////////////////////////////////////////////////////////////////////////////



function logOff() {
location="a_logOnOff.asp?OnOff=off";
}


function logOn() {
location = "a_logOn.asp";
}



//[begin]///Edit Buttons////////


function editPageCaption(theKey) {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_PageCaption.asp?theKey=" + theKey + "');";
daBtn = "<input type=\"button\" value=\"edit\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\">";
} 
return daBtn;
}


function editFAQ(theKey) {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_FAQ.asp?theKey=" + theKey + "');";
daBtn = "<input type=\"button\" value=\"edit\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\">";
} 
return daBtn;
}

function addAnFAQ() {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_FAQ.asp');";
daBtn = "<input type=\"button\" value=\"add a FAQ\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\" style=\"width:100%;\">";
} 
return daBtn;
}







//[end]///Edit Buttons////////

//***********************************************
//*** Programming Developed By Clint Bray | clint@clintbray.com *******
//***********************************************


//this is the [edit this thing] Function/////////////////////////////////////////////////////
function editRupdateDisTing(editUpdatePage) {
	
var daPUPpage = editUpdatePage;



var theW = 450
var theH = 400
var da_win_left = 100
var da_win_top = 225
  
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
var da_scrn_wdth = screen.width
var da_scrn_hgth = screen.height
var hlf_theW = theW/2
var hlf_theH = theH/2
da_win_left = da_scrn_wdth/2-hlf_theW
 da_win_top = da_scrn_hgth/2-hlf_theH
}
 
var the_specs = "height=" + theH + ",width=" + theW + ",toolbar=no,";
   the_specs += "menubar=no,scrollbars=no,resizable=no,";
   the_specs += "location=no,directories=no,status=yes,left=" + da_win_left + ",top=" + da_win_top;
 
theUpdateSitepup = window.open(daPUPpage, "daPUP", config=the_specs);

}

////////////////////////////////////////////////////////////////////////////////////



function isLoggedIn() {
var daFlagVal = getCookieData("admin");

if (daFlagVal == "on") {
return true;
} else {
return false;
}

}




function editEvntRsrc(theKey) {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_EvntRsrc.asp?theKey=" + theKey + "');";
daBtn = "<input type=\"button\" value=\"edit\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\">";
} 
return daBtn;
}

function addAnER() {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_EvntRsrc.asp');";
daBtn = "<input type=\"button\" value=\"add a Memphis [Page 1] Event Resource\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\" style=\"width:100%;\">";
} 
return daBtn;
}

function editEvntRsrcTwo(theKey) {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_EvntRsrcTwo.asp?theKey=" + theKey + "');";
daBtn = "<input type=\"button\" value=\"edit\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\">";
} 
return daBtn;
}

function addAnERTwo() {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_EvntRsrcTwo.asp');";
daBtn = "<input type=\"button\" value=\"add a Memphis [Page 2] Event Resource\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\" style=\"width:100%;\">";
} 
return daBtn;
}





function editEvntRsrcNASH(theKey) {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_EvntRsrcNASH.asp?theKey=" + theKey + "');";
daBtn = "<input type=\"button\" value=\"edit\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\">";
} 
return daBtn;
}

function addAnERNASH() {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_EvntRsrcNASH.asp');";
daBtn = "<input type=\"button\" value=\"add a Nashville Event Resource\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\" style=\"width:100%;\">";
} 
return daBtn;
}



function edit_Client(theKey) {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_Client.asp?theKey=" + theKey + "');";
daBtn = "<input type=\"button\" value=\"edit\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\"> ";
} 
return daBtn;
}

function add_Client() {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_Client.asp');";
daBtn = "<br><input type=\"button\" value=\"add a Client to the List\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\" style=\"width:100%;\">";
} 
return daBtn;
}









function edit_Feature(featureNum) {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_Feature.asp?featureNum=" + featureNum + "');";
daBtn = "<input type=\"button\" value=\"edit\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\">";
} 
return daBtn;
}

function add_Feature() {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_Feature.asp');";
daBtn = "<input type=\"button\" value=\"add a Features\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\" style=\"width:100%;\">";
} 
return daBtn;
}




function edit_CatPageBlurb(theCategoryNum) {
var daBtn = "";
var daFunc = "";
if (isLoggedIn()) {
daFunc = "editRupdateDisTing('a_Edit_CatPageBlurb.asp?theCategoryNum=" + theCategoryNum + "');";
daBtn = "<input type=\"button\" value=\"edit\" class=\"adminButtonsEdit\" onclick=\"" + daFunc + "\">";
} 
return daBtn;
}


//***********************************************
//*** Programming Developed By Clint Bray | clint@clintbray.com *******
//***********************************************
//this is the puVid Function/////////////////////////////////////////////////////
function puVid(f,theWidth,theHeight)
{
var daPUPpage = "popUpVideo.asp?";
   daPUPpage += "f=" + f;
   daPUPpage += "&w=" + theWidth.toString();
   daPUPpage += "&h=" + theHeight.toString();


var theW = theWidth
var theH = theHeight
var da_win_left = 100
var da_win_top = 225
  
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
var da_scrn_wdth = screen.width
var da_scrn_hgth = screen.height
var hlf_theW = theW/2
var hlf_theH = theH/2
da_win_left = da_scrn_wdth/2-hlf_theW
 da_win_top = da_scrn_hgth/2-hlf_theH
}
 
var the_specs = "height=" + theH + ",width=" + theW + ",toolbar=no,";
   the_specs += "menubar=no,scrollbars=no,resizable=no,";
   the_specs += "location=no,directories=no,status=no,left=" + da_win_left + ",top=" + da_win_top;
 
thepup = window.open(daPUPpage, "daPUP", config=the_specs);

}
////////////////////////////////////////////////////////////////////////////////////

//this is the puTest() Function/////////////////////////////////////////////////////
function puTest()
{
var daPUPpage = "test/test.html";



var theW = 640
var theH = 480
var da_win_left = 100
var da_win_top = 225
  
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
var da_scrn_wdth = screen.width
var da_scrn_hgth = screen.height
var hlf_theW = theW/2
var hlf_theH = theH/2
da_win_left = da_scrn_wdth/2-hlf_theW
 da_win_top = da_scrn_hgth/2-hlf_theH
}
 
var the_specs = "height=" + theH + ",width=" + theW + ",toolbar=no,";
   the_specs += "menubar=no,scrollbars=yes,resizable=yes,";
   the_specs += "location=no,directories=no,status=no,left=" + da_win_left + ",top=" + da_win_top;
 
thepup = window.open(daPUPpage, "daPUP", config=the_specs);

}

function puTest2()
{
var daPUPpage = "../test/test.html";



var theW = 640
var theH = 480
var da_win_left = 100
var da_win_top = 225
  
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
var da_scrn_wdth = screen.width
var da_scrn_hgth = screen.height
var hlf_theW = theW/2
var hlf_theH = theH/2
da_win_left = da_scrn_wdth/2-hlf_theW
 da_win_top = da_scrn_hgth/2-hlf_theH
}
 
var the_specs = "height=" + theH + ",width=" + theW + ",toolbar=no,";
   the_specs += "menubar=no,scrollbars=yes,resizable=yes,";
   the_specs += "location=no,directories=no,status=no,left=" + da_win_left + ",top=" + da_win_top;
 
thepup = window.open(daPUPpage, "daPUP", config=the_specs);

}
////////////////////////////////////////////////////////////////////////////////////

//this is the genPUP() Function/////////////////////////////////////////////////////
function genPUP(daPUPpage,theW,theH)
{ 
var da_win_left = 100
var da_win_top = 225
  
if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
var da_scrn_wdth = screen.width
var da_scrn_hgth = screen.height
var hlf_theW = theW/2
var hlf_theH = theH/2
da_win_left = da_scrn_wdth/2-hlf_theW
 da_win_top = da_scrn_hgth/2-hlf_theH
}
 
var the_specs = "height=" + theH + ",width=" + theW + ",toolbar=no,";
   the_specs += "menubar=no,scrollbars=no,resizable=no,";
   the_specs += "location=no,directories=no,status=no,left=" + da_win_left + ",top=" + da_win_top;
 
thepup = window.open(daPUPpage, "daPUP", config=the_specs);

}
////////////////////////////////////////////////////////////////////////////////////



//***********************************************
//*** Programming Developed By Clint Bray | clint@clintbray.com *******
//***********************************************
 
function doWaterMarkImage() {
	
var sImageName = "watermark";
var sW = "260";
var sH = "50";
var sPassBack = "";

if (browser.isIE) {
sPassBack = "<div id\"watermark\" style=\"border:0px;margin:0px;width:" + sW + "px;height:" + sH + "px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='image', src='media/images/" + sImageName + ".png');\"><img border=\"0\" src=\"media/images/spacer.gif\" width=\"" + sW + "\" height=\"" + sH + "\"></div>";
} else if (browser.isNS) {
sPassBack = "<img border=\"0\" src=\"media/images/" + sImageName + ".png\" width=\"" + sW + "\" height=\"" + sH + "\">";
} else if (browser.isFireFox) {
sPassBack = "<img border=\"0\" src=\"media/images/" + sImageName + ".png\" width=\"" + sW + "\" height=\"" + sH + "\">";
} else {
sPassBack = "<img border=\"0\" src=\"media/images/" + sImageName + ".jpg\" width=\"" + sW + "\" height=\"" + sH + "\">";
}

return "&nbsp;" //sPassBack;
 
}



