function swapImg(id, ImgPath)
{
	document.getElementById(id).src = ImgPath;
}

function swapSubImg(id, img)
{
	document.getElementById(id).src = '../_uploads/buttons/' + img;
}

function EvalSound(soundobj) {}

function playAudio(audioPathAndFileName) { 

  document.sound1.src = audioPathAndFileName;

}

function showSub(id)
{
	var elementID = document.getElementById(id);

	if (elementID.style.display == 'block' || elementID.style.display == '')
	{
		elementID.style.display = 'none';
	}
	else
	{
		elementID.style.display = 'block';
	}
}

function openMediaManager()
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('http://www.corrievanbinsbergen.com/admin_media/?files=null', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=350,left = 590,top = 350');");
}

function openMediaOptions()
{
	day = new Date();
	id = day.getTime();
	eval("media_options" + id + " = window.open('http://www.corrievanbinsbergen.com/admin_content/media_options/', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=350,left = 590,top = 350');");
}

function changeMedia(id)
{
	var docID = document.getElementById(id);
	
	if (docID.checked == true)
	{
		location.href = window.location + '&' + id + '=1';
	}
	else
	{
		location.href = window.location + '&' + id + '=0';
	}
}

function checkUncheckAll(theElement) 
{
	var theForm = theElement.form, z = 0;
	for(z=0; z<theForm.length;z++)
	{
		if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall')
		{
			theForm[z].checked = theElement.checked;
		}
	}
}

function openPopup( URL, Width, Height ) {
	window.open( URL, 'cvb_popup', 'toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=1, width='+ Width +', height='+ Height +'' );
}