$(document).ready(function(){
	//Accordian slide in and out used for Microsoft landing page. Click function on h3
	$(".accordion div").hide();
	$(".accordion h3").click(function(){
		$(this).next("div").slideToggle("fast")
		.siblings("div:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});
	//Payment option show and hide used in regiatration process. Change function on select
	$("#paymenthow").change(function(){
	if(this.value == 'creditdebitcard' || this.value == 'anull')
		{$("#payment").children().hide();}
	else
		{$("#" + this.value).show().siblings().hide();}
	});
	$("#paymenthow").change();
	
	$.tabs('container-2');
	$.tabs('screen-outer');
});

//////////////////// tabs jquery plugin ////////////////////////////////////////////////////////////////////////////
$.tabs = function(containerId, start) {
    var ON_CLASS = 'on';
    var id = '#' + containerId;
    var i = (typeof start == "number") ? start - 1 : 0;
    $(id + '>div:eq(' + i + ')').css({display:"block"});
    $(id + '>ul>li:nth-child(' + (i+1) + ')').addClass(ON_CLASS);
    $(id + '>ul>li>a').click(function() {
        if (!$(this.parentNode).is('.' + ON_CLASS)) {
            var re = /([_\-\w]+$)/i;
            var target = $('#' + re.exec(this.href)[1]);
            if (target.size() > 0) {
                $(id + '>div:visible').css({display:"none"});
                target.css({display:"block"});
                $(id + '>ul>li').removeClass(ON_CLASS);
                $(this.parentNode).addClass(ON_CLASS);
            } else {
                alert('There is no such container.');
            }
        }
        return false;
    });
};




