function popUp(url){sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');self.name = "mainWin";}
function popUpBBB(url){sealWin=window.open(url,"winBBB",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=500');self.name = "mainWinBBB";}
function popUpVerisign(url){sealWin=window.open(url,"winVerisign",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=520,height=450');self.name = "mainWinVerisign";}
function popUpTrustwave(url){sealWin=window.open(url,"winVerisign",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=620,height=550');self.name = "mainWinVerisign";}
function popUpTRUSTe(url){sealWin=window.open(url,"winVerisign",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=750,height=550');self.name = "mainWinVerisign";}
function onChangeFormat(nProductFormat){var nProducts = document.frmEStore.nProducts.value;for(var n=1;n<=nProducts;n++){eval('document.frmEStore.selFormat_'+ n +'.selectedIndex = "'+ nProductFormat +'"');}document.frmEStore.nProductFormat.value = nProductFormat;}
function onEditPriorityCode(nIndex,strPriorityCode){document.getElementById("frmEStore").txtEditPriorityCodeIndex.value = nIndex;document.getElementById("frmEStore").txtEditPriorityCode.value = strPriorityCode;document.getElementById("frmEStore").cmdAction.value = 'Edit Priority Code';document.getElementById("frmEStore").submit();}
function onSubmit(strCmdAction,strTarget){						
	if (strCmdAction.indexOf("Check Out") != -1) {					
		document.getElementById("frmEStore").action = 'https://www.taxact.com/s_shopcart/FormToSession.asp';
		document.getElementById("frmEStore").target = strTarget;
		document.getElementById("frmEStore").submit();
	}else{
		document.getElementById("frmEStore").cmdAction.value = strCmdAction;
		document.getElementById("frmEStore").target = strTarget;
		document.getElementById("frmEStore").submit();
	}
}

function openFancybox(fancyURL,fancyWidth,fancyHeight){
	$.fancybox({
		'type':'iframe',
		'autoDimensions':false,
		'width':fancyWidth,
		'height':fancyHeight,
		'href':''+ fancyURL +''
	});
}

var personalOpen,preparersOpen,supportOpen,informationOpen,whyOpen;
function tabOptions(menu_name){
	if (menu_name == "personal"){
		if (preparersOpen == "yes"){
			preparersOpen = "";
			Effect.toggle('preparers_options', 'slide',{ duration: 0.3, afterFinish: function(){document.getElementById('tab_preparers').className = "preparers_closed";Effect.toggle('personal_options', 'slide',{ duration: 0.3, beforeStart: function(){togglePersonal();} });} });
		}else if (personalOpen == "yes"){
			Effect.toggle('personal_options', 'slide',{ duration: 0.3, afterFinish: function(){togglePersonal();} });
		}else{
			Effect.toggle('personal_options', 'slide',{ duration: 0.3, beforeStart: function(){togglePersonal();} });
		}
	}else if (menu_name == "preparers"){
		if (personalOpen == "yes"){
			personalOpen = "";
			Effect.toggle('personal_options', 'slide',{ duration: 0.3, afterFinish: function(){document.getElementById('tab_personal').className = "personal_closed";Effect.toggle('preparers_options', 'slide',{ duration: 0.3, beforeStart: function(){togglePreparers();}  });} });
		}else if (preparersOpen == "yes"){
			Effect.toggle('preparers_options', 'slide',{ duration: 0.3, afterFinish: function(){togglePreparers();} });
		}else{
			Effect.toggle('preparers_options', 'slide',{ duration: 0.3, beforeStart: function(){togglePreparers();} });
		}
	}
}
function togglePersonal(){
	if (personalOpen == "yes"){
		personalOpen = "";
		document.getElementById('tab_personal').className = "personal_closed";
	}else{
		personalOpen = "yes";
		document.getElementById('tab_personal').className = "personal_open";
	}
}
function togglePreparers(){
	if (preparersOpen == "yes"){
		preparersOpen = "";
		document.getElementById('tab_preparers').className = "preparers_closed";
	}else{
		preparersOpen = "yes";
		document.getElementById('tab_preparers').className = "preparers_open";
	}
}
function toggleReturning(){
	if (document.getElementById('returning_users').className == "returning_closed"){
		document.getElementById('returning_users').className = "returning_open";
	}else{
		document.getElementById('returning_users').className = "returning_closed";
	}
}

function reloadImage(imgId) {
  cpt_ImgId = cpt_Img = cpt_NewImg = cpt_Parent = cpt_ImagePrompt = null;
  if (imgId) {
    cpt_ImgId = imgId;
    cpt_Img = document.getElementById(cpt_ImgId);
    var src = cpt_Img.src;

    var d = new Date();
    var i = src.indexOf('&t=');
    if (-1 != i) {
      src = src.substring(0, i);
    }
    var newSrc = src + '&t=' + d.getTime();

    cpt_NewImg = document.createElement('img');
    cpt_NewImg.onload = showImage;
    cpt_NewImg.id = cpt_Img.id;
    cpt_NewImg.alt = cpt_Img.alt;
    cpt_NewImg.src = newSrc;

    cpt_ImagePrompt = document.createElement('span');
    cpt_ImagePrompt.appendChild(document.createTextNode('loading...'));

    cpt_Parent = cpt_Img.parentNode;
    cpt_Parent.removeChild(cpt_Img);
    cpt_Parent.appendChild(cpt_ImagePrompt);
  }
}

function showImage() {
  if (cpt_NewImg && cpt_Parent && cpt_ImagePrompt) {
    cpt_Parent.removeChild(cpt_ImagePrompt);
    cpt_Parent.appendChild(cpt_NewImg);
  }
}

function iframe_loaded(frameSource) {
	src = document.getElementById(frameSource).src
	if ($('#'+ frameSource).attr('src') == ''){
		//alert("iframe was loaded with no content");
	}else{
		calcHeight(frameSource,0);
	}
}
var frameSource,bRetry;
var timerCalcHeight = null;
function calcHeight(frameSource,bRetry){
	//alert('calcHeight');
	var the_height = 1;
	
	//find the height of the internal page
	var mainbodyFrame = document.getElementById(frameSource);
	
	if (mainbodyFrame) {
		try {
			if (mainbodyFrame.contentDocument &&
				mainbodyFrame.contentDocument.body &&
				mainbodyFrame.contentDocument.body.scrollHeight){ // DOM
				the_height = mainbodyFrame.contentDocument.body.scrollHeight;
				if (timerCalcHeight != null) {window.clearTimeout(timerCalcHeight); timerCalcHeight=null;}
			} else if (mainbodyFrame.contentWindow &&
				      mainbodyFrame.contentWindow.document &&
					  mainbodyFrame.contentWindow.document.body &&
					  mainbodyFrame.contentWindow.document.body.scrollHeight){ // IE win
			    mainbodyFrame.contentWindow.document.body.scrollHeight; // IE scrollHeight hack
				the_height = mainbodyFrame.contentWindow.document.body.scrollHeight;
				if (timerCalcHeight != null) {window.clearTimeout(timerCalcHeight); timerCalcHeight=null;}
			} else {
			    if (timerCalcHeight == null) {
			        timerCalcHeight = window.setTimeout('calcHeight(1, 1)', 2000);
			    }
		    }
		}
		catch(e) {}

        if ((bRetry == 1) && (timerCalcHeight != null)) {window.clearTimeout(timerCalcHeight); timerCalcHeight=null;}
			
		
        //change the height of the iframe
		mainbodyFrame.height = the_height + 20;
	}
}

var currentTab = 'std';
function changeTab(tab){
	if (tab == 'std'){
		if (currentTab == 'dlx'){
			$("#slide_products").animate({left: '+=929px'}, 'slow');
			document.getElementById('home_tab_dlx').className = 'home_tab_off';
			document.getElementById('home_tab_std').className = 'home_tab_on';
		}else if (currentTab == 'ult'){
			$("#slide_products").animate({left: '+=1858px'}, 'slow');
			document.getElementById('home_tab_ult').className = 'home_tab_off';
			document.getElementById('home_tab_std').className = 'home_tab_on';
		}
		currentTab = 'std';
	}else if (tab == 'dlx'){
		if (currentTab == 'std'){
			$("#slide_products").animate({left: '-=929px'}, 'slow');
			document.getElementById('home_tab_std').className = 'home_tab_off';
			document.getElementById('home_tab_dlx').className = 'home_tab_on';
		}else if (currentTab == 'ult'){
			$("#slide_products").animate({left: '+=929px'}, 'slow');
			document.getElementById('home_tab_ult').className = 'home_tab_off';
			document.getElementById('home_tab_dlx').className = 'home_tab_on';
		}
		currentTab = 'dlx';
	}else if (tab == 'ult'){
		if (currentTab == 'std'){
			$("#slide_products").animate({left: '-=1858px'}, 'slow');
			document.getElementById('home_tab_std').className = 'home_tab_off';
			document.getElementById('home_tab_ult').className = 'home_tab_on';
		}else if (currentTab == 'dlx'){
			$("#slide_products").animate({left: '-=929px'}, 'slow');
			document.getElementById('home_tab_dlx').className = 'home_tab_off';
			document.getElementById('home_tab_ult').className = 'home_tab_on';
		}
		currentTab = 'ult';
	}
}
