var tartomany = "ingatlankozpont.net";
var protokoll = "mailto";

function open_image(src, w, h, alttxt) {
	imageview = window.open("", "imageview", "width=" + w + ",height=" + h);
	imageview.moveTo(Math.round((screen.width-w)/2), Math.round((screen.height-h)/2));
	imageview.document.open();
	imageview.document.write('<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">');
	imageview.document.write('<html><head><title>Kép megtekintése</title><link rel="stylesheet" type="text/css" href="/style.css" /><meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" /><meta http-equiv="author" name="author" content="Mile Informatika - http://www.mile.hu/" /></head>');
	imageview.document.write('<body bgcolor="black" text="silver" link="orange" alink="yellow" vlink="orange" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >');
	imageview.document.write('<a href="#" onClick="window.close();" ><img src="' + src + '" width="' + w + '" height="' + h + '" border="0" alt="' + alttxt + '"/></a></body></html>');
	imageview.document.close();
	// imageview.document.oncontextmenu = RightClicker;
	
}

function load_image(targetlayer, src, w, h) {
	imgtag = '<img src="' + src + '" width="' + w + '" height="' + h + '" border="0" />';
	tw = parseInt(document.getElementById(targetlayer).style.width);
	th = parseInt(document.getElementById(targetlayer).style.height);
	if (tw < w) {
		nw = tw;
		nh = Math.round(h * tw/w);
		imgtag = '<a href="javascript:void(0)" onClick="open_image(\'' + src + '\', ' + w + ', ' + h + ');"><img src="' + src + '" width="' + nw + '" height="' + nh + '" border="0" alt="" title="" /></a>';
	}
	
	if (th < h) {
		nh = th;
		nw = Math.round(w * th/h);
		imgtag = '<a href="javascript:void(0)" onClick="open_image(\'' + src + '\', ' + w + ', ' + h + ');"><img src="' + src + '" width="' + nw + '" height="' + nh + '" border="0" alt="" title="" /></a>';
	}
	document.getElementById(targetlayer).innerHTML = '<table width="' + tw + '" height="' + th + '" border="0" cellpadding="0" cellspacing="0"><tr><td valign="middle" align="center">' + imgtag + '</td></tr></table>';
}

function show_hide_layer(layerid) {
	if (layerid != "") {
		v = document.getElementById(layerid).style.visibility;
		if (v != "visible") v = "visible";
			else v = "hidden";
		document.getElementById(layerid).style.visibility = v;
	}
}

function open_close_layer(layerid) {
	if (layerid != "") {
		d = document.getElementById(layerid).style.display;
		if (d != "block") d = "block";
			else d = "none";
		document.getElementById(layerid).style.display = d;
	}
}

function close_layer(layerid) {
	document.getElementById(layerid).style.display = "none";
}

function open_layer(layerid) {
	document.getElementById(layerid).style.display = "block";
}


function level_kuldes(hova) {
	window.location = protokoll + ":" + hova + "@" + tartomany;
}

function RightClicker() {
   return false;
}

function open_gallery(galeriaid) {
	galleryview = window.open("/gallery.php?id=" + galeriaid, "galleryview", "width=750,height=630"); 
	sw = screen.width;
	sh = screen.height;
	galleryview.moveTo(Math.round((sw-750)/2), Math.round((sh-630)/2));
}

function rating_slider(rate) {
	eval("document.getElementById('ratingimg').src = ratingon" + rate + ".src;"); 
}

for (i=1; i<6; i++) {
	eval("ratingon" + i + " = new Image();");
	eval("ratingon" + i + ".src = \"/data/images/rating" + i + ".gif\";");
}

// document.oncontextmenu = RightClicker;
