﻿/*
    Author: Jeffrey Gordillo
    Date: 5/5/2009
    Description: Functions required in the website
*/

function openPopupPic(strPicture) {
    window.open("../content/PopupPicture.html?" + strPicture, "Picture", "resizable=1,height=50,width=50");
}

function getObj(objName) {
	if (document.getElementById) {
		return document.getElementById(objName);
	}
	else if (document.all) {
		return document.all[objName];
	}
	else if (document.layers) {
		return document.layers[objName];
	}
}

function cleanField(nameField) {
    objField = getObj(nameField);

    if (objField)
        if (objField.value == 'Search')
            objField.value = "";
}

function isNumber(field) {
    var re = /^[0-9-'.'-',']*$/;
    if (!re.test(field.value)) {
        field.value = field.value.replace(/[^0-9-'.'-',']/g, "");
    }
}


function fixFooter() {
    var objPage = Page.getWindowSize();
    var objFooter = getObj('footer');

    if (objPage.pageHeight > objPage.windowHeight) {
        if (document.all)
            objFooter.style.top = (objPage.pageHeight - 1) + 'px';
        else
            objFooter.style.top = (objPage.pageHeight - objFooter.clientHeight - 1) + 'px';
    }
    else {
        objFooter.style.top = (objPage.windowHeight - objFooter.clientHeight - 1) + 'px';
    }
}

function loadReel() {
    if (window.location.hash.indexOf("showReel") !== -1)
        displayOverlay(true);
}