﻿var numItems;
var currItem = 0;

$(document).ready(function() {

	//$("iframe:not(#iUnSupported)").remove();

	var so = new SWFObject("/media/dwHeaders.swf", "csSWF", "862", "234", "9.0.28", "#1a1a1a");
	so.addParam("quality", "best");
	so.addParam("allowFullScreen", "false");
	so.addParam("scale", "showall");
	so.addParam("allowScriptAccess", "always");
	so.addParam("wmode", "transparent");
	so.addVariable("autostart", "true");
	so.write("imageWrap");

	$(".clientMap").colorbox({ iframe: true, width: "858px", height: "615px", title: "Client Portfolio Map", rel: "nofollow" });

	$(".modalBox").colorbox({
	title: function() {
		var url = $(this).attr('title');
		if (url != "") {
			if (url.match("www."))
				return "<a href='http://" + url + "' target='_blank'>Visit Website</a>";
			else
				return url;
		}
		else
			return '';
	},
	slideshow: true,
	rel: 'nofollow'
});

$(".thickbox").colorbox({
	title: function() {
		var url = $(this).attr('title');
		if (url != "") {
			if (url.match("www."))
				return "<a href='http://" + url + "' target='_blank'>Visit Website</a>";
			else
				return url;
		}
		else
			return '';
	},
	slideshow: true,
	rel: 'port'
});

var first = 0;
var speed = 600;
var pause = 7000;

function removeFirst() {
	first = $('#topMessage ul li:first').html();
	$('#topMessage ul li:first')
.animate({ opacity: 0 }, speed)
.fadeOut('slow', function() { $(this).remove(); });
	addLast(first);
}
function addLast(first) {
	last = '<li>' + first + '</li>';
	$('#topMessage ul').append(last);
	$('#topMessage ul li:last')
.animate({ opacity: 1 }, speed)
.fadeIn('slow');
}

interval = setInterval(removeFirst, pause);
});


function newWindow(path, w, h) {
	var height = h;
	var width = w;
	var scroll = 1;
	var wleft = (screen.width - width - 20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(path, 'newWin', 'fullscreen=0,scrollbars=' + scroll + ',height=' + height + ',width=' + width + ',top=' + wtop + ',left=' + wleft + '');
}
