//
//	This class represent the page the user is viewing. It's the controller on
//	the client-side of the view.
//
DefaultPage = function()
{
	Unyk.Web.UI.Page.call(this);
};

YAHOO.lang.extend(DefaultPage, Unyk.Web.UI.Page,
{

	//*************************************************************************
	//
	//	Fields
	//
	//*************************************************************************
	_defaultForm: "frmMain",
	whatIsViadeoPopup: null,


	//*************************************************************************
	//
	//	Events
	//
	//*************************************************************************

	//
	//	Handles the Page Load event.
	//
	Page_Load: function(e, args)
	{
		// Assign the default form to post back to.
		this.Form = this._defaultForm;

		// Init all the page listeners.
		this.InitListeners();
	},


	//
	//	...
	//
	WhatIsViadeo_Click: function(e, args)
	{
		Event.stopEvent(e);

		var ws = new Unyk.Web.WebServiceProxy();
		ws._ExecuteCommand("/events/viadeo", "what-is-viadeo", true, null, {
			success: function(o)
			{
				var html = JSON.parse(o.responseText);
				if (this.whatIsViadeoPopup == null)
				{
					this.whatIsViadeoPopup = new YAHOO.widget.Panel(
						"wiv",
						{
							width: "69.23em",
							fixedcenter: true,
							close: true,
							draggable: false,
							zindex: 4,
							modal: true,
							visible: false
						}
					);
				}

				this.whatIsViadeoPopup.setHeader(html.header);
				this.whatIsViadeoPopup.setBody(html.body);
				this.whatIsViadeoPopup.setFooter(html.footer);
				this.whatIsViadeoPopup.render(document.body);

				Event.on("what-is-viadeo-go-unyk", "click", this.whatIsViadeoPopup.hide, null, this.whatIsViadeoPopup);

				this.whatIsViadeoPopup.show();
			},
			cache: false
		});
	},


	//*************************************************************************
	//
	//	Private API
	//
	//*************************************************************************

	//
	//	...
	//
	InitListeners: function()
	{
		//this.TrackCapslockState("password", this.capsError);

		Event.on("what-is-viadeo", "click", this.WhatIsViadeo_Click, null, this);
	}

});

// Makes RegistrationMainPage a singleton.
DefaultPage = new DefaultPage();



//
//	This is the js implementation of the .asp page's Page Methods.
//
PageMethods = function()
{
	Unyk.Web.PageMethodsProxy.call(this);
};

YAHOO.lang.extend(PageMethods, Unyk.Web.PageMethodsProxy, 
{
});

PageMethods = new PageMethods();
PageMethods.Path = "/Default.asp";
