//----------------------------------------------------------------------------
// Назначение:              функция открытия окна
// Возвращаемое значение:	
// Параметры:				sURL - адрес, sName - имя окна, iWidth - ширина, iHeight - высота, iType - тип
function windowOpen( sURL, sName, iWidth, iHeight, iType) {
	if( iType == 0) {
		window.open( sURL, sName, 'toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}

	if( iType == 1) {
		//without scrollbars
		window.open( sURL, sName, 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	
	if( iType == 2) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=1,location=0,status=1,menubar=1,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	if( iType == 3) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=0,location=0,status=0,menubar=1,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	if( iType == 4) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=1,location=0,status=0,menubar=0,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	if( iType == 5) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=0,location=0,status=0,menubar=1,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	return false;
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		pagecut_04_over = newImage("images/pagecut_04-over.gif");
		over = newImage("images/pagecut_05-over.gif");
		pagecut_06_over = newImage("images/pagecut_06-over.gif");
		pagecut_07_over = newImage("images/pagecut_07-over.gif");
		pagecut_08_over = newImage("images/pagecut_08-over.gif");
		pagecut_09_over = newImage("images/pagecut_09-over.gif");
		pagecut_10_over = newImage("images/pagecut_10-over.gif");
		pagecut_11_over = newImage("images/pagecut_11-over.gif");
		pagecut_12_over = newImage("images/pagecut_12-over.gif");
		pagecut_13_over = newImage("images/pagecut_13-over.gif");
		pagecut_14_over = newImage("images/pagecut_14-over.gif");
		pagecut_15_over = newImage("images/pagecut_15-over.gif");
		preloadFlag = true;
	}
}