$(document).ready(function()
{
	$(function ()
	{
		// img post loading
		var img = new Image();
		
		$(img).load(function ()
		{
			$("#splash").css('background','url("/images/splash_bn.jpg") no-repeat');
		}).attr('src', '/images/splash.jpg');
		
		img = new Image();
		$(img).load(function ()
		{
			$("#splashSh").css('background','url("/images/splash_sh_bn.jpg") no-repeat');
			$("#splashSh").animate({ 
				opacity: 1
			}, 1500 );
		}).attr('src', '/images/splash_sh.jpg');
	});

	// set license overlay
	$.each( $('.license'), function(i, val)
	{
		this.href = (this.href + '?ajax=true');
	});
	$('.license').click(function()
	{
		return hs.htmlExpand(this, { 
			objectType: 'iframe',
			width: 900,
			height: 600
		});
	});

	// set product link overlay
	$.each( $('.prodLink'), function(i, val)
	{
		this.href = (this.href + '?ajax=true');
	});
	$('.prodLink').click(function()
	{
		return hs.htmlExpand(this, { 
			objectType: 'iframe',
			width: 900,
			height: 600
		});
	});

	// set contact overlay
	$('.contact').click(function()
	{
		return hs.htmlExpand(this, { 
			objectType: 'iframe',
			width: 560,
			height: 710
		});
	});

	$('#rightSide').corner("10px");
	$('.total').corner("6px");
	$('.upgrade').corner("6px");
	
    $('.highl tr').bind('mouseover', function() {
        $(this).children('td').css('background-color', '#e1e1e1');
    });
    $('.highl tr').bind('mouseout', function() {
        $(this).children('td').css('background-color', 'transparent');
    });
    
    $('.suppOption').bind('mouseover', function() {
        $(this).css('background-color', '#f4f4ff');
    });
    $('.suppOption').bind('mouseout', function() {
        $(this).css('background-color', 'transparent');
    });
	
	$(".supportPlan").change(function()
	{
		var detailsTable = $("#offSupportTableDetails");
		if ( detailsTable.css('display') == 'none' )
		{
			expandCollapse('offSupportTableDetails', 'arrow_2');
		}	
	});
	
	$(".upgradePlan").change(function()
	{
		var detailsTable = $("#offUpgradeTableDetails");
		if ( detailsTable.css('display') == 'none' )
		{
			expandCollapse('offUpgradeTableDetails', 'arrow_4');			
		}	
	});
	
	$(".title").click(function()
	{
		expandCollapse( $(this).attr('rel') );			
	});
	
	
	
	 
});

function expandCollapse(elementId,arrowId)
{
    var elem = $('#' + elementId);
    
    if(elem.css('display') == 'none')
    {
        elem.slideDown('fast');
        $("#"+arrowId).attr('class', 'arrowup');
    }
    else
    {
        elem.slideUp('fast');
        $("#"+arrowId).attr('class', 'arrowdown');
    }	
}





