// Browser Detection
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;

// Body onload utility (supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f) {
	if (IEmac && IE4) { // IE 4.5 blows out on testing window.onload
		window.onload = SafeOnload;
		gSafeOnload[gSafeOnload.length] = f;
	} else if (window.onload) {
		if (window.onload != SafeOnload) {
			gSafeOnload[0] = window.onload;
			window.onload = SafeOnload;
		}
		gSafeOnload[gSafeOnload.length] = f;
	} else {
		window.onload = f;
	}
}
function SafeOnload() {
	for (var i=0;i<gSafeOnload.length;i++)
		gSafeOnload[i]();
}

// Call the following with your function as the argument
//SafeAddOnload(yourfunctioname);

function swapImg(newImage) {
	theNewImage = 'url('+newImage+')';
    if (document.getElementById) {
        window.document.getElementById('projectFrameFull').style.backgroundImage=theNewImage;
    }
    else if (document.layers) {
        window.document.layers['projectFrameFull'].backgroundImage=theNewImage;
    }
    else if (document.all) {
        window.document.all['projectFrameFull'].style.backgroundImage=theNewImage;
    }
}

function swapImg2(newImage) {
    if (document.getElementById) {
        window.document.getElementById('mainimg').setAttribute('src', newImage);
        window.document.getElementById('mainimg').removeAttribute('width');
    }
    else if (document.layers) {
        window.document.layers['mainimg'].setAttribute('src', newImage);
        window.document.layers['mainimg'].removeAttribute('width');
    }
    else if (document.all) {
        window.document.all['mainimg'].setAttribute('src', newImage);
        window.document.all['mainimg'].removeAttribute('width');
    }
}

function jumpMenu(obj) {
    if (obj.options[obj.selectedIndex].value != '#') {
        eval("window.location='" + obj.options[obj.selectedIndex].value + ".php'");
    }
}

var className = '';
function over(id) {
    if (document.getElementById) {
        window.classname = window.document.getElementById(id).className;
        window.document.getElementById(id).className = 'active';
    }
    else if (document.layers) {
        window.classname = window.document.layers[id].className;
        window.document.layers[id].className = 'active';
    }
    else if (document.all) {
        window.color = window.document.all[id].className;
        window.document.all[id].className = 'active';
    }
}

function out(id) {
    if (document.getElementById)
        window.document.getElementById(id).className = window.className;
    else if (document.layers)
        window.document.layers[id].className = window.className;
    else if (document.all)
        window.document.all[id].className = window.className;
}

<!--
function checkForm(myForm) {
    var form = myForm
    //Check if any fields are filled in
    var field
    fieldsWithContent = 0
    for (index=0; index<form.elements.length; index++){
        field = form.elements[ index ];
        if (field.value.length > 0 && field.type != 'submit' && field.type != 'hidden') {
            fieldsWithContent++
        }
    }
    if (fieldsWithContent == 0) {
        alert("You must complete at least one field. Please check the form and resubmit.")
        return (false)
    } else {
        //Next check the email address to see if it was entered and if so, valid
        if (myForm.email.value.length > 0) {
            if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)) {
                return (true)
            }
            alert("Invalid E-mail Address! Please re-enter.")
            return (false)
        }
    }
}
//-->
function clearField(field) {
    if (field.value == field.defaultValue) {
        field.value = '';
    }
}
function resetField(field) {
    if (field.value == '') {
        field.value = field.defaultValue;
    }
}

