//----------------------------------------------------------------------------
// Назначение:              функция открытия окна
// Возвращаемое значение:	
// Параметры:				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 change_item(action, rid, mid, new_pos) {
	opener.location = 'materials.asp?action='+action+'&RID='+rid+'&mid='+mid+'&new_pos='+new_pos;
	window.close();
}