///////////////////////
// Pop-up a new window, given its URL
function popup(url,name){
    window.open(url,name,config='height=500,width=600,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
}

function loadMap() {

    if (GBrowserIsCompatible()) {
      var map = new GMap2(document.getElementById("map_canvas"));
          map.setCenter(new GLatLng(45.2875995, 4.1614499), 14);
          map.addControl(new GSmallMapControl());
          map.addControl(new GMapTypeControl());
          var point = new GLatLng(45.2875995, 4.1614499);
          map.addOverlay(new GMarker(point));
    }


    // Display the map centered on a geocoded location
    map.drawZoomAndCenter("7 rue d'aguesseau lyon 69007,FRANCE", 6);

    map.addMarker("7 rue d'aguesseau lyon 69007,FRANCE");

}

function hideThumbnail(id){
    if(document.all){
        //document.getElementById('thumbnail_'+id).style.setAttribute('cssText','display:none;');
    }
    else{
        document.getElementById('thumbnail_'+id).setAttribute('style','display:none;');
    }
}

function showThumbnail(id){
    if(document.all){
        //document.getElementById('thumbnail_'+id).style.setAttribute('cssText','display:block;position:absolute;top:0;width:128px;height:170px;');
    }
    else{
        document.getElementById('thumbnail_'+id).setAttribute('style','display:block;position:absolute;margin:-170px auto auto 0px;float:left;');
    }
}

function returnPos(nb){
    var i=1;
    while(document.getElementById('item_'+i)){
        var item = 'item_'+i;
        var item_name = 'pos_'+i;
        var pos = document.getElementById(item).offsetTop;
        document.getElementById('pos_'+i).setAttribute('value',pos);
        i++;
    }
}

function reorderProducts(){
    //document.getElementById('sizer').setAttribute('style','width:290px;');
    var i=1;

    while(document.getElementById('product_id_'+i)){
        var pos = document.getElementById('item_'+i).offsetTop;
        document.getElementById('product_pos_'+i).setAttribute('value',pos);
        i++;
    }
}

function raiseSubMenu(id){
    if(document.all){
        document.getElementById('submenu_'+id).style.setAttribute('cssText','display:block;list-style-type:none;margin:-45px 0 0 0;');
        var links = document.getElementById('submenu_'+id).childNodes;
        for(var i=0;i<links.length;i++) {
            links[i].firstChild.style.setAttribute('cssText','color:#4d4d4d;font-size:15px;margin:0;padding:0;width:100%;height:100%;display:block;text-align:left;');
            links[i].style.setAttribute('cssText','color:#4d4d4d;border:0;margin:0;padding:0;padding-left:190px;');
        }
    }
    else{
        document.getElementById('submenu_'+id).setAttribute('style','display:block;list-style-type:none;border-right:0px solid #4d4d4d');
        var links = document.getElementById('submenu_'+id).childNodes;
        for(var i=0;i<links.length;i++) {
            links[i].firstChild.setAttribute('style','color:#4d4d4d;font-size:15px;margin:0;padding:0;width:100%;display:block;height:100%;');
            links[i].setAttribute('style','color:#4d4d4d;border:0;margin:0;padding0;');
        }
    }
}

function hideSubMenu(id){
    if(document.all){
        document.getElementById('submenu_'+id).style.setAttribute('cssText','display:none;');
    }
    else{
        document.getElementById('submenu_'+id).setAttribute('style','display:none;');
    }
}

function ReadyForSearch() {
    document.getElementById('searchInput').value='';
    if(document.all){
        document.getElementById('searchInput').style.setAttribute('cssText','width:160px;height:28px;color:#4d4d4d;float:left;font-size:14px;');
    }
    else{
        document.getElementById('searchInput').setAttribute('style','width:160px;height:28px;color:#4d4d4d;float:left;font-size:14px;');
    }
}
