function SmallWindow (){
	scrollbars=0;
	w=window.open('', 'ph_1', 'width=350 ,height=200 ,status=0,toolbar=0,resizable=1, top=100, left=100,scrollbars=no');
	w.document.open();
	w.document.write('<HTML><HEAD><TITLE>Как попасть в справочник?</TITLE></HEAD>');
	w.document.write('<link rel=stylesheet href="http://izhevskinfo.ru/css/main.css" type="text/css">');
	w.document.write('<BODY bgcolor="#ffffff" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10" marginwidth="0" marginheight="0">');
	w.document.write('<div style="padding: 10px;">Размещение в справочнике предприятий на портале ИжевскИнфо — это эффективный способ продвижения Вашей компании в Интернете. Стоимость размещения от 300 руб. в месяц. Любые обновления на Вашей странице бесплатно. Если Вас заинтересовало размещение Вам необходимо связаться с нами по тел. (3412) 61-33-34, 61-34-33 или написать в разделе <a href="http://izhevskinfo.ru/svyaz.php" target="_blank" style="color: #105a9c; text-decoration: underline; cursor: hand">Обратная связь</a>.</div>');
	w.document.write('</BODY></HTML>');
	w.document.close();
	if (w!=null){w.focus();};
}

function SmallImage (url, resX, resY, title, uid) {
	maxX=screen.availWidth;
	maxY=screen.availHeight;
	scrollbars=0;
	if (resX>maxX) {reX=maxX;leftC=0;scrollbars=1;}else {reX=resX+5;leftC=(maxX-resX)/2;}
	if (resY>maxY) {reY=maxY;topC=0;scrollbars=1;}else {reY=resY;topC=(maxY-resY)/2;}
	w=window.open('', 'ph_'+uid, 'width=' + reX + ',height=' + reY+',status=0,toolbar=0,resizable=1, top='+topC+', left='+leftC+',scrollbars='+scrollbars);
	if (title!=""){title1=title;}else{	title1=url;}
	w.document.open();
	w.document.write('<HTML><HEAD><TITLE>' + title1 + '</TITLE></HEAD>');
	w.document.write('<BODY bgcolor="#ffffff" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">');
	w.document.write('<CENTER><A href="javascript:window.close();">');
	w.document.write('<IMG border=0 align=center src="'+url+'" alt="'+title+' \Нажмите левую кнопку мыши чтобы закрыть окно" width="'+resX+'" height="'+resY+'">');
	w.document.write('</A></BODY></HTML>');
	w.document.close();
	if (w!=null){w.focus();};

}

var marked_row = new Array;
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor){
    var theCells = null;
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;

    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    }



    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    }
    if (newColor) {
        var c = null;
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            }
        }
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    }

    return true;
} 
