var myWidth = 0;
var myHeight = 0;
var pix_width_ori  = 2576;
var pix_height_ori = 1655;
var rect1_bal_ori  = 338;
var rect1_fent_ori = 742;
var rect1_jobb_ori = 1482;
var rect1_lent_ori = 1274;
var rect1_bal;
var rect1_fent;
var rect1_jobb;
var rect1_lent;
var arany;
var meret;
var ter_fent;

if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
	  }

if ((myHeight/pix_height_ori) < (myWidth/pix_width_ori)) {
	arany = myHeight/pix_height_ori;
	meret = ' height = ' + myHeight;
} else {
	arany = myWidth/pix_width_ori;
	ter_fent = Math.round((myHeight-(arany*pix_height_ori))/2);
	meret = 'width = ' + myWidth + ' style=\'margin-top: ' + ter_fent + 'px\' ';
}

function kep_meret() {
document.write('	<DIV ALIGN=CENTER><MAP NAME="map1"><AREA HREF="tartalom.php" ALT="Tartalom" TITLE="Tartalom" SHAPE=RECT COORDS="' + map_coords(rect1_bal_ori,rect1_fent_ori,rect1_jobb_ori,rect1_lent_ori) + '"></MAP>');
document.write('<IMG SRC="pix/Budapestem-nyitokep.jpg" ALT="Budapestem nyitókép" BORDER=0 ' + meret + ' USEMAP="#map1">');
document.write('	</DIV>'); 
}

function map_coords(rect_bal_ori, rect_fent_ori, rect_jobb_ori, rect_lent_ori) {
		rect_bal      = Math.round(rect_bal_ori*(arany));
		rect_fent     = Math.round(rect_fent_ori*(arany));
		rect_jobb     = Math.round(rect_jobb_ori*(arany));
		rect_lent     = Math.round(rect_lent_ori*(arany));
return rect_bal + ',' + rect_fent + ',' + rect_jobb + ',' + rect_lent ;
}

function alertSize() {
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
	  }
	  window.alert( 'Width = ' + myWidth );
	  window.alert( 'Height = ' + myHeight );
	}


kep_meret(); 