// ------------------------------------
function getObject(id) {
	return document.getElementById(id);
}
// toggleFontSize
var currentFontSize = 2;
var fontRange = 5;

function toggleFontSize(d) {
	var content;
	for(var i=0; i<3; i++) {
		content = getObject('contenttype' + i);
		if(content != null) break;
	}

	
	currentFontSize = (fontRange + currentFontSize + d)%fontRange;
	content.className = 'fontSize' + (currentFontSize + 1);
}

function popUpWindow(URLStr, left, top, width, height)
{
   popUpWin = window.open('', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
   popUpWin.document.writeln("<html><head />");
   popUpWin.document.writeln('<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginheight="0" marginwidth="0">');
   popUpWin.document.writeln('<img src="' + URLStr + '" border="0" alt="Закрыть окно" onclick="window.close()">');
   popUpWin.document.writeln("</html>");
}

function getMainLocation() {
	var strLocation = window.location.href;
	var mainLocation;
	var modeStr = "&mode29";
	if (strLocation.indexOf(modeStr) > 0) {
        mainLocation = strLocation.substr(0,strLocation.indexOf(modeStr));
	}
	else {
	    mainLocation = strLocation;
	}
	return mainLocation;
}

function modeLink(intMode) {
	var strHref;
	strHref = getMainLocation();
	strHref += "&mode29=" + intMode.toString();
	strLink = '<div style="position:absolute; top:0px; left:371px; "><a href="' + strHref + '"><img src="/common/img/uploaded/details-corner.gif" width="91" height="19" border="0" alt="Подробнее"></a></div>'; 
	switch (intMode) {
	    case 0:
		   strLink = 'Безопасность';
		break;
		case 1:
		   strLink = 'Интерьер' + strLink;
		break;
		case 2:
		   strLink = 'Экстерьер' + strLink;
		break;
	    case 4:
		   strLink = 'Технические характеристики' + strLink;
		break;
	}
	return strLink;
}