/*$(document).ready(function() {
$('#lft_mnu > li').hover(function(){
$(this).animate({paddingLeft:"50px", width:"200px", opacity:"0.5"}, 500);
},
function(){
$(this).animate({paddingLeft:"10px", width:"240px",opacity:"1"}, 500);
}
);
arrTemp = findPos(document.getElementById('acct_content'));
cntLft = arrTemp[0] + 100;
cntTop = arrTemp[1] + 50;
$('#flying_div1').css({left: cntLft+'px', top: cntTop+'px'});
$('#flying_div2').css({left: cntLft+'px', top: cntTop+'px'});
$('#flying_div3').css({left: cntLft+'px', top: cntTop+'px'});
setTimeout('$(\'#cnt_scroll\').animate({top: "-300px"}, 10000, function(){$(\'#cnt_scroll\').fadeOut(500, function(){$(\'#cnt_scroll\').css("top", "0px");$(\'#cnt_scroll\').fadeIn(500, function(){scrollContent();})});});', 2000);
//changeContent('Small Business', 1);
});
function scrollContent()
{
setTimeout('$(\'#cnt_scroll\').animate({top: "-210px"}, 20000, function(){$(\'#cnt_scroll\').fadeOut(500, function(){$(\'#cnt_scroll\').css("top", "0px");$(\'#cnt_scroll\').fadeIn(500, function(){scrollContent();})});});', 2000);
}*/
function changeContent(acctContent, acctTypeID)
{
oldAcctTypeID = document.getElementById('account_type_id').value;
if(oldAcctTypeID != 0)
{
$('#mnu_acct_type'+oldAcctTypeID).css({backgroundColor: "#111111"});
$('#mnu_acct_type'+oldAcctTypeID).css("color", "#00C4EA");
$('#mnu_acct_type'+oldAcctTypeID).css({paddingLeft:"10px", width:"240px",opacity:"1"});
$('#mnu_acct_type'+oldAcctTypeID).hover(function(){
$(this).css({backgroundColor: "#500005"});
$(this).css("color", "#FFFFFF");
$(this).animate({opacity:"0.6"}, 500);
},
function(){
$(this).css({backgroundColor: "#111111"});
$(this).css("color", "#00C4EA");
$(this).animate({paddingLeft:"10px", width:"240px",opacity:"1"}, 500);
}
);
}
$('#mnu_acct_type'+acctTypeID).css({backgroundColor: "#500005"});
$('#mnu_acct_type'+acctTypeID).css("color", "#FFFFFF");
$('#mnu_acct_type'+acctTypeID).css({ opacity:"0.6"});
$('#mnu_acct_type'+acctTypeID).hover(function(){
$(this).css({backgroundColor: "#500005"});
$(this).css("color", "#FFFFFF");
$(this).animate({opacity:"0.6"}, 500);
},
function(){
$(this).css({backgroundColor: "#500005"});
$(this).css("color", "#FFFFFF");
$(this).animate({opacity:"0.6"}, 500);
}
);
document.getElementById('account_type').value = acctContent;
document.getElementById('account_type_id').value = acctTypeID;
$('#acct_content').animate({opacity:"0"}, 500, function(){
$('#loader_blk').css("display", "block");
$.ajax({
type: "GET",
url: "get_feature_values.php",
data: "account_type_id="+acctTypeID+'&account_type='+acctContent,
success: function(msg){
$('#acct_content').html(msg);
$('#loader_blk').css("display", "none");
$('#acct_content').animate({opacity:"1"}, 500, function(){
})
}
});
//setTimeout('', 500);
});
}
function addToCompare()
{
compareIDs = document.getElementById('compare_ids').value;
accountTypeID = document.getElementById('account_type_id').value;
if(compareIDs != "")
{
arrIDs = compareIDs.split("|");
for(var i = 0; i < arrIDs.length; i++)
{
if(arrIDs[i] == accountTypeID)
{
alert("You have already chosen to add this Account Type to the comparision tray.\nPlease select a Account Type item to compare.");
return;
}
}
}
divIndex = parseInt(document.getElementById('num_items').value)+1;
if(divIndex > 3)
{
alert("You may only compare up to three (3) Account Types at a time.\n To compare another Account Type, you must remove an Account Type from the compare tray.");
return;
}
document.getElementById('num_items').value = (divIndex > 3)? 3: divIndex;
document.getElementById('compare_ids').value+= (compareIDs == "") ? accountTypeID: "|"+ accountTypeID;
arrTemp = findPos(document.getElementById('compare_item'+divIndex));
leftCord = arrTemp[0];
topCord = arrTemp[1];
$('#flying_div'+divIndex).css({backgroundColor: "#9F1E19", display: "block"});
$('#flying_div'+divIndex).html(document.getElementById('account_type').value);
$('#flying_div'+divIndex).stop();
$('#flying_div'+divIndex).animate({width:"300px", fontSize: "20px", opacity: "0.5"}, 500, function(){return;});
$('#flying_div'+divIndex).animate({left: leftCord+'px', top: topCord+'px', fontSize: "12pt", width:"140px", height:"70px"}, 500, function(){
$('#flying_div'+divIndex).css({backgroundColor: "#111111"});
$('#btn_remove'+divIndex).html('
');
animateDiv('flying_div'+divIndex);
});
}
function animateDiv(divName)
{
$('#'+divName).animate({opacity:"1"}, 1500, function(){
$('#'+divName).animate({opacity:"0.3"}, 1500, function(){animateDiv(divName)});
});
}
function removeItem(divIndex)
{
arrTemp = findPos(document.getElementById('acct_content'));
numItems = parseInt(document.getElementById('num_items').value);
compareIDs = document.getElementById('compare_ids').value;
accountTypeID = document.getElementById('account_type_id').value;
arrIDs = compareIDs.split("|");
document.getElementById('compare_ids').value = '';
for(var i = 0; i < arrIDs.length; i++)
{
if(i != (divIndex - 1))
{
document.getElementById('compare_ids').value+= (document.getElementById('compare_ids').value == "")? arrIDs[i]: "|"+arrIDs[i];
}
}
cntLft = arrTemp[0] + 100;
cntTop = arrTemp[1] + 50;
$('#flying_div'+divIndex).css({backgroundColor: "#9F1E19"});
$('#flying_div'+divIndex).stop();
$('#flying_div'+divIndex).animate({width:"200px", fontSize: "20px", opacity: "0.5"}, 500, function(){return;});
$('#flying_div'+divIndex).animate({left: cntLft+'px', top: cntTop+'px', fontSize: "14pt", width:"140px"}, 500, function(){
$('#flying_div'+divIndex).css("display", "none");
if(divIndex == 2 && numItems == 3)
{
$('#flying_div3')[0].id = 'flying_div2';
$('#flying_div2')[0].id = 'flying_div3';
$('#flying_div3').stop();
arrTemp = findPos(document.getElementById('compare_item2'));
$('#flying_div2').css({left: arrTemp[0]+'px', top: arrTemp[1]+'px'})
}
if(divIndex == 1)
{
if(numItems == 2 || numItems == 3)
{
$('#flying_div2')[0].id = 'flying_div1';
$('#flying_div1')[0].id = 'flying_div2';
$('#flying_div2').stop();
arrTemp = findPos(document.getElementById('compare_item1'));
$('#flying_div1').css({left: arrTemp[0]+'px', top: arrTemp[1]+'px'})
}
if(numItems == 3)
{
$('#flying_div3')[0].id = 'flying_div2';
$('#flying_div2')[0].id = 'flying_div3';
$('#flying_div3').stop();
arrTemp = findPos(document.getElementById('compare_item2'));
$('#flying_div2').css({left: arrTemp[0]+'px', top: arrTemp[1]+'px'})
}
}
document.getElementById('num_items').value = parseInt(document.getElementById('num_items').value) - 1;
resetRemoveBtns();
});
}
function resetRemoveBtns()
{
numItems = parseInt(document.getElementById('num_items').value);
switch(numItems)
{
case 1:
$('#btn_remove1').html('
');
$('#btn_remove2').html(' ');
$('#btn_remove3').html(' ');
break;
case 2:
$('#btn_remove1').html('
');
$('#btn_remove2').html('
');
$('#btn_remove3').html(' ');
break;
case 3:
$('#btn_remove1').html('
');
$('#btn_remove2').html('
');
$('#btn_remove3').html('
');
break;
default:
$('#btn_remove1').html(' ');
$('#btn_remove2').html(' ');
$('#btn_remove3').html(' ');
}
}
function compareResult()
{
if(document.getElementById('compare_ids').value == "")
{
alert("You must add at least one Account Type to compare.");
return;
}
$.ajax({
type: "GET",
url: "get_compare_result.php",
data: "acct_type_ids="+document.getElementById('compare_ids').value,
success: function(msg){
$('#compare_res').html(msg);
$('#compare_res').css("border", "1px solid #2C2C2C");
$('#compare_res').animate({top:"225px", height:"575px"}, 500);
}
});
}
function closeCompareResult()
{
$('#compare_res').animate({top:"800px", height:"0px"}, 500, function(){$('#compare_res').html('');$('#compare_res').css("border", "0px")});
}