function subscribe(){
    if (document.getElementById('subscribe').checked)
        document.location.href='http://subscribe.ru/member/quick?action=quick&grp=inet.review.listzone&email='+document.getElementById('Mail').value+'&src=list_inet.review.listzone';
    if (document.getElementById('content_mail').checked)
        document.location.href='http://content.mail.ru/cgi-bin/subscribe.cgi?list_id=11066&theme=content_new&email='+document.getElementById('Mail').value+'&ok=OK';
    if (document.getElementById('maillist').checked) 
        document.location.href='http://www.maillist.ru/cgi/ml_fs.cgi?email='+document.getElementById('Mail').value+'&topic=1701&subscribe=Подписаться';
}


function $(id){
	return document.getElementById(id);	
}
	

function matchClass( objNode, strCurrClass ) {
	return ( objNode && objNode.className.length && objNode.className.match( new RegExp('(^|\\s+)(' + strCurrClass + ')($|\\s+)') ) );
}

function sbnn(){
    return true;
    banner = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="468" height="60" id="flc">'
+'<param name="movie" value="/images/kltt/PW-water-240x400_best-soft.swf" />'
+'<!--[if !IE]>-->'
+'<object type="application/x-shockwave-flash" data="/images/kltt/PW-water-240x400_best-soft.swf" width="468" height="60">'
+'<!--<![endif]-->'
+'<p>Alternative content</p>'
+'<!--[if !IE]>-->'
+'</object>'
+'<!--<![endif]-->'
+'</object>';
$('i7y').innerHTML = banner; 
    return true;
    //$('i7y').innerHTML='<table align=center cellpadding="2" cellspacing="0" width=468><tr><td><a href="http://superfastcomputer.ru/?r=best-soft&p=782" target="_blank"><img src="http://89.108.72.16/rm/raznoe/sfcfsoft.gif" border="0" title="Ускоритель компьютера!" alt="Ускоритель компьютера!" style="padding-right: 0px; width: 60px; height:60px;" /></a></td><td align=left><a href="http://superfastcomputer.ru/?r=best-soft&p=782" target="_blank"><font face=verdana size=3><b>Тормозит компьютер?</b></font></a><br /><div style="font-size: 12px;">Хотите разогнать ваш компьютер и интернет?<br />Мощнейший ускоритель поможет Вам!<br /><b>100% гарантия результата!</b> <a href="http://superfastcomputer.ru/?r=best-soft&p=782" target="_blank">Подробнее...</a></div></td></tr></table>';
    return true;
    qwe = 'http:'+'//idealp'+'rice.ru/invitation/slanustoubeacutid'+'/?_openstat=YmVzdC1zb2Z0O3NpdGU7YmFubmVyO2Jlc3Qtc29mdA';
    $('design_ra').innerHTML = 'Дизайн сайта — <'+'a hr'+'ef="ht'+'tp://www.in'+'-adv.c'+'om/">РА «INT'+'ELLIGENCE»</'+'a>';
     if ($('iphtg6')!==null){
         //$('iphtg6').innerHTML='<br /><a target="_blank" href="'+qwe+'"><img alt="Клуб разумных покупателей" border="0" src="/images/ip1.jpg"  /></a><br /><br />';
     } else $('i7y').innerHTML='<a target="_blank" href="'+qwe+'"><img alt="Клуб разумных покупателей" border="0" src="/images/b.jpg" width="468" height="60" /></a>'; 
     
     
}   

function getElementsByClassName(objParentNode, strNodeName, strClassName){
	var nodes = objParentNode.getElementsByTagName(strNodeName);
	if(!strClassName){
		return nodes;	
	}
	var nodesWithClassName = [];
	for(var i=0; i<nodes.length; i++){
		if(matchClass( nodes[i], strClassName )){
			//nodesWithClassName.push(nodes[i]);
			nodesWithClassName[nodesWithClassName.length] = nodes[i];
		}	
	}
	return nodesWithClassName;
}


function getMousePosition(e) {
	if (e.pageX || e.pageY){
		var posX = e.pageX;
		var posY = e.pageY;
	}else if (e.clientX || e.clientY) 	{
		var posX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		var posY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
	return {x:posX, y:posY}	
}


function openBig(id, img_w, img_h) {
    win_h=img_h+20;
    win_w=img_w+20;      
    main_big=window.open('/screen/'+id+'/','','scrollbars=0,resizable=1,width='+win_w+', height='+win_h+',toolbar=0');
}

 function marks(id,type, cur_mark)
  {
    if (!document.images)
     {
       return false;
     }
    for (i=1;i<=id;i++)
     {
       if (type=="show")
        {
          document.images["mark"+i].src=mark_show.src;
        }
       else if (type=="hide" && i>cur_mark)
        {
          document.images["mark"+i].src=mark_hide.src;
        }
     }
  }
  
  function stopmark(){
      document.getElementById('result_mark').innerHTML='Проставление оценок доступно только <a href=/auth/>авторизованным</a> пользователям';
  }
  
  
function addmark(id, pid){
    for (i=1; i<=5; i++){
        document.images["mark"+i].src=mark_hide.src;
        document.images["mark"+i].onmouseout = 'marks('+id+',\'hide\'); ';
    }
    for (i=1; i<=id; i++){
        document.images["mark"+i].src=mark_show.src;
        document.images["mark"+i].onmouseout = null;
    }
        document.getElementById('result_mark').innerHTML = '<img width="16" height="16" src="/images/ajax/podbor_loading.gif" alt="" style="vertical-align: middle;" /> Отправляем...';
        var req = new JsHttpRequest();
        req.caching = false; 
        req.onreadystatechange = function() { 
            if (req.readyState == 4) {  
                document.getElementById('result_mark').innerHTML = '<img width="16" height="16" src="/images/ajax/ok.png" alt="" style="vertical-align: middle;" /> Оценка принята'+req.responseText;
                document.getElementById('mark_res').innerHTML = req.responseJS.res;
            }
    }
    req.open(null, '/inc/ajax/backend/addMark.php', true); 
    req.send( { prid: pid, mark: id } ); 
}



function AddProgramInPage(pid){
    //
        document.getElementById('addProgramResult').innerHTML = 'Секундочку...';
        var req = new JsHttpRequest();
        req.caching = false; 
        req.onreadystatechange = function() { 
            if (req.readyState == 4) { 
                document.getElementById('addProgramResult').innerHTML = req.responseJS.res;
            }
    }
    req.open(null, '/inc/ajax/backend/chProgramPage.php', true); 
    req.send( { prid: pid } ); 
}


function tabshow(id){
                        for (i=0; i<4; i++){
                            if (i!=id) {
                                $('tab'+i).style.display='none';
                                $('th'+i).className='inactive';
                            } else {
                                $('tab'+i).style.display='block';
                                $('th'+i).className='active';

                            }
                        }
                    }