$(document).ready(function(){
	var initView = null;
	var toView = null;
	
    $("#imgAol").ImgMouseEventChange({over:'/img/allowEmail/btn/aolOn.jpg', out:'/img/allowEmail/btn/aol.jpg'});
    $("#imgYahoo").ImgMouseEventChange({over:'/img/allowEmail/btn/yahooOn.jpg', out:'/img/allowEmail/btn/yahoo.jpg'});
    $("#imgMslive").ImgMouseEventChange({over:'/img/allowEmail/btn/msliveOn.jpg', out:'/img/allowEmail/btn/mslive.jpg'});
	
    $("#imgGmail").ImgMouseEventChange({over:'/img/allowEmail/btn/gmailOn.jpg', out:'/img/allowEmail/btn/gmail.jpg'});
    $("#imgOutlook").ImgMouseEventChange({over:'/img/allowEmail/btn/outlookOn.jpg', out:'/img/allowEmail/btn/outlook.jpg'});
    $("#imgThunderbird").ImgMouseEventChange({over:'/img/allowEmail/btn/thunderbirdOn.jpg', out:'/img/allowEmail/btn/thunderbird.jpg'});
	
    $("#imgApple").ImgMouseEventChange({over:'/img/allowEmail/btn/appleOn.jpg', out:'/img/allowEmail/btn/apple.jpg'});
    $("#imgOtherEmail").ImgMouseEventChange({over:'/img/allowEmail/btn/otherOn.jpg', out:'/img/allowEmail/btn/other.jpg'});
	
	$("#imgAol").click(function(event){ showInstructions("aol"); });
	$("#imgYahoo").click(function(event){ showInstructions("yahoo"); });
	$("#imgMslive").click(function(event){ showInstructions("mslive"); });
	
	$("#imgGmail").click(function(event){ showInstructions("gmail"); });
	$("#imgOutlook").click(function(event){ showInstructions("outlook"); });
	$("#imgThunderbird").click(function(event){ showInstructions("thunderbird"); });
	
	$("#imgApple").click(function(event){ showInstructions("apple"); });
	$("#imgOtherEmail").click(function(event){ showInstructions("other"); });
	
	showInstructions = function(p_target){	
		if(initView == null){
			initView = p_target;
			$("#"+p_target).slideDown();
		}else if(toView == null && p_target != initView){
			toView = p_target;
			$("#"+initView).slideUp("normal", closeCallBack);
		}
	}
	
	closeCallBack = function(){
		var show = toView;
		toView = null;
		initView = null;
		showInstructions(show);
	}
});