/**
 * @author dee 2/8/2007
 */
var numPostcards = 8;
function startPostcardCycle(useFade) {
	if (useFade==1)
		setTimeout("postcardFadeout()",30000);
	else
		setTimeout("changePostCard(true)",30000);
}
function changePostCard(reschedule) {
	var src = $("postcard").src;
	var len = src.lastIndexOf(".");
	var basesrc = src.substr(0,len);
	var newnum = (Number(basesrc.slice(-2)))%8+1;
	var newsrc = basesrc.substr(0,len-2)+"0"+newnum+".gif";
	var tag = postCardTag(newnum);
	$("postcard").src = newsrc;
	$("tagline").innerHTML=tag;
	if (reschedule==1) {
		setTimeout("changePostCard(true)",30000);
		}
}
function postCardTag(card) {
	switch (card) {
default:
		tag = "";
		break;
case 1: // table
		tag = "Let us show you what we can bring to bear on your benefits problems";
		break;
case 2: // soar
		tag = "We'll impress you with our inventive approach to Employee Benefit Administration";
		break;
case 3: // hide
		tag = "There's a better way to manage your employee benefits";
		break;
case 4: // shock
		tag = "Don't pull the plug! Let our creative staff help you with all your insurance needs";
		break;
case 5: // loyalty
		tag = "Look no further. We'll be with you every step of the way";
		break;
case 6: // mighty
		tag = "Bigger isn't always better. Check out what we can do for you";
		break;
case 7: // drought
		tag = "Original and customized Benefit Administration strategies for groups of all sizes";
		break;
case 8: // fierce
		tag = "Formidable Health Insurance Agents, with better information, better service, better solutions";
		break;
	}
	return tag;
}
/*
 *  The fadein/fadeout stuff looks hokey. Just changing the
 *  postcard looks a lot better, I think.
 *
 */
var postcardOpacity = 10;
function postcardFadeout() {
	postcardOpacity -= 1;
	$("postcard").style.filter="Alpha(opacity="+(postcardOpacity*10)+")";
	$("postcard").style.opacity = (postcardOpacity/10);
	if (postcardOpacity <= 0) {
		changePostCard(false);
		postcardOpacity = 0;
		setTimeout("postcardFadein()",150);
		return;
	}
	setTimeout("postcardFadeout()",90);
}
function postcardFadein() {
	postcardOpacity += 1;
	$("postcard").style.filter="Alpha(opacity="+(postcardOpacity*10)+")";
	$("postcard").style.opacity = (postcardOpacity/10);
	if (postcardOpacity >= 10) {
		postcardOpacity = 10;
		setTimeout("postcardFadeout()",30000);
		return;
	}
	setTimeout("postcardFadein()",90);
}
function setiframesize(mainhtmlobj,iframeobj,framewidth) {
	var frameobj = $(iframeobj);
	var htmlobj = $(mainhtmlobj);
	var contentdoc;
	var windowHeight = 522; // was 552, subtract 30 for google toolbar
	var frameddocheight;
	if (frameobj) {
		if (htmlobj) {
			frameobj.height = (windowHeight - htmlobj.offsetHeight);
			}
		else
			frameobj.height = windowHeight;
	}
	frameobj.style.width = framewidth+"px";
	return 0;
}
function setwidth(contentobject,width) {
	var content = $(contentobject);
	width = width+"px"
	content.style.width = width
}
function changeiFrame(iFrameObj,url) {
	var ifobj = $(iFrameObj);
	if (ifobj) {
		ifobj.src = url;
		return false;
	}
	return url;
}
