var base="file://D:/Daten/WWW/oasisapartamentos/pages/";
if(location.href.substr(0,4) == 'http') base="http://www.oasisapartamentos.de/";
//---------------------------------------------------------------------------------------------- 
var dirsep = '\\';
if(document.URL.substr(0,4) == 'http') dirsep = '/';
//dirsep = '/';
var imgPath = "../../images/";
function changemap()
{
	for(i=0;i<document.images.length;i++)
	{
		if(document.images[i].name = 'map') idx = i;
	}
	var map = new Array();
	map[0] = new Image(); map[0].name = "map_xl.gif"; map[0].src = imgPath + map[0].name;
	map[1] = new Image(); map[1].name = "map_m.gif";  map[1].src = imgPath + map[1].name;
	if(document.images[idx].src.indexOf(map[0].name) >= 0)
	{
		document.images[idx].src = map[1].src
	}
	else
	{
		document.images[idx].src = map[0].src
	}
}

function toframe(url)
{
	if (this.document == top.document)
	{
		top.location.href = "../index.html";
	}
	else
	{
		parent.Select.setMenu(url);
		this.focus();
	}
}

function NewWin(URL,NAME,h,w)
{
	if(h<screen.availHeight && w<screen.availWidth)
	{
		options="status=no,location=no,menubar=no,directories=no,scrollbars=no,height="+h+",width="+w;
	}else{
		options="status=no,location=no,menubar=no,directories=no,scrollbars=yes,height="+h+",width="+w;
	}
	window.open(URL,NAME,options);
}



var Imag=0;
var base;
var imgbase;

//---------------------------------------------------------------------------------------------- 
function ShowPicture(anc)
{
	htm = base+"image.html";
	h = 20;
	w = 400;
	var opts = "scrollbars=no,toolbar=no,status=no,menubar=no,location=no,rezisable=yes,width="+w+",height="+h;
	Imag = window.open(htm,"Img",opts);
	pic=anc.childNodes[0].src;
	pic=pic.substr(0,pic.length-6) + '.jpg'; // Vorschau auf _s.jpg
	parent.Select.document.CacheImage.src = pic;
	//alert(parent.Select.document.CacheImage.height);
	return;
}
//---------------------------------------------------------------------------------------------- 
function loadImage()
{
	pic = document.ShowImage;
	pic.src = opener.parent.Select.document.CacheImage.src;
	setTimeout('resizeToImage()',60);
}
//---------------------------------------------------------------------------------------------- 
function resizeToImage()
{
	pic = document.ShowImage;
//	pic.style.visibility = "hidden";
	h = pic.height;
	w = pic.width;
	if(w < 100)
	{
		setTimeout('resizeToImage()',600);
	}
	else
	{
		pic.style.visibility = "visible";
		self.resizeTo(w,h);
		if(window.innerHeight)
		{
			nh = h;
			nw = w;
			if(self.innerHeight < h) nh = nh + 50;
			if(self.innerWidth < w) nw = nw + 30;
			self.resizeTo(nw,nh);
			self.innerHeight = h+2;
			self.innerWidth = w+2;
//		alert(self.innerHeight);
		}
		else
		{
			h += 30;
			w += 12;
			self.resizeTo(w,h);
		}
		var x = (screen.availWidth - w - 150) / 3;
		var y = (screen.availHeight - h - 30) / 3;
		if(x < 0) x=0;
		if(y < 0) y=0;
		self.moveTo(x,y);
		self.focus();
	}
}
//---------------------------------------------------------------------------------------------- 
function ArchivPicture(PicTitle,pic)
{
	base="../";
	imgbase="";
	ShowPic(PicTitle, pic, base, imgbase);
}

function ShowPic(PicTitle, pic, base, imgbase)
{
var max_extend=700;
var width=screen.availWidth*0.9;
if(width > max_extend) width=max_extend;
var height=screen.availHeight-20;
if(height > max_extend) height=max_extend;
var opts = "Scrollbars=no,toolbar=no,status=no,menubar=no,location=no,rezisable=no,width="+width+",height="+height;
pic=pic+"_xl.jpg";
height-=20;
Imag=window.open("","Img",opts);
Imag.moveTo(10,10);
Imag.document.open("text/html");
Imag.document.write("<html><head><title>" +PicTitle + "</title></head>"
+ "<link href='"+ base +"format.css' rel=stylesheet type=text/css>"
+ "<body class='ImgWindow'><center><table cellpadding=0 cellspacing=0><tr><td><img src=" + imgbase + "empty.gif height="+ height +" width=1></td><td valign='middle'>"
+ "<a href='JavaScript:window.close()'><img src=" + imgbase + pic + " border=1 alt='close window'></a>"
+ "</td><td><img src=" + imgbase + "empty.gif height="+ height +" width=1></td></tr></table></center></body></html>");
Imag.document.close;
Imag.focus();
return;
}

function print_doc(doc)
{
	//doc.blur();
	//alert(doc.frames.length);
	doc.print();
	doc.focus();
}
