

function tnSwap(img,project_id,media_index,movwidth,movheight) {
	if (document.images) {
		document.feature_img.src = "/img/projects/" + img + "_med.jpg";
		mi = media_index;
	}
}
function tnSwapBig(img) {
	if (document.images) {
		document.feature_img.src = "/img/projects/" + img + ".jpg";
		media_index = img;
	}
}
function mediaPop(project_id,media_index,movwidth,movheight) {
 	if (typeof mi=="undefined") mi = 0;
	var url = '/media/?project_id=' + project_id + '&media_index=' + mi+ '&width=' + movwidth+ '&height=' + movheight;
	var width = (movwidth+20);
	var height = (movheight+204);
	 
	afWindow = window.open(url,'popwin','resizable=yes,width=' + width ,'height=' + height);
	afWindow.focus();
	afWindow.resizeTo(width,height);
}
function tnMediaPop(project_id,media_index,movwidth,movheight) {
  	var url = '/media/?project_id=' + project_id + '&media_index=' + media_index+ '&width=' + movwidth+ '&height=' + movheight;
	var width = (movwidth+20);
	var height = (movheight+204);
	 
	afWindow = window.open(url,'popwin','resizable=yes,width=' + width ,'height=' + height);
	afWindow.focus();
	afWindow.resizeTo(width,height);
}

function toggleMod(which) {
	var module = 'mod_' + which;
	var head = 'head_' + which;
	
	if (document.getElementById(module).style.display == 'none') {
		document.getElementById(module).style.display = 'block'
		document.getElementById(head).style.backgroundImage = 'url(/img/modarrow_open_trans.gif)'
	} else {
		document.getElementById(module).style.display = 'none'
		document.getElementById(head).style.backgroundImage = 'url(/img/modarrow_closed_trans.gif)'
	}
}
