document.onload = init();
var n = 1;

function init()
{
	if (document.getElementById)
	{
		setTimeout("InitializeBlink()", 3000);
	}
}

function InsertNotice(str,url)
{
	if (confirm(str))
	{
		window.location = url;
	}
}

function InitializeBlink()
{
	if (document.getElementById("blink1"))
	{
		var elem = document.getElementById("blink1");
		//elem.style.padding = "1px";
		elem.style.borderBottom = "3px dotted gold";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted gold";
		elem.style.borderLeft = "1px none";
		BlinkText();
	}
}

function BlinkText()
{
	Sparkle();
	setTimeout("BlinkText()", 100);
}

function Sparkle()
{
	var elem = document.getElementById("blink1");
	
	n++;
	if (n == 15)
	{
		n = 1;
	}
	else if (n == 14)
	{
		elem.style.borderBottom = "3px dotted #ff9900";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ff9900";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 13)
	{
		elem.style.borderBottom = "3px dotted #ff9933";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ff9933";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 12)
	{
		elem.style.borderBottom = "3px dotted #ffcc66";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffcc66";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 11)
	{
		elem.style.borderBottom = "3px dotted #ffff00";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffff00";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 10)
	{
		elem.style.borderBottom = "3px dotted #ffff66";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffff66";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 9)
	{
		elem.style.borderBottom = "3px dotted #ffffcc";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffffcc";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 8)
	{
		elem.style.borderBottom = "3px dotted #ffffff";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffffff";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 7)
	{
		elem.style.borderBottom = "3px dotted #ffffcc";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffffcc";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 6)
	{
		elem.style.borderBottom = "3px dotted #ffff66";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffff66";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 5)
	{
		elem.style.borderBottom = "3px dotted #ffff00";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffff00";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 4)
	{
		elem.style.borderBottom = "3px dotted #ffcc66";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ffcc66";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 3)
	{
		elem.style.borderBottom = "3px dotted #ff9933";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ff9933";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 2)
	{
		elem.style.borderBottom = "3px dotted #ff9900";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted #ff9900";
		elem.style.borderLeft = "1px none";
	}
	else if (n == 1)
	{
		elem.style.borderBottom = "3px dotted gold";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted gold";
		elem.style.borderLeft = "1px none";
	}
	else
	{
		elem.style.borderBottom = "3px dotted red";
		elem.style.borderRight = "1px none";
		elem.style.borderTop = "3px dotted red";
		elem.style.borderLeft = "1px none";
	}
}

function ShowNotAvailable()
{
	alert("Not available.");
}

function ShowUnavailable()
{
	alert("Coming soon...");
}

function ShowChooseState()
{
	var strDest = window.location.href;
	while (strDest.indexOf("/") != -1)
	{
		strDest = strDest.substring(strDest.indexOf("/") + 1);
	}
	if (strDest.indexOf("?") != -1)
		strDest = strDest.substring(0, strDest.indexOf("?"));
	if (confirm("You must first select your state to view this link.\r\nDo you wish to do so now?"))
		window.location = "maplocation.aspx?dest=" + strDest;
}

function CheckState()
{
	
}

function GetCopyrightText()
{
	var dt = new Date();
	var year = dt.getFullYear();
	var str = "Copyright &copy; " + year + " asashopmedicalplan.org";
	return str;
}

// shadow.js
//------------------------------------------------------------
// Description:
//    Shadow.js is a collection of functions for displaying 
//    a shadow effect around an html object
// Functions:
//    ShowRectangularDynamicDropShadow(elem, color, size)
//    HideRectangularDynamicDropShadow(elem)
//    MakeRectangularStaticDropShadow(elem, color, size)
//------------------------------------------------------------


var global = window.document
global.fo_currentMenu = null
global.fo_shadows = new Array


//------------------------------------------------------------
// ShowRectangularDynamicDropShadow
//------------------------------------------------------------
function ShowRectangularDynamicDropShadow(elem, color, size) {
  if (global.fo_currentMenu == null) {
    global.fo_currentMenu = elem;
    var i;
    for (i=size; i>0; i--) {
      var rect = document.createElement('div');
      var rs = rect.style
      rs.position = 'absolute';
      rs.left = (elem.style.posLeft + 1 + 2*i) + 'px';
      rs.top = (elem.style.posTop + 1 + 2*i) + 'px';
      rs.width = (elem.offsetWidth - 1 - i) + 'px';
      rs.height = (elem.offsetHeight  - 1 - i) + 'px';
      rs.zIndex = elem.style.zIndex - i;
      rs.backgroundColor = color;
      var opacity = 1 - i / (i + 1);
      rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
      elem.insertAdjacentElement('afterEnd', rect);
      global.fo_shadows[global.fo_shadows.length] = rect;
    }
  }
}

//------------------------------------------------------------
// HideRectangularDynamicDropShadow
//------------------------------------------------------------
function HideRectangularDynamicDropShadow(elem) {
  if (global.fo_currentMenu) {
    var i
    for (i=0; i<global.fo_shadows.length; i++)
      global.fo_shadows[i].removeNode(true);
    global.fo_shadows = new Array();
    global.fo_currentMenu = null;
  }
}

//------------------------------------------------------------
// MakeRectangularStaticDropShadow
//------------------------------------------------------------
function MakeRectangularStaticDropShadow(elem, color, size) {
  var i;
  for (i=size; i>0; i--) {
    var srect = document.createElement('div');
    var srs = srect.style
    srs.position = 'absolute';
    srs.left = (elem.offsetLeft + i) + 'px';
    srs.top = (elem.offsetTop + i) + 'px';
    srs.width = elem.offsetWidth + 'px';
    srs.height = elem.offsetHeight + 'px';
    srs.zIndex = elem.style.zIndex - i;
    srs.backgroundColor = color;
    var opacity = 1 - i / (i + 1);
    srs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
    elem.insertAdjacentElement('afterEnd', srect);
  }
}

//------------------------------------------------------------
// MakeRectangularStaticDropShadow2
//------------------------------------------------------------
function MakeRectangularStaticDropShadow2(elem, color, size) {
  if (window.navigator.appName.indexOf("Netscape") != -1 && 
parseInt(window.navigator.appVersion) < 5)
    return ('');
  else {
    var i;
    var strOut = '';
    for (i=size; i>0; i--) {
      var zIndx = elem.style.zIndex - i
      var opacity = 1 - i / (i + 1);
      strOut += '<div style="position:absolute; left:' 
             + (elem.offsetLeft + i) + 'px; top:'
             + (elem.offsetTop + i) + 'px; width:'
             + elem.offsetWidth + 'px; height:'
             + elem.offsetHeight + 'px; z-index:'
             + zIndx + '; background:' + color
             + 'filter:alpha(opacity=' + (100 * opacity) + ')"></div>';
    }
    return (strOut);
  }
}

function ShowPopup(strUrl) {

    var str = '<table cellspacing="1" cellpadding="2" style="background:black"><tr>';
    str += '<td style="background:#ffeccc" width="460">';
    str += '<table cellspacing="0" cellpadding="2" width="100%"><tr>';
    str += '<td align="right"><a href="javascript:HidePopup();">Close</a></td>';
    str += '</tr><tr>';
    str += '<td align="center">';
    str += 'TODAY- ASA members can get medical insurance quotes and buy quality, affordable ';
    str += 'medical insurance group plans through Benefit Consultants Northwest (BCNW).<br/><br/>';
    str += '<a href=\"' + strUrl + '\">Click here for Quotes, Medical plan information and plan selections.</a><br/>';
    str += '<a href=\"' + strUrl + '\"><img src="images/bcnw_logo3.gif" width="186" height="60" border="0" /></a><br/>';
    str += 'Automotive Industry Health Insurance Trust (A-HIT) association medical plans ';
    str += 'are not currently available in this state.<br/><br/>';
    str += '</td></tr></table></td></tr></table>';

    if (document.getElementById) {
        var elem = document.getElementById("popupDiv");
        elem.innerHTML = str;
        elem.style.display = "block";
        ShowRectangularDynamicDropShadow(elem, "#333333", 5);
    }
}

function HidePopup() {
    if (document.getElementById) {
        var elem = document.getElementById("popupDiv");
        HideRectangularDynamicDropShadow(elem);
        elem.style.display = "none";
        elem.innerhtml = "";
    }
}