﻿// JScript File

var WinHandle;
function BigImageShow(id,index,lang){
    CompletePath="ImageView.aspx?id="+id+"&index="+index+"&lang="+lang;
    WinHandle=window.open(CompletePath,'Ditynna',config='toolbar=no,menubar=no,location=no,directories=no,status=no,screenX=50,screenY=50,left=50,top=50');
    WinHandle.focus();
}

function Resize(Cid){
    var Cimage;    
    Cimage=document.getElementById(Cid);

    var Height=parseInt(Cimage.height)+100;
    var Width=parseInt(Cimage.width)+250;
    if (Height<100)
        Height=100;
    if (Width<100)
        Width=100;
    window.resizeTo(Width,Height);

    var OffsetX=Width/2;
    window.moveTo(screen.width/2-OffsetX,50);
//    var Logo1=document.getElementById("LogoImage");
//    Logo1.style.top=(-90)+"px";
//    Logo1.style.left=(Width/2-75)+"px";
}


function MapShow(id,lang){
    CompletePath="map.aspx?id="+id+"&lang="+lang;
    window.open(CompletePath,'Ditynna',config='toolbar=no,menubar=no,location=no,directories=no,status=no,screenX=50,screenY=50,left=50,top=50');
}

function WindowSize800x600()
{
    window.resizeTo(800,620);
}



function Map_load(MyText,x,y) {
    if (GBrowserIsCompatible()) {
        var DivMap = document.getElementById("map")
        if(DivMap){
            var map = new GMap2(document.getElementById("map"));
            map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());
            map.setCenter(new GLatLng(x,y), 15);

            var point = new GLatLng(x,y);
            var marker = new GMarker(point);
            GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(MyText);});
            
            map.addOverlay(marker);
        }
    }
}

function ShowMail(HoverPanel){
    var MailDiv= document.getElementById(HoverPanel);
    MailDiv.style.display="block";
    MailDiv.style.height="auto"
}

function HideMail(HoverPanel){
    var MailDiv= document.getElementById(HoverPanel);
    MailDiv.style.display="none";
    MailDiv.style.height=0+"px";
}


function printpage() { 
bV = parseInt(navigator.appVersion); 
document.getElementById("btnToPrint").style.visibility='hidden'; 
document.getElementById("mypanel").style.visibility='hidden'; 
if (bV >= 4) window.print(); 
return false; 
} 

var ShowedRooms=1;

function Addroom(HF1Id){
    var Room2Label=document.getElementById('Room2Label');
    var Room3Label=document.getElementById('Room3Label');   
    var Room4Label=document.getElementById('Room4Label');
    var HF1=document.getElementById(HF1Id);
     
    if (ShowedRooms<4){
        ShowedRooms=ShowedRooms+1;
        HF1.value=ShowedRooms;
    }
        
    if (ShowedRooms>1){
        Room2Label.style.display="";
    }
    if (ShowedRooms>2){
        Room3Label.style.display="";
    }
    if (ShowedRooms>3){
        Room4Label.style.display="";
    }

}

function Removeroom(HF1Id){
    var Room2Label=document.getElementById('Room2Label');
    var Room3Label=document.getElementById('Room3Label');   
    var Room4Label=document.getElementById('Room4Label');
    var HF1=document.getElementById(HF1Id);
     
    if (ShowedRooms>1){
        ShowedRooms=ShowedRooms-1;
        HF1.value=ShowedRooms;
    }
        
    if (ShowedRooms<2){
        Room2Label.style.display="none";
    }
    if (ShowedRooms<3){
        Room3Label.style.display="none";
    }
    if (ShowedRooms<4){
        Room4Label.style.display="none";
    }
}
