
	// try preloading images
	var image1 = new Image();
	var image2 = new Image();
	image1.src = '/img/gui/contactoverlay.png';
	image2.src = '/img/gui/contactoverlay.gif';

	function hidecontactoverlay() {
	
		document.getElementById('contactoverlay').style.display = 'none';
	
	}
	
	function showcontactoverlay() {
	
		document.getElementById('contactoverlay').style.display = 'block';
		initImage('contactoverlay');
	
	}
	
	function setOpacity(obj, opacity) {
	  opacity = (opacity == 100)?99.999:opacity;
	  
	  // IE/Win
	  obj.style.filter = "alpha(opacity:"+opacity+")";
	  
	  // Safari<1.2, Konqueror
	  obj.style.KHTMLOpacity = opacity/100;
	  
	  // Older Mozilla and Firefox
	  obj.style.MozOpacity = opacity/100;
	  
	  // Safari 1.2, newer Firefox and Mozilla, CSS3
	  obj.style.opacity = opacity/100;
	}
	
	function fadeIn(objId,opacity) {
	  if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 95) {
		  setOpacity(obj, opacity);
		  opacity += 5;
		  window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 20);
		}
	  }
	}
	
	function initImage(imageId) {
	  image = document.getElementById(imageId);
	  setOpacity(image, 0);
	 /* image.style.visibility = 'visible';*/
	  fadeIn(imageId,0);
	}
	
	function hideportfoliopopup() {

		document.getElementById('portfoliopopup').style.display = 'none';
	
	}
	
	function showportfoliopopup() {
	
		document.getElementById('portfoliopopup').style.display = 'block';
	
	}
	
	////////// home feature

	var numfeatured = 5;
	var currentfeature = 1;
	
	var featureurls = [];
	featureurls[ 0 ] = '/business/anthonys-restaurant';
	featureurls[ 1 ] = '/creatives/omar-kashoura';
	featureurls[ 2 ] = '/business/first-response-team';
	featureurls[ 3 ] = '/userdriven/the-computing-directory';
	featureurls[ 4 ] = '/business/event-feedback';
	
	function showfeature() {
	
		document.getElementById('homefeaturecontent').style.display = 'none';
		document.getElementById('featureloading').style.display = 'block';
		
		document.getElementById( 'sitetop' ).src = '/img/feature/sitetop_' + currentfeature + '.jpg';
		document.getElementById( 'sitebottom' ).src = '/img/feature/sitebottom_' + currentfeature + '.jpg';
		document.getElementById( 'main' ).src = '/img/feature/main_' + currentfeature + '.jpg';
		document.getElementById( 'company' ).src = '/img/feature/company_' + currentfeature + '.jpg';
		
		setTimeout( "redrawfeature();", 1000); 
	
	}
	
	function redrawfeature() {
	
		document.getElementById('homefeaturecontent').style.display = 'block';
		document.getElementById('featureloading').style.display = 'none';
		document.getElementById('readmore').href = '/portfolio' + featureurls[ currentfeature - 1 ] + '.html';
	
	}
	
	function featureportprev() {
	
		if( currentfeature == 1 ) {
		
			currentfeature = numfeatured;
		
		}
		else {
		
			currentfeature --;
		
		}
		
		showfeature();
	
	}
	
	function featureportnext() {
	
		if( currentfeature == numfeatured ) {
		
			currentfeature = 1;
		
		}
		else {
		
			currentfeature ++;
		
		}
	
		showfeature();
	
	}

	///////// end of home feature
	
	
///////////////////// portfolio AJAX ///////////////////////

	/* Create a new XMLHttpRequest object to talk to the Web server */
	var xmlHttp2 = false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
	  xmlHttp2 = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	  try {
		xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (e2) {
		xmlHttp2 = false;
	  }
	}
	@end @*/
	
	if( !xmlHttp2 && typeof XMLHttpRequest != 'undefined' ) {
	
		xmlHttp2 = new XMLHttpRequest();
	  
	}
					
	function callServerPort( jobid, jobtitle ) {
	
		document.getElementById( "portpopupajax" ).innerHTML = '<div class="center" style="padding-top: 10px;"><img src="/img/gui/popuploader.gif" alt=""></div>';
		
		// Build the URL to connect to
		var url = "/portfoliopopajax.php?jobid=" + escape( jobid ) + '&jobtitle=' + escape( jobtitle );
		
		// Open a connection to the server
		xmlHttp2.open( "GET", url, true );
		
		// Setup a function for the server to run when it's done
		xmlHttp2.onreadystatechange = displayportsummary;
		
		// Send the request
		xmlHttp2.send( null );
	  
	}
	
	function cancelCall() {
	
		xmlHttp2.abort();
	
	}
	
	function displayportsummary() {
	
		if( xmlHttp2.readyState == 4 ) {
		
			var response = xmlHttp2.responseText;
			eval( response );
			
			// do nothing?
		
		}
	  
	}
