var container=document.getElementById("Hop2Widget");

if( typeof(hop2_widget_url) == "undefined" )
    hop2_widget_url = "www.hop2.com";
    
if( typeof(hop2_lng) == "undefined" )
    hop2_lng = "";
    
var src;


if(typeof(hop2_widget_size) != "undefined")
{
    switch(hop2_widget_size)
    {   
        case "small":
                src= "http://" +hop2_widget_url + "/Widget/Small-SearchAPI.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;
                break;
        case "240x400":
                src= "http://" +hop2_widget_url + "/Widget/SearchAPI-240x400.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;
                break; 
        case "336x280":
                src= "http://" +hop2_widget_url + "/Widget/SearchAPI-336x280.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;
                break; 
         case "336x355":
                src= "http://" +hop2_widget_url + "/Widget/SearchAPI-336x355.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;
                break; 
        case "275x335":
                src= "http://" +hop2_widget_url + "/Widget/SearchAPI-275x335.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;     
                break; 
        case "flighthotel":
                src= "http://" +hop2_widget_url + "/Widget/FB-search.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target ;     
                break; 
        case "noborder":
                src= "http://" +hop2_widget_url + "/Widget/SearchAPI-noborder.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;     
                break;  
        case "181x250":
                src= "http://" +hop2_widget_url + "/Widget/SearchAPI-181x250.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;
                break; 
         case "310x280":
                src= "http://" +hop2_widget_url + "/Widget/SearchAPI-310x351.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;
                break;        
         case "325x280":
                src= "http://" +hop2_widget_url + "/Widget/SearchAPI-325x351.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;
                break;               
        default:
             src= "http://" +hop2_widget_url + "/Widget/SearchAPI.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target + "&lng=" +  hop2_lng;          
    }
}
else
    src= "http://" +hop2_widget_url + "/Widget/SearchAPI.aspx?id=" + hop2_widget_client +"&cid="+hop2_cid +"&target="+hop2_target ;

// Note: Here goes some code that sets the style of the container div to the right width and height


container.innerHTML = "<iframe frameborder='0' allowtransparency='true' marginwidth='0' marginheight='0' scrolling='no' style='visibility: visible; height: " + hop2_widget_height+ "px; width: " + hop2_widget_width + "px;' id='master-1' src='"+src+"'></iframe>"
