
// [ To get info about last values of 'stringIdentifier' and 'objectIdentifier'
//   see global variables 'lastStringIdentifier' and 'lastObjectIdentifier'. ]

var lastStringIdentifier = new String();
var lastObjectIdentifier = new String();

function swapImage(stringIdentifier,objectIdentifier) {
	lastStringIdentifier = stringIdentifier;
	lastObjectIdentifier = objectIdentifier;
	document.getElementById(objectIdentifier).src='/img/main/KolMax_Global_Menu_Leaf'+ stringIdentifier +'.png';
}


var scaleFactor = .85;
var windowWidth = 600;
var windowHeight = 800;

function showAward(awardFileName) {
	var screenAvailWidth = screen.availWidth;
	var screenAvailHeight = screen.availHeight;

	var windowMaximumWidth = 600;
	var windowMaximumHeight = 800;


	if ((scaleFactor*screenAvailHeight) < windowMaximumHeight) {
		windowHeight = scaleFactor*screenAvailHeight;
		windowWidth = 3/4*windowHeight;
	}

	var windowOpen = window.open('','_blank','width='+windowWidth+',height='+windowHeight+',left='+((screenAvailWidth-windowWidth)/2)+',top='+((screenAvailHeight-windowHeight)/2)+',scrollbars=no');

	var stringOut = new String();
	stringOut += '<head><title>КолМакс - Наши награды</title></head>';
	stringOut += '<body style="background-color:white;padding:0px;margin:0px;">';
	stringOut += '<table cellpadding="0" cellspacing="0" style="position:absolute;left:0px;top:0px;padding:0px;margin:0px;width:'+windowWidth+'px;height:'+windowHeight+'px;"><tr><td><img width="'+windowWidth+'" height="'+windowHeight+'" src="/img/index/'+awardFileName+'"></td></tr></table>';
	stringOut += '<a href="#" onclick="javascript:window.close();"><table cellpadding="0" cellspacing="0" style="position:absolute;left:0px;top:0px;padding:0px;margin:0px;width:'+windowWidth+'px;height:'+windowHeight+'px;"><tr><td title="Закрыть"></td></tr></table></a>';
	stringOut += '</body>';

	windowOpen.document.write(stringOut);
	return false;
}


function showMap(mapFileName) {
	var screenAvailWidth = screen.availWidth;
	var screenAvailHeight = screen.availHeight;

	var windowMaximumWidth = 840;
	var windowMaximumHeight = 383;

	var windowOpen = window.open('','_blank','width='+windowMaximumWidth+',height='+windowMaximumHeight+',left='+((screenAvailWidth-windowMaximumWidth)/2)+',top='+((screenAvailHeight-windowMaximumHeight)/2)+',scrollbars=no');

	var stringOut = new String();
	stringOut += '<head><title>КолМакс - Подробная информация и схема проезда</title></head>';
	stringOut += '<body style="background-color:white;padding:0px;margin:0px;">';
	stringOut += '<table cellpadding="0" cellspacing="0" style="position:absolute;left:0px;top:0px;padding:0px;margin:0px;width:'+windowMaximumWidth+'px;height:'+windowMaximumHeight+'px;"><tr><td><img width="'+windowMaximumWidth+'" height="'+windowMaximumHeight+'" src="/img/index/'+mapFileName+'"></td></tr></table>';
	stringOut += '<a href="#" onclick="javascript:window.close();"><table cellpadding="0" cellspacing="0" style="position:absolute;left:0px;top:0px;padding:0px;margin:0px;width:'+windowMaximumWidth+'px;height:'+windowMaximumHeight+'px;"><tr><td title="Закрыть"></td></tr></table></a>';
	stringOut += '</body>';

	windowOpen.document.write(stringOut);
	return false;
}


function showMap2(mapFileName) {
	var screenAvailWidth = screen.availWidth;
	var screenAvailHeight = screen.availHeight;

	var windowMaximumWidth = 843;
	var windowMaximumHeight = 538;

	var windowOpen = window.open('','_blank','width='+windowMaximumWidth+',height='+windowMaximumHeight+',left='+((screenAvailWidth-windowMaximumWidth)/2)+',top='+((screenAvailHeight-windowMaximumHeight)/2)+',scrollbars=no');

	var stringOut = new String();
	stringOut += '<head><title>КолМакс - Подробная информация и схема проезда</title></head>';
	stringOut += '<body style="background-color:white;padding:0px;margin:0px;">';
	stringOut += '<table cellpadding="0" cellspacing="0" style="position:absolute;left:0px;top:0px;padding:0px;margin:0px;width:'+windowMaximumWidth+'px;height:'+windowMaximumHeight+'px;"><tr><td><img width="'+windowMaximumWidth+'" height="'+windowMaximumHeight+'" src="/img/index/'+mapFileName+'"></td></tr></table>';
	stringOut += '<a href="#" onclick="javascript:window.close();"><table cellpadding="0" cellspacing="0" style="position:absolute;left:0px;top:0px;padding:0px;margin:0px;width:'+windowMaximumWidth+'px;height:'+windowMaximumHeight+'px;"><tr><td title="Закрыть"></td></tr></table></a>';
	stringOut += '</body>';

	windowOpen.document.write(stringOut);
	return false;
}


function showColor(colorFileName) {
	var screenAvailWidth = screen.availWidth;
	var screenAvailHeight = screen.availHeight;

	var windowMaximumWidth = 600;
	var windowMaximumHeight = 800;


	if ((scaleFactor*screenAvailHeight) < windowMaximumHeight) {
		windowHeight = scaleFactor*screenAvailHeight;
		windowWidth = 3/4*windowHeight;
	}

	var windowOpen = window.open('','_blank','width='+windowWidth+',height='+windowHeight+',left='+((screenAvailWidth-windowWidth)/2)+',top='+((screenAvailHeight-windowHeight)/2)+',scrollbars=no');

	var stringOut = new String();
	stringOut += '<head><title></title></head>';
	stringOut += '<body style="background-color:white;padding:0px;margin:0px;">';
	stringOut += '<table cellpadding="0" cellspacing="0" style="position:absolute;left:0px;top:0px;padding:0px;margin:0px;width:'+windowWidth+'px;height:'+windowHeight+'px;"><tr><td><img width="'+windowWidth+'" height="'+windowHeight+'" src="'+colorFileName+'"></td></tr></table>';
	stringOut += '<a href="#" onclick="javascript:window.close();"><table cellpadding="0" cellspacing="0" style="position:absolute;left:0px;top:0px;padding:0px;margin:0px;width:'+windowWidth+'px;height:'+windowHeight+'px;"><tr><td title="Закрыть"></td></tr></table></a>';
	stringOut += '</body>';

	windowOpen.document.write(stringOut);
	return false;
}


