$(document).ready(function() {

    //astrology sub menu
    $('#astrology-link, #astrology-link-geo').hover(function() {

        $("#astro-sub-menu, #astro-sub-menu-geo").filter(':not(:animated)').show();

    }, function() {

        $("#astro-sub-menu, #astro-sub-menu-geo").hide();

    });

    //about sub menu
    $('#tarot-link, #tarot-link-geo').hover(function() {

        $("#tarotSubMenu, #tarotSubMenuGeo").filter(':not(:animated)').show();

    }, function() {

        $("#tarotSubMenu, #tarotSubMenuGeo").hide();

    });

    //tarot school sub menu
    $('#tarot-school-link, #tarot-school-link-geo').hover(function() {

        $("#tarot-school-sub-menu, #tarot-school-sub-menu-geo").filter(':not(:animated)').show();

    }, function() {

        $("#tarot-school-sub-menu, #tarot-school-sub-menu-geo").hide();

    });

    //MMU US Box
    $("#mmu-us-dialog").dialog({
        autoOpen: false,
        width: 700,
        modal: true,
        title: 'Instant Messenger Readings',
        position: 'center',
        resizable: false,
        close: function() {
            var html = '<img src="images/loader.gif" width="15" height="15" alt="Loading" style="margin-bottom:-5px;" />&nbsp;Please wait...';

            $("#mmu-us-dialog").html(html);

        }
    });

    //Open MMU US Dialog
    $("#mmu-us").click(function() {

        var html = '<iframe src="http://signup.messagemeup.com/ataus/" frameborder="0" scrolling="no" width="680" height="240"></iframe>';
        $("#mmu-us-dialog").html(html);

        $("#mmu-us-dialog").dialog('open');

        return false;
    });



});

function comingSoon() {
    $('#comingSoon').stop().fadeTo(250, 1);
}
function comingSoonOff() {
    $('#comingSoon').stop().fadeTo(250, 0);
}
function comingSoonGeo() {
    $('#comingSoonGeo').stop().fadeTo(250, 1);
}
function comingSoonGeoOff() {
    $('#comingSoonGeo').stop().fadeTo(250, 0);
}
function contactSlideDown(num) {
	if(num == 1) {
		$('#contactTitle').text("Contact Us");
		$('.contact1').show();
		$('.contact2').hide();
		$('.contact3').show();
		$("#contactBox").slideDown('slow');
	}
	if(num == 2) {
		$('#contactTitle').text("Join Us");
		$('.contact1').hide();
		$('.contact2').show();
		$('.contact3').hide();
		$("#contactBox").slideDown('slow');
	}
	if(num == 3) {
		$('#contactTitle').text("Contact Us");
		$('.custNum').text("1-888-578-1569");
		$('.contact1').show();
		$('.contact2').hide();
		$('.contact3').show();
		$("#contactBox").slideDown('slow');	
	}
	if(num == 4) {
		$('#contactTitle').text("Contact Us");
		$('.custNum').text("1800 947 048");
		$('.contact1').show();
		$('.contact2').hide();
		$('.contact3').show();
		$("#contactBox").slideDown('slow');	
	}
}

function contactSlideUp() {
	$("#contactBox").slideUp('slow');
}

function MM_openBrWindow(theURL,winName,features) {
	  window.open(theURL,winName,features);
	}
	
function stepTwo() {
	$("#paypalStep1").fadeOut(function(){
		$("#paypalStep2").fadeIn();
		});
	//document.getElementById("paypalStep1").style.display ="none";
	//document.getElementById("paypalStep2").style.display="block";
	}
	
function stepThree() {
	document.getElementById("paypalStep2").style.display ="none";
	document.getElementById("paypalStep3").style.display="block";
	document.getElementById("paypalBought").style.display="none";
	}
	
function addmsn(im_msn) {
	if (navigator.appName != 'Microsoft Internet Explorer') { 
	openpopup('addContact.aspx'); 
	}else 
	{ window.location='msnim:add?contact='+im_msn; }
}

function openpopup(popurl){
var winpops=window.open(popurl,"","width=450,height=200,resizable")
}

function openVoucher(popurl){
var winpops=window.open(popurl,"","width=278,height=420,resizable")
}

function showSelection(obj) {

	var phonebox = document.getElementById("payByPhone");
	var ccbox = document.getElementById("payByCC");
	var paypalbox = document.getElementById("payByPaypal");
	var currentphone = document.getElementById("currentMarkerPhone");
	var currentcc = document.getElementById("currentMarkerCC");
	var currentpaypal = document.getElementById("currentMarkerPaypal");
	var paymentinfo = document.getElementById("webcamPaymentInfo");
	var paypalinfo = document.getElementById("webcamPaypalInfo");
	var webcaminfo = document.getElementById("webcamInfoBox");

	if(obj == "phone") {
		phonebox.style.display = "block";
		ccbox.style.display = "none";
		paypalbox.style.display = "none";
		currentphone.style.display = "block";
		currentcc.style.display = "none";
		currentpaypal.style.display = "none";
		webcaminfo.style.display = "block";
		paymentinfo.style.display = "block";
		paypalinfo.style.display = "none";
		}
	else if(obj == "cc"){
		phonebox.style.display = "none";
		ccbox.style.display = "block";
		paypalbox.style.display = "none";
		currentphone.style.display = "none";
		currentcc.style.display = "block";
		currentpaypal.style.display = "none";
		webcaminfo.style.display = "block";
		paymentinfo.style.display = "block";
		paypalinfo.style.display = "none";
		}
	else if(obj == "paypal"){
		phonebox.style.display = "none";
		ccbox.style.display = "none";
		paypalbox.style.display = "block";
		$('#webcamPaypalSteps12').show();
		$('#webcamPaypalStep3').hide();
		currentphone.style.display = "none";
		currentcc.style.display = "none";
		currentpaypal.style.display = "block";
		webcaminfo.style.display = "none";
		}
}

function showVidBox() {
		$('#webcamVideo').fadeIn();
}

function closeVidBox() {
		$('#webcamVideo').fadeOut();
}

function webcamPaypalStep3() {
		$('#webcamPaypalSteps12').hide();
		$('#webcamPaypalStep3').show();
}