﻿// Widget de procura
function writeHTMLasJS(partner) {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<div id=\"searchBarTop\" class=\"MWsearchBar\">");
    document.write("    <div class=\"MWslidingBarClosed\">");
    document.write("        <img usemap=\"#Image-Maps_6201006141221104\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widget01.png\" alt=\"\" \/>");
    document.write("<map id=\"_Image-Maps_6201006141221104\" name=\"Image-Maps_6201006141221104\">");
    document.write("<area shape=\"rect\" coords=\"0,43,57,66\" target=\"_blank\" href=\"http:\/\/www.myway.pt\/\" alt=\"\" title=\"\"    \/>");
    document.write("<area shape=\"rect\" coords=\"0,0,62,56\" onclick=\"toggleFold();\" href=\"javascript:void(0)\" alt=\"\" title=\"\"    \/>");
    document.write("<\/map>");
    document.write("    <\/div>");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpen\" style=\"margin-left:-200px;\">");
    document.write("       <div id=\"btUnfold\" class=\"MWbtUnfold\">");
    document.write("       <a href=\"javascript:void(0);\" onclick=\"toggleFold();\"  class=\"MWbtUnfoldLink\">");
    document.write("            <img id=\"imgBtOpen\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_open.png\" alt=\"\" border=\"0\" \/>");
    document.write("            <img id=\"imgBtClose\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_close.png\" alt=\"\" border=\"0\" style=\"display:none\" \/><\/a>");
    document.write("        <\/div>");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('" + partner + "');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("        <div id=\"PanelSearch\" class=\"MWpanelSearch\">");
    document.write("<iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("<div id=\"btFechar\" style=\"position: absolute; z-index: 100; left: 258px; top: 6px;display:none\">");
    document.write("<a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

//Widget de procura com imagens
function writeWidgetMyway(partner, referer) {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<div id=\"searchBarTop\" class=\"MWsearchBar\">");
    document.write("    <div class=\"MWslidingBarClosed\" style=\"margin-top:0\" >");
    document.write("        <img usemap=\"#Image-Maps_6201006141221104\" src=\"http:\/\/www.myway.pt\/widgets\/img\/widget_" + partner + "01.png\" border=0 alt=\"\" \/>");
    document.write("<map id=\"_Image-Maps_6201006141221104\" name=\"Image-Maps_6201006141221104\">");
    document.write("<area shape=\"rect\" coords=\"0,43,57,66\" target=\"_blank\" href=\"http:\/\/www.myway.pt\/\" alt=\"\" title=\"\"    \/>");
    document.write("<area shape=\"rect\" coords=\"0,0,62,56\" onclick=\"toggleFold();\" href=\"javascript:void(0)\" alt=\"\" title=\"\"    \/>");
    document.write("<\/map>");
    document.write("    <\/div>");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpen\" style=\"margin-left:-200px;background-image: url(http:\/\/www.myway.pt\/widgets\/img\/widget_"+partner+"02.png);\">");
    document.write("       <div id=\"btUnfold\" class=\"MWbtUnfold\">");
    document.write("       <a href=\"javascript:void(0);\" onclick=\"toggleFold();\"  class=\"MWbtUnfoldLink\">");
    document.write("            <img id=\"imgBtOpen\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_open.png\" alt=\"\" border=\"0\" \/>");
    document.write("            <img id=\"imgBtClose\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_close.png\" alt=\"\" border=\"0\" style=\"display:none\" \/><\/a>");
    document.write("        <\/div>");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\";");
    if (referer)
        document.write(" onkeyup=\"onTxtSearchKeyUp('" + partner + "','" + referer + "');\"");
    else
        document.write(" onkeyup=\"onTxtSearchKeyUp('" + partner + "');\"");
    document.write("                 class=\"MWtxtSearch\" value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("        <div id=\"PanelSearch\" class=\"MWpanelSearch\">");
    document.write("<iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("<div id=\"btFechar\" style=\"position: absolute; z-index: 100; left: 258px; top: 6px;display:none\">");
    document.write("<a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura IOnline
function writeWidgetIOnline() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<div id=\"searchBarTop\" class=\"MWsearchBar\">");
    document.write("    <div class=\"MWslidingBarClosed\">");
    document.write("        <img usemap=\"#Image-Maps_6201006141221104\" src=\"http:\/\/www.myway.pt\/widgets\/img\/bcg_widget01_ionline.png\" alt=\"\" \/>");
    document.write("<map id=\"_Image-Maps_6201006141221104\" name=\"Image-Maps_6201006141221104\">");
    document.write("<area shape=\"rect\" coords=\"0,43,57,66\" target=\"_blank\" href=\"http:\/\/www.myway.pt\/\" alt=\"http:\/\/www.myway.pt\/\" title=\"http:\/\/www.myway.pt\/\"    \/>");
    document.write("<area shape=\"rect\" coords=\"0,0,62,56\" onclick=\"toggleFold();\" href=\"javascript:void(0)\" alt=\"\" title=\"\"    \/>");
    document.write("<\/map>");
    document.write("    <\/div>");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenIOnline\" style=\"margin-left:-200px;\">");
    document.write("       <div id=\"btUnfold\" class=\"MWbtUnfold\">");
    document.write("       <a href=\"javascript:void(0);\" onclick=\"toggleFold();\"  class=\"MWbtUnfoldLink\">");
    document.write("            <img id=\"imgBtOpen\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_open.png\" alt=\"\" border=\"0\" \/>");
    document.write("            <img id=\"imgBtClose\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_close.png\" alt=\"\" border=\"0\" style=\"display:none\" \/><\/a>");
    document.write("        <\/div>");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('iOnline');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("        <div id=\"PanelSearch\" class=\"MWpanelSearch\">");
    document.write("<iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("<div id=\"btFechar\" style=\"position: absolute; z-index: 100; left: 258px; top: 6px;display:none\">");
    document.write("<a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura Sabado
function writeWidgetSabado() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<div id=\"searchBarTop\" class=\"MWsearchBar\">");
    document.write("    <div class=\"MWslidingBarClosed2\">");
    document.write("        <img usemap=\"#Image-Maps_6201006141221104\" src=\"http:\/\/www.myway.pt\/widgets\/img\/bcg_widget01_sabado.png\" alt=\"\" \/>");
    document.write("<map id=\"_Image-Maps_6201006141221104\" name=\"Image-Maps_6201006141221104\">");
    document.write("<area shape=\"rect\" coords=\"0,43,57,66\" target=\"_blank\" href=\"http:\/\/www.myway.pt\/\" alt=\"\" title=\"\"    \/>");
    document.write("<area shape=\"rect\" coords=\"0,0,62,56\" onclick=\"toggleFold();\" href=\"javascript:void(0)\" alt=\"\" title=\"\"    \/>");
    document.write("<\/map>");
    document.write("    <\/div>");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenSabado\" style=\"margin-left:-205px;\">");
    document.write("       <div id=\"btUnfold\" class=\"MWbtUnfold\">");
    document.write("       <a href=\"javascript:void(0);\" onclick=\"toggleFold();\"  class=\"MWbtUnfoldLink\">");
    document.write("            <img id=\"imgBtOpen\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_open.png\" alt=\"\" border=\"0\" \/>");
    document.write("            <img id=\"imgBtClose\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_close.png\" alt=\"\" border=\"0\" style=\"display:none\" \/><\/a>");
    document.write("        <\/div>");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('sabado');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("        <div id=\"PanelSearch\" class=\"MWpanelSearch\">");
    document.write("<iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("<div id=\"btFechar\" style=\"position: absolute; z-index: 100; left: 258px; top: 6px;display:none\">");
    document.write("<a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}
// Widget de procura Sabado
function writeWidgetSabado300() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<script>isOpen = true;</script>");
    document.write("<div id=\"searchBarTop\" style=\"position:relative;height:100px;\">");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenOJE\" style=\"padding-left:90px;padding-top:60px;width:300px;height:100px;background-image:url(http:\/\/www.myway.pt\/widgets\/img\/SABADO_Banners300x100.png);\">");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('sabado');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("<div id=\"PanelSearch\" class=\"MWpanelSearch\" style=\"margin-left:50px;margin-top:82px;z-index:600000\">");
    document.write("    <iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("    <div id=\"btFechar\" style=\"position: absolute; z-index: 600000; left: 258px; top: 6px;display:none\">");
    document.write("    <a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura IOnline
function writeWidgetOJE() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<script>isOpen = true;</script>");
    document.write("<div id=\"searchBarTop\" style=\"position:relative;height:70px;\">");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenOJE\" style=\"padding:30px 0 0 95px;\">");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('OJE');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("<div id=\"PanelSearch\" class=\"MWpanelSearch\" style=\"margin-left:55px;margin-top:52px;z-index:600000\">");
    document.write("    <iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("    <div id=\"btFechar\" style=\"position: absolute; z-index: 600000; left: 258px; top: 6px;display:none\">");
    document.write("    <a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura Antena3
function writeWidgetAntena3() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<div id=\"searchBarTop\" class=\"MWsearchBar\">");
    document.write("    <div class=\"MWslidingBarClosed2\">");
    document.write("        <img usemap=\"#Image-Maps_6201006141221104\" src=\"http:\/\/www.myway.pt\/widgets\/img\/widget_antena3_01.png\" alt=\"\" \/>");
    document.write("<map id=\"_Image-Maps_6201006141221104\" name=\"Image-Maps_6201006141221104\">");
    document.write("<area shape=\"rect\" coords=\"0,43,57,66\" target=\"_blank\" href=\"http:\/\/www.myway.pt\/\" alt=\"\" title=\"\"    \/>");
    document.write("<area shape=\"rect\" coords=\"0,0,62,56\" onclick=\"toggleFold();\" href=\"javascript:void(0)\" alt=\"\" title=\"\"    \/>");
    document.write("<\/map>");
    document.write("    <\/div>");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenAntena3\" style=\"margin-left:-205px;\">");
    document.write("       <div id=\"btUnfold\" class=\"MWbtUnfold\">");
    document.write("       <a href=\"javascript:void(0);\" onclick=\"toggleFold();\"  class=\"MWbtUnfoldLink\">");
    document.write("            <img id=\"imgBtOpen\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_open.png\" alt=\"\" border=\"0\" \/>");
    document.write("            <img id=\"imgBtClose\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_close.png\" alt=\"\" border=\"0\" style=\"display:none\" \/><\/a>");
    document.write("        <\/div>");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('Antena3Radio');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("        <div id=\"PanelSearch\" class=\"MWpanelSearch\">");
    document.write("<iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("<div id=\"btFechar\" style=\"position: absolute; z-index: 100; left: 258px; top: 6px;display:none\">");
    document.write("<a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura MSN1
function writeWidgetMSN1() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<script>isOpen = true;</script>");
    document.write("<div id=\"searchBarTop\" style=\"position:relative;height:100px;\">");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenOJE\" style=\"padding-left:90px;padding-top:60px;width:300px;height:100px;background-image:url(http:\/\/www.myway.pt\/widgets\/img\/msn\/MSN_Banners300x100.png);\">");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('MSN');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("<div id=\"PanelSearch\" class=\"MWpanelSearch\" style=\"margin-left:50px;margin-top:82px;z-index:600000\">");
    document.write("    <iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("    <div id=\"btFechar\" style=\"position: absolute; z-index: 600000; left: 258px; top: 6px;display:none\">");
    document.write("    <a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura MSN2
function writeWidgetMSN2() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<script>isOpen = true;</script>");
    document.write("<div id=\"searchBarTop\" style=\"position:relative;height:48px;\">");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenOJE\" style=\"padding-left:520px;padding-top:10px;width:952px;height:48px;background-image:url(http:\/\/www.myway.pt\/widgets\/img\/msn\/barra_MSN.png);\">");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('MSN');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("<div id=\"PanelSearch\" class=\"MWpanelSearch\" style=\"margin-left:480px;margin-top:32px;z-index:600000\">");
    document.write("    <iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("    <div id=\"btFechar\" style=\"position: absolute; z-index: 600000; left: 258px; top: 6px;display:none\">");
    document.write("    <a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura TelemoveisCom
function writeWidgetTelemoveisCom() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<div id=\"searchBarTop\" class=\"MWsearchBar\">");
    document.write("    <div class=\"MWslidingBarClosed2\">");
    document.write("        <img usemap=\"#Image-Maps_6201006141221104\" src=\"http:\/\/www.myway.pt\/widgets\/img\/widget_telemoveis01.png\" alt=\"\" \/>");
    document.write("<map id=\"_Image-Maps_6201006141221104\" name=\"Image-Maps_6201006141221104\">");
    document.write("<area shape=\"rect\" coords=\"0,43,57,66\" target=\"_blank\" href=\"http:\/\/www.myway.pt\/\" alt=\"\" title=\"\"    \/>");
    document.write("<area shape=\"rect\" coords=\"0,0,62,56\" onclick=\"toggleFold();\" href=\"javascript:void(0)\" alt=\"\" title=\"\"    \/>");
    document.write("<\/map>");
    document.write("    <\/div>");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenTelemoveisCom\" style=\"margin-left:-205px;\">");
    document.write("       <div id=\"btUnfold\" class=\"MWbtUnfold\">");
    document.write("       <a href=\"javascript:void(0);\" onclick=\"toggleFold();\"  class=\"MWbtUnfoldLink\">");
    document.write("            <img id=\"imgBtOpen\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_open.png\" alt=\"\" border=\"0\" \/>");
    document.write("            <img id=\"imgBtClose\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_close.png\" alt=\"\" border=\"0\" style=\"display:none\" \/><\/a>");
    document.write("        <\/div>");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('telemoveiscom');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("        <div id=\"PanelSearch\" class=\"MWpanelSearch\">");
    document.write("<iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("<div id=\"btFechar\" style=\"position: absolute; z-index: 100; left: 258px; top: 6px;display:none\">");
    document.write("<a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura Universia
function writeWidgetUniversia290() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<script>isOpen = true;</script>");
    document.write("<div id=\"searchBarTop\" style=\"position:relative;height:100px;\">");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenOJE\" style=\"padding-left:80px;padding-top:60px;width:290px;height:100px;background-image:url(http:\/\/www.myway.pt\/widgets\/img\/widget_BCGuniversia.jpg);\">");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('universia');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("<div id=\"PanelSearch\" class=\"MWpanelSearch\" style=\"margin-left:40px;margin-top:82px;z-index:600000\">");
    document.write("    <iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("    <div id=\"btFechar\" style=\"position: absolute; z-index: 600000; left: 258px; top: 6px;display:none\">");
    document.write("    <a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura Universia
function writeWidgetUniversia208() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<script>isOpen = true;</script>");
    document.write("<div id=\"searchBarTop\" style=\"position:relative;height:100px;\">");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenOJE\" style=\"padding-left:3px;padding-top:67px;width:208px;height:100px;background-image:url(http:\/\/www.myway.pt\/widgets\/img\/widget_BCGuniversia208.jpg);\">");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('universia');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("<div id=\"PanelSearch\" class=\"MWpanelSearch\" style=\"margin-left:-37px;margin-top:89px;z-index:600000\">");
    document.write("    <iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("    <div id=\"btFechar\" style=\"position: absolute; z-index: 600000; left: 258px; top: 6px;display:none\">");
    document.write("    <a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura Antena 1
function writeWidgetAntena1() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<div id=\"searchBarTop\" class=\"MWsearchBar\">");
    document.write("    <div class=\"MWslidingBarClosed2\">");
    document.write("        <img usemap=\"#Image-Maps_6201006141221104\" src=\"http:\/\/www.myway.pt\/widgets\/img\/antena1\/widget_antena1_01.png\" alt=\"\" \/>");
    document.write("<map id=\"_Image-Maps_6201006141221104\" name=\"Image-Maps_6201006141221104\">");
    document.write("<area shape=\"rect\" coords=\"0,43,57,66\" target=\"_blank\" href=\"http:\/\/www.myway.pt\/\" alt=\"\" title=\"\"    \/>");
    document.write("<area shape=\"rect\" coords=\"0,0,62,56\" onclick=\"toggleFold();\" href=\"javascript:void(0)\" alt=\"\" title=\"\"    \/>");
    document.write("<\/map>");
    document.write("    <\/div>");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenAntena1\" style=\"margin-left:-205px;\">");
    document.write("       <div id=\"btUnfold\" class=\"MWbtUnfold\">");
    document.write("       <a href=\"javascript:void(0);\" onclick=\"toggleFold();\"  class=\"MWbtUnfoldLink\">");
    document.write("            <img id=\"imgBtOpen\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_open.png\" alt=\"\" border=\"0\" \/>");
    document.write("            <img id=\"imgBtClose\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_close.png\" alt=\"\" border=\"0\" style=\"display:none\" \/><\/a>");
    document.write("        <\/div>");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('Antena1Radio');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("        <div id=\"PanelSearch\" class=\"MWpanelSearch\">");
    document.write("<iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("<div id=\"btFechar\" style=\"position: absolute; z-index: 100; left: 258px; top: 6px;display:none\">");
    document.write("<a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

// Widget de procura Antena 2
function writeWidgetAntena2() {
    document.write("<link href=\"http:\/\/www.myway.pt\/Styles\/mywaysearch.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
    document.write("<div id=\"searchBarTop\" class=\"MWsearchBar\">");
    document.write("    <div class=\"MWslidingBarClosed2\">");
    document.write("        <img usemap=\"#Image-Maps_6201006141221104\" src=\"http:\/\/www.myway.pt\/widgets\/img\/antena2\/widget_antena2_01.png\" alt=\"\" \/>");
    document.write("<map id=\"_Image-Maps_6201006141221104\" name=\"Image-Maps_6201006141221104\">");
    document.write("<area shape=\"rect\" coords=\"0,43,57,66\" target=\"_blank\" href=\"http:\/\/www.myway.pt\/\" alt=\"\" title=\"\"    \/>");
    document.write("<area shape=\"rect\" coords=\"0,0,62,56\" onclick=\"toggleFold();\" href=\"javascript:void(0)\" alt=\"\" title=\"\"    \/>");
    document.write("<\/map>");
    document.write("    <\/div>");
    document.write("    <div id=\"slidingBar\" class=\"MWslidingBarOpenAntena2\" style=\"margin-left:-205px;\">");
    document.write("       <div id=\"btUnfold\" class=\"MWbtUnfold\">");
    document.write("       <a href=\"javascript:void(0);\" onclick=\"toggleFold();\"  class=\"MWbtUnfoldLink\">");
    document.write("            <img id=\"imgBtOpen\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_open.png\" alt=\"\" border=\"0\" \/>");
    document.write("            <img id=\"imgBtClose\" src=\"http:\/\/www.myway.pt\/imgOrange\/bcg_widgetbt_close.png\" alt=\"\" border=\"0\" style=\"display:none\" \/><\/a>");
    document.write("        <\/div>");
    document.write("        <div class=\"MWtxtSearchBG\">");
    document.write("            <input id=\"txtSearch\"  type=\"text\" onfocus=\"onFocusInput(this)\" onkeydown=\"onTxtSearchKeyDown()\"; onkeyup=\"onTxtSearchKeyUp('Antena2Radio');\" class=\"MWtxtSearch\"");
    document.write("                value=\"Procurar artista ou género\" \/>");
    document.write("        <\/div>");
    document.write("        <div id=\"loaderImg\" class=\"MWloaderImg\">");
    document.write("            <img src=\"http:\/\/www.myway.pt\/imgOrange\/ajax-loaderPartner.gif\" alt=\"\" \/>");
    document.write("        <\/div>");
    document.write("    <\/div>");
    document.write("<\/div>");
    document.write("        <div id=\"PanelSearch\" class=\"MWpanelSearch\">");
    document.write("<iframe id=\"ifr\" onload=\"iframeLoaded()\" SCROLLING=\"no\" width=\"1px\" height=\"1px\" allowtransparency=\"true\" frameborder=0 src=\"\"></iframe>");
    document.write("<div id=\"btFechar\" style=\"position: absolute; z-index: 100; left: 258px; top: 6px;display:none\">");
    document.write("<a href=\"javascript:void(0);\" class=\"pesquisar_Fechar\" onclick=\"closeResultPanel();\">X</a></div>");
    document.write("<\/div>");
}

function writeWidget(widget, logo, fundo1, fundo2, color, css, texto, textosize, playerRSS, playerLogo, playerType, playerPK, playerPub) {

    if (widget == "vilagale") {
        document.write("<script src=\"http:\/\/www.myway.pt\/widgets\/scripts\/customWidget.js\" type=\"text\/javascript\"><\/script>");
        document.write("<script src=\"http:\/\/www.myway.pt\/widgets\/scripts\/jquery-1.6.4.min.js\" type=\"text/javascript\"></script>");
        document.write("<script src=\"http:\/\/www.myway.pt\/scripts\/netscope2.js\" type=\"text\/javascript\"></script>");
        document.write("<link href=\"http:\/\/www.myway.pt\/widgets\/styles\/parceiros\/vilagale\/style.css\" rel=\"stylesheet\" type=\"text\/css\" />");
        document.write("<div style=\"left: 0px; top: 35%; position: fixed; z-index: 1000;\">");
        document.write("    <input id=\"rssValue\" type=\"hidden\" value=\"\" />");
        document.write("    <input id=\"logoValue\" type=\"hidden\" value=\"\" />");
        document.write("    <input id=\"colorValue\" type=\"hidden\" value=\"\" />");
        document.write("    <input id=\"pubValue\" type=\"hidden\" value=\"\" />");
        document.write("    <div id=\"LogoPanelLogos\"></div>");
        document.write("    <div id=\"LogoPanelBotaoAbrir\" onclick=\"showPanel();\"></div>");
        document.write("    <div style=\"width:65px; height:20px; margin-top:42px; position:absolute; cursor:pointer;\" onclick=\"window.open('http:\/\/www.myway.pt\/');\">");
        document.write("        <img alt=\"http:\/\/www.myway.pt\/\" src=\"http:\/\/www.myway.pt\/widgets\/imgCustom\/spacer.gif\" width=\"1\" height=\"1\" />");
        document.write("    </div>");
        document.write("    <div id=\"BigPanel\">");
        document.write("        <div id=\"BigPanelOpcoesOut\">");
        document.write("            <div id=\"BigPanelOpcoesIn\">");
        document.write("                <div id=\"BigPanelOpcoesTop\"></div>");
        document.write("                <div class=\"BigPanelOpcoes\"><div class=\"BigPanelOpcoesText\">Chill Out</div><div class=\"BigPanelOpcoesLink\" onclick=\"window.open('http://www.myway.pt/widgets/widgetParceiros_VilaGale.aspx?radiopk=E0F0350D-277B-45F4-AAC7-C71E46BE3F44', 'mywayWidgetWindow', 'width=480,height=392,location=no,toolbar=no,menubar=no,resizable=no,status=no,scrollbars=no');runNetscope(); \"></div></div>");
        document.write("                <div class=\"BigPanelOpcoes\"><div class=\"BigPanelOpcoesText\">Portuguesa</div><div class=\"BigPanelOpcoesLink\" onclick=\"window.open('http://www.myway.pt/widgets/widgetParceiros_VilaGale.aspx?radiopk=DFB8F4FE-601C-482F-A453-CD2BA3987EFA', 'mywayWidgetWindow', 'width=480,height=392,location=no,toolbar=no,menubar=no,resizable=no,status=no,scrollbars=no');runNetscope(); \"></div></div>");
        document.write("                <div class=\"BigPanelOpcoes\"><div class=\"BigPanelOpcoesText\">Brasileira</div><div class=\"BigPanelOpcoesLink\" onclick=\"window.open('http://www.myway.pt/widgets/widgetParceiros_VilaGale.aspx?radiopk=927D0B87-D608-46F9-9C8E-8F2CB92C42A3', 'mywayWidgetWindow', 'width=480,height=392,location=no,toolbar=no,menubar=no,resizable=no,status=no,scrollbars=no');runNetscope(); \"></div></div>");
        document.write("                <div class=\"BigPanelOpcoes\"><div class=\"BigPanelOpcoesText\">Jazz</div><div class=\"BigPanelOpcoesLink\" onclick=\"window.open('http://www.myway.pt/widgets/widgetParceiros_VilaGale.aspx?radiopk=7A705561-7CB5-4D7D-8B08-3167758CF005', 'mywayWidgetWindow', 'width=480,height=392,location=no,toolbar=no,menubar=no,resizable=no,status=no,scrollbars=no');runNetscope(); \"></div></div>");
        document.write("                <div class=\"BigPanelOpcoes\"><div class=\"BigPanelOpcoesText\">Pop/Rock</div><div class=\"BigPanelOpcoesLink\" onclick=\"window.open('http://www.myway.pt/widgets/widgetParceiros_VilaGale.aspx?radiopk=58B1EB5E-DD64-4D4C-B6A4-3FB40E4C9380', 'mywayWidgetWindow', 'width=480,height=392,location=no,toolbar=no,menubar=no,resizable=no,status=no,scrollbars=no');runNetscope(); \"></div></div>");
        document.write("            </div>");
        document.write("        </div>");
        document.write("        <div id=\"BigPanelBotaoFechar\" onClick=\"hidePanel();\"></div>");
        document.write("    </div>");
        document.write("</div>");
    }

}
// Funções utilizadas pela widget

var ajaxRequest; // Variavel com o objecto que faz os pedidos ajax
var _WAIT_TIME = 500; // Tempo esperado até se enviar o texto de procura para o servidor
var _timeoutFunction; // handler do temporizador para o envio da procura

function onTxtSearchKeyDown() {
    if (_timeoutFunction != null) clearTimeout(_timeoutFunction);
}

function onTxtSearchKeyUp(partnerName, refererName) {
    if (_timeoutFunction != null) clearTimeout(_timeoutFunction);
    if (!refererName)
        _timeoutFunction = setTimeout("normalSearch('" + partnerName + "')", _WAIT_TIME);
    else
        _timeoutFunction = setTimeout("normalSearch('" + partnerName + "','" + refererName + "')", _WAIT_TIME);

}

function normalSearch(partnerName, refererName) {
    if (isOpen == false)
        return;

    // Obter objectos
    var PanelSearch = document.getElementById("PanelSearch");
    var ifr = document.getElementById("ifr");
    var txtSearch = document.getElementById("txtSearch");

    // Testar se há algo para procurar
    if (!txtSearch.value) {
        closeResultPanel();
        return;
    }

    // Gif de actividade
    showPreLoad('loaderImg');
    openResultPanel();
    ifr.src = "";


    // Função que vai receber a resposta ajax
    ifr.src = "http://www.myway.pt/ground/PartnerSearch.aspx?search=" + txtSearch.value + "&partner=" + partnerName;

    if (refererName)
        ifr.src += "&referer=" + refererName;
}

function onTxtSearchKeyUpDark(partnerName) {
    if (_timeoutFunction != null) clearTimeout(_timeoutFunction);
    _timeoutFunction = setTimeout("normalSearchDark('" + partnerName + "')", _WAIT_TIME);
}

function normalSearchDark(partnerName) {
    if (isOpen == false)
        return;

    // Obter objectos
    var PanelSearch = document.getElementById("PanelSearch");
    var ifr = document.getElementById("ifr");
    var txtSearch = document.getElementById("txtSearch");

    // Testar se há algo para procurar
    if (!txtSearch.value) {
        closeResultPanel();
        return;
    }

    // Gif de actividade
    showPreLoad('loaderImg');
    openResultPanel();
    ifr.src = "";


    // Função que vai receber a resposta ajax
    ifr.src = "http://www.myway.pt/ground/PartnerSearchDark.aspx?search=" + txtSearch.value + "&partner=" + partnerName;
}
function iframeLoaded() {
    hidePreLoad('loaderImg');
}

function ajaxSearch(partnerName) {
    if (isOpen == false)
        return;

    // Obter objectos
    var PanelSearch = document.getElementById("PanelSearch");
    var txtSearch = document.getElementById("txtSearch");

    // Testar se há algo para procurar
    if (txtSearch.value == '') {
        closeResultPanel();
        return;
    }

    // Gif de actividade
    showPreLoad('loaderImg');
    PanelSearch.innerHTML = '';
    openResultPanel();


    ajaxRequest = getAjaxRequest();  // Obter objecto ajax

    // Função que vai receber a resposta ajax
    ajaxRequest.onreadystatechange = function() {
        if (ajaxRequest.readyState == 4) {
            var PanelSearch = document.getElementById("PanelSearch");

            PanelSearch.innerHTML = ajaxRequest.responseText;
            hidePreLoad('loaderImg');
        }
    }
    ajaxRequest.open("GET", "http://www.myway.pt/ground/PartnerSearch.aspx?search=" + txtSearch.value + "&partner=" + partnerName, true);
    ajaxRequest.send(null);
}

function getAjaxRequest() {
    if (ajaxRequest) {
        ajaxRequest.abort();

        return ajaxRequest;
    }
    var request = false;
    try {
        request = new ActiveXObject('Msxml2.XMLHTTP');
    }
    catch (err2) {
        try {
            request = new ActiveXObject('Microsoft.XMLHTTP');
        }
        catch (err3) {
            try {
                request = new XMLHttpRequest();
            }
            catch (err1) {
                request = false;
            }
        }
    }
    return request;
}

function openResultPanel() {
    var ifr = document.getElementById("ifr");
    showPreLoad('PanelSearch');
    showPreLoad('btFechar');
    ifr.height = "360px";
    ifr.width = "275px";
}
function closeResultPanel() {
    var ifr = document.getElementById("ifr");
    hidePreLoad('PanelSearch');
    hidePreLoad('btFechar');
    ifr.height = "1px";
    ifr.width = "1px";
}


// Mostrar um DIV invisivel
function showPreLoad(a) {
    var objPreload = document.getElementById(a);
    if (objPreload != null) {
        objPreload.style.visibility = "visible";
        objPreload.style.display = "block";
    }
}
// Esconder um DIV invisivel
function hidePreLoad(a) {
    var objPreload = document.getElementById(a);
    if (objPreload != null) {
        objPreload.style.visibility = "hidden";
        objPreload.style.display = "none";
    }
}


// Abrir e fechar a barra de procura
var isOpen = false;

function toggleFold() {
    if (isOpen == true) {
        closeBar();
    }
    else {
        openBar();
    }
}

// Abrir a barra de procura
function openBar() {
    var searchBarTop = document.getElementById("searchBarTop");
    var slidingBar = document.getElementById("slidingBar");
    var currentMargin = parseInt(slidingBar.style.marginLeft);
    var txtSearch = document.getElementById("txtSearch");
    searchBarTop.style.width = "280px";
    if (currentMargin >= 0) {
        slidingBar.style.marginLeft = "0px";
        isOpen = true;
        showPreLoad("imgBtClose");
        hidePreLoad("imgBtOpen");
    }
    else {
        txtSearch.value = 'Procurar artista ou género';
        slidingBar.style.marginLeft = (currentMargin - ((currentMargin / 5))) + "px";
        setTimeout('openBar()', 10);
    }
}
// Fechar a barra de procura
function closeBar() {
    closeResultPanel();
    var searchBarTop = document.getElementById("searchBarTop");
    var slidingBar = document.getElementById("slidingBar");
    var currentMargin = parseInt(slidingBar.style.marginLeft);
    if (currentMargin <= -205) {
        slidingBar.style.marginLeft = "-205px";
        isOpen = false;
        hidePreLoad("imgBtClose");
        showPreLoad("imgBtOpen");
        searchBarTop.style.width = "80px";
    }
    else {
        var delta = 205 + currentMargin;
        slidingBar.style.marginLeft = currentMargin - (1 + (delta / 5)) + "px";
        setTimeout('closeBar()', 10);
    }
}


// Apagar o conteudo da barra de procura
function onFocusInput(a) {
    if (a.value == 'Procurar artista ou género') {
        a.value = '';
    }
}

function openWidget(url) {
    window.open(url, 'mywayWidgetWindow', 'width=480,height=400,location=no,toolbar=no,menubar=no,resizable=no,status=no,scrollbars=no');
}



function showPanel() {
    $('#BigPanel').fadeIn('fast', function() {
        $('#BigPanel').animate({ left: '99px' }, 'slow', function() {
            $('#BigPanelOpcoesIn').fadeIn('slow');
        });
    });
}

function hidePanel() {
    $('#BigPanelOpcoesIn').fadeOut('slow', function() {
        $('#BigPanel').animate({ left: '-72px' }, 'slow', function() {
            $('#BigPanel').fadeOut('fast');
        });
    });
}





