﻿// force document.getElementById as a function
if(document.all && !document.getElementById)
	{	
		document.getElementById = function(id) {
			return document.all[id];
			}
	}

// on loss of focus, if the message is "" then change it to 'email address'
function CheckLoss(thisElement)
{
	el = document.getElementById(thisElement);
	if (el.value == "") { el.value = "Email address" }; 
}
function CheckFocus(thisElement)
{
	el = document.getElementById(thisElement);
	if (el.value == "Email address" || el.value == "Invalid email!" || el.value == "Thank you!") { el.value = "" }; 
}
function toggle(movie)
{
    if(!isToggling)
    {
        isToggling = true;
        trEl = document.getElementById("code" + movie);
        btnEl = document.getElementById("btnToggle" + movie);
        if(trEl.style.display == 'none')
        {
            if(navigator.appName.indexOf("Microsoft") > -1 )
            {
                trEl.style.display = 'block';
            } else {
                trEl.style.display = 'table-row';
            }
            btnEl.src = "images/btn_getCode_contract.gif";
        } else {
            trEl.style.display = 'none';
            btnEl.src = "images/btn_getCode_expand.gif";
        }
        isToggling = false;
    }
}
function showPopUp(thisContent,thisWidth,thisHeight)
{
	var popUrl = thisContent;
	var args = "toolbar=0,width=" + thisWidth + ",height=" + thisHeight + ",statusbar=no,scrollbars=1";
	window.open(popUrl, null, args);
}
function showPopUpNoScroll(thisContent,thisWidth,thisHeight)
{
	var popUrl = thisContent;
	var args = "toolbar=0,width=" + thisWidth + ",height=" + thisHeight + ",statusbar=no,scrollbars=0";
	window.open(popUrl, null, args);
}
function showPhotos(pageString)
{
    var args = "toolbar=0,width=360,height=455,statusbar=no,scrollbars=0";
    window.open(pageString, null, args);
}

function showPhoto1(eventIsCalling,strEvent,strImage,intHigh)
{
    var popUrl;
    
    if(eventIsCalling == "false")
    {
        popUrl = "../Photo.aspx?event=" + strEvent + "&image=" + strImage    
    } else {
        popUrl = "Photo.aspx?event=" + strEvent + "&image=" + strImage   
    }
    
    var args = "toolbar=1,width=360,height=380,statusbar=no,scrollbars=0";
    window.open(popUrl, null, args);
}
function showPhoto(eventIsCalling,strEvent,strImage,intHigh)
{
    var popUrl;
    
    if(eventIsCalling == "true")
    {
        popUrl = "../Uploads/_tempPhotoPopUp.aspx?event=" + strEvent + "&image=" + strImage + "&highImage=" + intHigh;    
    } else {
        popUrl = "Uploads/_tempPhotoPopUp.aspx?event=" + strEvent + "&image=" + strImage + "&highImage=" + intHigh;   
    }
    
    var args = "toolbar=0,width=360,height=380,statusbar=no,scrollbars=0";
    window.open(popUrl, null, args);
}
function showPhoto(eventIsCalling,strEvent,strImage,intHigh,path)
{
    var popUrl;
    
    if(eventIsCalling == "true")
    {
        popUrl = "../Uploads/_tempPhotoPopUp.aspx?event=" + strEvent + "&image=" + strImage + "&highImage=" + intHigh+"&path="+path;    
    } else {
        popUrl = "Uploads/_tempPhotoPopUp.aspx?event=" + strEvent + "&image=" + strImage + "&highImage=" + intHigh+"&path="+path;   
    }
    
    var args = "toolbar=0,width=360,height=380,statusbar=no,scrollbars=0";
    window.open(popUrl, null, args);
}

