function showHide(id){	content = document.getElementById(id);	if(content.style.display == "block") content.style.display = "none";	else content.style.display = "block";}function showMug(name, li){		document.getElementById("mugshot").src = document.getElementById(name+"Pic").src;		//document.getElementById("mugshot").src = "images/"+name+".jpg";		document.getElementById("mugshotThumbnail").style.top = document.getElementById(li).offsetTop+27+"px";		document.getElementById("mugshotThumbnail").style.visibility = "visible";}function hideMug(){	document.getElementById("mugshotThumbnail").style.visibility = "hidden";} function deselectMe(){	if(nowShowing){		document.getElementById(nowShowing).style.backgroundColor = "transparent";		document.getElementById(nowShowing).style.borderColor = "transparent";		if(document.getElementById(nowShowing).childNodes[1]) document.getElementById(nowShowing).childNodes[1].style.color = "#333";		//else document.getElementById(nowShowing).firstChild.style.color = "black";	}}function selectMe(selected){		document.getElementById(selected).style.backgroundColor = document.styleSheets[0].cssRules[0].style.backgroundColor;		document.getElementById(selected).style.borderColor = document.styleSheets[0].cssRules[0].style.borderBottomColor;		document.getElementById(selected).style.borderRightColor = "transparent";				if(document.getElementById(selected).childNodes[1]) document.getElementById(selected).childNodes[1].style.color = "black";		else document.getElementById(selected).firstChild.style.color = "black";		nowShowing = selected;}function liOver(selected){	if(document.getElementById(selected).style.borderBottomColor != document.styleSheets[0].cssRules[0].style.borderBottomColor){		document.getElementById(selected).style.backgroundColor = document.styleSheets[0].cssRules[0].style.borderBottomColor;	if(document.getElementById(selected).childNodes[1] && document.getElementById(selected).childNodes[1].style.color != "black") document.getElementById(selected).childNodes[1].style.color = "white";	else document.getElementById(selected).firstChild.style.color = "white";			}}function liOff(selected){	if(document.getElementById(selected).style.borderBottomColor != document.styleSheets[0].cssRules[0].style.borderBottomColor){		document.getElementById(selected).style.backgroundColor = "transparent";	document.getElementById(selected).style.borderColor = "transparent";	if(document.getElementById(selected).childNodes[1] && document.getElementById(selected).childNodes[1].style.color != "black") document.getElementById(selected).childNodes[1].style.color = "#333";	else document.getElementById(selected).firstChild.style.color = "black";	}}function ajax(file){   if (window.XMLHttpRequest) {         req = new XMLHttpRequest();               //HANDLER		 req.onreadystatechange = function checkState(){				  }		 		  req.open("GET", file, true);		  req.send(null);     // branch for IE/Windows ActiveX version    } else if (window.ActiveXObject) {        req = new ActiveXObject("Microsoft.XMLHTTP");        if (req) {             req.onreadystatechange = function checkState(){		 				 }			req.open("GET", file, true);            req.send();        }    }}function resizeGreyBox(width, height){	resizer = setInterval("resizeGrey("+width+", "+height+")", 20);}function positionWhite(){	greyWidth = document.getElementById('Grey').offsetWidth;	greyLeft = document.getElementById('Grey').offsetLeft;	whitePosition = greyWidth+greyLeft+"px";	document.getElementById('White').style.left = whitePosition;	}	function resizeGrey(maxwidth){	currentWidth = document.getElementById("Grey").offsetWidth;		if (currentWidth != maxwidth){		document.getElementById("Grey").style.width = currentWidth + ((maxwidth - currentWidth)/3) + "px";			}		if ((currentWidth >= (maxwidth - 10)) && (currentWidth <= (maxwidth + 10))){ 				document.getElementById("Grey").style.width = maxwidth+"px";		clearInterval(resizer);		getGoodies = setInterval("displayReq('Grey')", 20);	}}function fitGreyToWindow(){	currentHeight = document.getElementById("Grey").offsetHeight;	targetHeight = window.innerHeight - document.getElementById("Grey").offsetTop - 2;		if (currentHeight != targetHeight){				document.getElementById("Grey").style.height = currentHeight + ((targetHeight - currentHeight)/5) + "px";			}		if ((currentHeight >= (targetHeight - 10)) && (currentHeight <= (targetHeight + 10))){ 				document.getElementById("Grey").style.height = targetHeight+"px";		clearInterval(fitTo);	}	}function displayReq(column){	if(req.readyState == 4){			document.getElementById(column).innerHTML = req.responseText;		clearInterval(getGoodies);				if(column == "Grey"){ 			greyLoaded = true;			if(document.getElementById("Grey").offsetHeight < window.innerHeight){				fitTo = setInterval("fitGreyToWindow()", 20);							}		}		else {			whiteLoaded = true;			disableWhite = false;			}			}	}function loadGrey(kind, num, dontReturn, thumbs, sortby){	document.getElementById("Grey").innerHTML = '<div id="loader"><object classid="oodaloader" width="40" height="22"><param name="movie" value="loaderGrey.swf"><param name="quality" value="high"><embed src="loaderGrey.swf" quality="high" bgcolor="#dddddd" type="application/x-shockwave-flash" width="40" height="22"></embed></object></div>';	document.getElementById("Grey").style.height = "auto";	if(!sortby) sortby = 'date';		if(thumbs){ 		ajax('loadProjectGrey.php?projectdomid='+kind+'&page='+num);		resizeGreyBox(projectGreyWidth);			}	else if(kind == 'words'){		ajax('loadWordsGrey.php?author='+head_line+'&page='+num+'&sortby='+sortby);		resizeGreyBox(projectGreyWidth);	}	else if(num) {		ajax(kind+'Grey.php?page='+num+'&sortby='+sortby); 		newwidth = eval(kind+"GreyWidth");		resizeGreyBox(newwidth);		}	else{ 		ajax('loadProjectGrey.php?projectdomid='+kind+'&sortby='+sortby);		resizeGreyBox(projectGreyWidth);			}		if(!dontReturn)	return true;}function loadWhite(kind, num, project){	if(!disableWhite){		disableWhite = true;		document.getElementById("White").innerHTML = '<div id="loader"><object classid="oodaloader" width="40" height="22"><param name="movie" value="loaderWhite.swf"><param name="quality" value="high"><embed src="loaderWhite.swf" quality="high" bgcolor="#ffffff" type="application/x-shockwave-flash" width="40" height="22"></embed></object></div>';				document.getElementById('White').style.visibility = "visible";		if(project) ajax('loadProjectWhite.php?projectdomid='+kind+'&image='+num);				else ajax(kind+'White.php?page='+num);				getGoodies = setInterval("displayReq('White')", 20);	}	}function loadVideo(num){    document.getElementById("White").innerHTML = '<div id="loader"><object classid="oodaloader" width="40" height="22"><param name="movie" value="loaderWhite.swf"><param name="quality" value="high"><embed src="loaderWhite.swf" quality="high" bgcolor="#ffffff" type="application/x-shockwave-flash" width="40" height="22"></embed></object></div>';	if(num) ajax('loadVideo.php?id='+num);	getGoodies = setInterval("displayReq('White')", 20);}function loadWords(num){    document.getElementById("White").innerHTML = '<div id="loader"><object classid="oodaloader" width="40" height="22"><param name="movie" value="loaderWhite.swf"><param name="quality" value="high"><embed src="loaderWhite.swf" quality="high" bgcolor="#ffffff" type="application/x-shockwave-flash" width="40" height="22"></embed></object></div>';	if(num) ajax('loadWords.php?id='+num);	getGoodies = setInterval("displayReq('White')", 20);}function loadAudio(num){    document.getElementById("White").innerHTML = '<div id="loader"><object classid="oodaloader" width="40" height="22"><param name="movie" value="loaderWhite.swf"><param name="quality" value="high"><embed src="loaderWhite.swf" quality="high" bgcolor="#ffffff" type="application/x-shockwave-flash" width="40" height="22"></embed></object></div>';	if(num) ajax('loadAudio.php?id='+num);	getGoodies = setInterval("displayReq('White')", 20);}function isGreyLoaded(kind, num, project){	if(greyLoaded == true){		clearInterval(waitingOnGrey);				if(kind != 'words') selectMe(kind);		else selectMe('author'+author_selected);		positionWhite();		if(project)loadWhite(kind, num, true);		else loadWhite(kind, num, false);	}}function isWhiteLoaded(headline, margin){	if(whiteLoaded == true){		clearInterval(waitingOnWhite);		getPlaceHeadline(headline, margin);		loadStarted == false;			}}function getPlaceHeadline(headline, headlineMargin){	document.getElementById('Headline').innerHTML = headline;	if(document.getElementById('Headline').offsetLeft != document.getElementById('White').offsetLeft){		if (headlineMargin){ 		margin = document.getElementById('White').offsetLeft - (document.getElementById('titleImage').offsetLeft + document.getElementById('titleImage').offsetWidth) + headlineMargin;		}		else margin = document.getElementById('White').offsetLeft - (document.getElementById('titleImage').offsetLeft + document.getElementById('titleImage').offsetWidth);		document.getElementById('Headline').style.left = margin + "px";	}	document.getElementById('Headline').style.visibility = "visible";}function hideAll(){	document.getElementById("Grey").style.visibility = "hidden";	document.getElementById("White").style.visibility = "hidden";	document.getElementById("Headline").style.visibility = "hidden";	document.getElementById("Grey").innerHTML = null;	document.getElementById("Grey").style.height = "auto";	document.getElementById("contactNav").style.display = "none";	document.getElementById("projectsNav").style.display = "none";	deselectMe();}function loadScript(kind, headline, margin, project){	head_line = headline;	if (greyLoaded && whiteLoaded){	clearInterval(fitTo);	document.getElementById("Grey").style.visibility = "visible";	deselectMe();	document.getElementById("Grey").style.height = "auto";	loadStarted = true;	greyLoaded = false;	whiteLoaded = false;	document.getElementById('White').style.visibility= "hidden";	document.getElementById('Headline').style.visibility = "hidden";				if(project){			if(loadGrey(kind)){				waitingOnGrey = setInterval("isGreyLoaded('"+kind+"', '0', true)", 100);				waitingOnWhite = setInterval("isWhiteLoaded('"+headline+"', "+margin+")", 100);			}		}		else{			if(loadGrey(kind, '0')){				waitingOnGrey = setInterval("isGreyLoaded('"+kind+"', '0', false)", 100);				waitingOnWhite = setInterval("isWhiteLoaded('"+headline+"', "+margin+")", 100);			}		}		}}function insertLink(){document.postPublic.mainText.value += '<a href=\"'+document.linkForm.URL.value+'\" target="_blank">'+document.linkForm.link.value+'</a>';}function publish(){	if(document.forms['postPublic'].authorname.value &&  document.forms['postPublic'].title.value &&  document.forms['postPublic'].authorname.value != "AUTHOR" &&  document.forms['postPublic'].title.value != "HEADLINE"){				document.postPublic.dopublish.value = true;    	document.forms['postPublic'].submit();		//loadScript('news', 'NEWS | POST');	}	else{ 	document.postPublic.postButton.disabled = false; 	document.postPublic.postButton.value = 'POST';	alert("You must enter your name and a headline.");	return false;	}}/*function publishWords(){	if(document.forms['postWords'].authorname.value &&  document.forms['postWords'].title.value &&  document.forms['postWords'].authorname.value != "AUTHOR" &&  document.forms['postWords'].title.value != "TITLE"){				document.postWords.dopublish.value = true;    	document.forms['postWords'].submit();	}		else{ 		document.postWords.postButton.disabled = false; 		document.postWords.postButton.value = 'POST';		alert("You must enter your name and a title.");		return false;	}}*/var author_selected = 0;var fitTo;var disableWhite = false;var nowShowing;var resizer;var getGoodies;var greyLoaded = true;var whiteLoaded = true;var head_line = '*';newsGreyWidth = 316;aboutGreyWidth = 250;calendarGreyWidth = 465;projectGreyWidth = 188;