function EscreveFlash(piWid, piHei, psSrc, psId) 
{
var strSwf;

strSwf = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" id="+psId+" width="+piWid+" height="+piHei+">";
strSwf += "<param name=\"movie\" value="+psSrc+" />";
strSwf += "<param name=\"menu\" value=\"false\" />";
strSwf += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
strSwf += "<param name=\"quality\" value=\"high\" />";
strSwf += "<param name=\"wmode\" value=\"transparent\" />";
strSwf += "<embed id="+psId+" name="+psId+" allowScriptAccess=\"sameDomain\" swLiveConnect=\"true\" src="+psSrc+" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width="+piWid+" height="+piHei+"></embed></object>";

this.document.write(strSwf);
} 

function Link
    ()
{
    function __addParameter
        ( name
        , value )
    {
        __validate( name, 'name' );
        __validate( value, 'value' );
        __params.push( escape( name ) );
        __params.push( escape( value ) );
    }

    function __clearParameters
        ()
    {
        __params = new Array();
    }

    function __constructor
        ( page )
    {
        __validate( page, 'page' );
        this.__page = page;
        this.__params = new Array();
    }

    /**
     * Devolve a representação textual deste link.
     */
    function __toString
        ()
    {
        var result = "javascript:requestPage( '";
        result += __page;
        if( __params.length > 0 ) {
            for( var i = 0; i < __params.length; ++i ) {
                result += "', '";
                result += __params[ i ];
            }
        }
        result += "' );";
        return result;
    }

    function __validate
        ( obj
        , objName )
    {
        if( typeof( obj ) == 'undefined'  ||  obj == null ) {
            var errorMsg = 'Invalid parameter: ' + objName + ' == ' + obj;
            throw new Error( errorMsg, errorMsg );
        }
    }

    /**
     * Métodos públicos.
     */
    this.addParameter     = __addParameter;
    this.clearParameters  = __clearParameters;
    this.toString         = __toString;

    /**
     * Encetamento.
     */
    __constructor( arguments[ 0 ] );
}



function requestPage
    ( page )
{
    var MIN_ARGS = 1;
    if( arguments.length < MIN_ARGS ) {
        throw new Error( 'Page name is missing.' );
    } else {
        __pr__RequestDocumentForWindow( window, page, arguments, MIN_ARGS );
    }
}



function requestPop
    ( popObj
    , page )
{
    var MIN_ARGS = 2;
    if( arguments.length < MIN_ARGS ) {
        throw new Error( 'A window object and a page should have been passed.' );
    } else {
        __pr__RequestDocumentForWindow( popObj, page, arguments, MIN_ARGS );
    }
}



function __pr__RequestDocumentForWindow
    ( winObj
    , page
    , params
    , firstIndex )
{
    var strAction = page;
    for( var i = firstIndex; i < params.length; ) {
        strAction += ( i == firstIndex  ?  '?'  :  '&' );
        strAction += params[ i++ ];
        strAction += '=';
        strAction += params[ i++ ];
    }
    var reqPageForm = document.PageRequestForm;
    reqPageForm.action = strAction;
    reqPageForm.target = winObj == window  ?  '_self'  :  winObj.name;
    reqPageForm.submit();
}



	function espanhol() {
		window.opener.location = 'spanish_updating.page';
		window.self.blur();
	}

	function changeLocale
		( lang )
	{
		requestPage( 'changeLocale.do', 'LO' , lang);
	}

	function contactUs
		( )
	{
		window.opener.requestPage( 'contact.page', 'LO', 'pt' );
		window.self.blur();
	}

	function reservePageCMNetFromHotSite
		( hotelId )
	{
		window.opener.reservePageCMNetFromHotSite( hotelId );
		window.self.blur();
	}

