// mediaplayer settings
var mpsettings_1 = $H({
        mpWidth:250,
        mpHeight:40,
        mpFirstload:true,
        mpDlButton:false,
        mpLoader:false,
        mpAltmediaplayer:'',
        mpDivTag:'mediaplayerwrapper_1',
        mpScrollto:true
});

/*
function resize_redfluid () {
	// determine browser height

	var browserHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		browserHeight = window.innerHeight;
	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		browserHeight = document.documentElement.clientHeight;
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		browserHeight = document.body.clientHeight;
	}

	// determine div tag height
	var contentheight = $('middleframe').getHeight();

	//alert ((contentheight + 109) + ' ' + (browserHeight - 119));

	if ((contentheight + 109) > (browserHeight - 119)) {
		// scrolling is required, set page height to accommodate additional length needed for content
		$('pagecontent').setStyle({height:(contentheight + 109) + "px"});
	}
	else {
		$('pagecontent').setStyle({height:(browserHeight - 119) + "px"});
	}
	
	if (document.body.className == "nm_currentPage_media") {
		// hack to try another resize of the red fluid after YouTube embed is rendered
		setTimeout("resize_redfluid()", 2500);	
	}
}
*/

function checkrequired(which) {
	var pass=true;
	if (document.images) {
		for (i=0;i<which.length;i++) {
			var tempobj=which.elements[i];
			if (tempobj.name.substring(0,8)=="required") {
				if (((tempobj.type=="text"||tempobj.type=="textarea")&&
				tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
				tempobj.selectedIndex==0)) {
					pass=false;
					break;
				}
			}
		}
	}
	if (!pass) {
		shortFieldName=tempobj.name.substring(8,30).toUpperCase();
		alert("There are missing fields in this form. Please make sure that all required fields are properly completed.");
		return false;
	}
	else
	return true;
}

function clearfield() {
	if (document.contact.requiredcontent.value == 'enter the content of your email message here') {
		document.contact.requiredcontent.value = '';
	}
}

document.observe("dom:loaded", function() {
	if ($('ajax_calendar')) {
	    initCalAjaxLinks();
	}
	
	if ($(document.body).hasClassName('nm_currentPage_media')) {
	    soundClipsListing();
		if ($('gallerywrapper')) {
			webkit.modinit('photogallery');
		}
	}
	
});


// soundclips observers                                                                                                                 
function soundClipsListing() {
    $$('#soundclipslisting ul li a').each(function(o) {
	    o.stopObserving('click');
	    o.parentNode.observe('mouseover', function(e) {
		    cursorLink();
		});
	    o.parentNode.observe('mouseout', function(e) {
		    cursorClear();
		});
	    o.parentNode.observe('click', function(e) {
		    e.stop();
		    var thisID = o.id.replace(/^clip_/,'');
		    webkit_playsonglegacy(thisID);
		});
	});
}