/* -------------------------------------
Name		:	Custom Jquery
Author		:	Edgar G. Andes
Date		:	November 4, 2009
Version		:	1.0
Company		:	AustratianIndexInvestment
Function	:	
------------------------------------- */
$(document).ready(function() {
    InfoTab();
    infoGrid();
    InfoTabLong();
    compareGrid();
    TableStyle();
    tablestylegrid();
	loginForm();
	
	$('.Datepicker').removeAttr();
});

function TableStyle(){CustomTab('InfoTab-tab', 'infoTab-normal', 'infoTab-active', 'tablestyle', 'contentid', 'InfoTab', 'InfoTab-Tab1');}
function InfoTab() { CustomTab('InfoTab-tab', 'infoTab-normal', 'infoTab-active', 'InfoTab-content', 'contentid', 'InfoTab', 'InfoTab-Tab1'); }
function InfoTabLong() { CustomTab('InfoTab-tabLong', 'infoTab-normal', 'infoTab-active', 'tablestyle', 'contentid', 'InfoTab', 'InfoTab-Tab1'); }
function infoGrid(){gridColor('#infotabGrid', 'ebf1f2', 'ffffff');}
function compareGrid(){gridColor('#compare_table', 'ebf1f2', 'ffffff');}
function tablestylegrid(){gridColor('.tablestyle', 'ffffff', 'ebf1f2');}
function tablestylegrid2(){gridColor('.tablestyle2', 'ffffff', 'ebf1f2');}
/********************************************************************************************************************************************************
Custom Tab
********************************************************************************************************************************************************/
function CustomTab(TabHolder, TabClassNormal, TabClassActive, ContentHolder, ContentID, ContentPrefix, TabTrigger)
{
	var TabHolderID = '#' +TabHolder;

	$(TabHolderID + ' div').click(function(event){
		$(TabHolderID + ' div').removeClass();
		$(TabHolderID + ' div').addClass(TabClassNormal);
		$('#' + ContentHolder + ' div[id^='+ ContentPrefix +']').hide();
		
		var id = '#' + $(this).attr('id')
		$(id).removeClass();
		$(id).addClass(TabClassActive);		
		$('#' + $(id).attr(ContentID)).show();		
	});	
	
	$('#' + TabTrigger).trigger('click');
}

function gridColor(gridID, evenColor, oddColor)
{
	
	$(gridID + ' tr:not([th]):even').css('background-color', '#' + evenColor);
	$(gridID + ' tr:not([th]):odd').css('background-color', '#' + oddColor);	  
}

function loginForm()
{
	$('#LoginForm table').attr("cellspacing", "5");
	$('#FormRegistration table').attr("cellspacing", "4");
	
}

