// register Gadget's namespace
registerNamespace("Roodyn.Live.Gadget");

// define the constructor for your Gadget (this must match the name in the manifest XML)
Roodyn.Live.Gadget.WhereWas = function(p_elSource, p_args, p_namespace)
{
    // always call initializeBase before anything else!
	Roodyn.Live.Gadget.WhereWas.initializeBase(this, arguments);
	var m_module = p_args.module;

	// Private method to output map
	this.Output = function()
	{
		var elHeight = 350;
		
		p_elSource.style.height=elHeight;

    //To get the allocated height & width try;
    var elWidth = p_elSource.offsetWidth - 20;
		
		var url = "http://ViaVirtualEarth.com/MyVirtualEarth/Gadgets/WhereWas.htm";
        
    p_elSource.innerHTML = "<iframe src=\"" 
        + url 
        + "\" frameborder=\"0\" scrolling=\"no\" width=\"" 
        + elWidth 
        + "\" height=\""
        + elHeight
        + "\" />";
    
    p_args.module.resize();
    
	}
	Roodyn.Live.Gadget.WhereWas.registerBaseMethod(this, "Output");
		
    
	this.initialize = function(p_objScope)
	{
	    // Call base class's initialize method
		Roodyn.Live.Gadget.WhereWas.getBaseMethod(this, "initialize", "Web.Bindings.Base").call(this, p_objScope);
		this.Output();
	}
	Roodyn.Live.Gadget.WhereWas.registerBaseMethod(this, "initialize");
	
	this.dispose = function(p_blnUnload)
	{
	    // Usually, you would add your dipose code here, but we have nothing to dispose for this Gadget
	    
	    
	    
	    // always call the base object's dispose last!
	    Roodyn.Live.Gadget.WhereWas.getBaseMethod(this, "dispose", "Web.Bindings.Base").call(this, p_blnUnload);
	}
	Roodyn.Live.Gadget.WhereWas.registerBaseMethod(this, "dispose");
}
Roodyn.Live.Gadget.WhereWas.registerClass("Microsoft.Live.GadgetSDK.HelloWorldGadget", "Web.Bindings.Base");

