//Размер окна по горизонтали(по X)
var getDocumentWidth = function()
{
   return (window.innerWidth)?window.innerWidth:((document.all)?document.documentElement.offsetWidth:null);
};
//Размер окна по вертикали(по Y)
var getDocumentHeight = function()
{
   return (window.innerHeight)?window.innerHeight:((document.all)?document.documentElement.offsetHeight:null);
};
// На сколько проскролена страница по X
var getBodyScrollLeft = function()
{
   return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
};
// На сколько проскролена страница по Y
var getBodyScrollTop = function()
{
   return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
};
// Ценрт монитора с учётом скрола по X
var getClientCenterX = function()
{
   return parseInt(getDocumentWidth()/2)+getBodyScrollLeft();
};
// Ценрт монитора с учётом скрола по Y
var getClientCenterY = function()
{
   return parseInt(getDocumentHeight()/2)+getBodyScrollTop();
};




function show_block(id, side, show_text, hide_text)
{
s=document.getElementById(side+'_block_'+id);
a=document.getElementById(side+'_ar_'+id);
if(s.style.display=='block') 
{
s.style.visibility='hidden'; 
s.style.display='none'
a.innerHTML="<img src='images/menu_ar.gif' vspace='0' hspace='3' title='"+hide_text+"'>";
}
else 
{
s.style.visibility='visible'; 
s.style.display='block'
a.innerHTML="<img src='images/menu_ar_on.gif' vspace='0' hspace='3' title='"+show_text+"'>";
}

//alert(id);
}
						 
									 
									 
function ch_color(elem, color)
{
elem.bgColor='#'+color;
}			


function paint_show_paint_flash(id)
    {
		
       var url    = 'content/paint_show_paint_flash.php';	   	   
      var params = 'id='+id;
//alert(params);
var myAjax = new Ajax.Request( url, {method: 'post', parameters: params, onComplete: showResponse_mail, onCreate : indicate} );

    }
	


function paint_show_paints(undergroup, group, pos, page_pos, width, flash)
    {
		flash_param='';
		add='';
	   if(flash=='1') {flash_param='flash=1&'; add='_flash';}
       var url    = 'content/paint_show_paints'+add+'.php';	   	   
      var params = flash_param+'undergroup='+undergroup+'&group='+group+'&pos='+pos+'&page_pos='+page_pos+'&width='+width;
//alert(params);
var myAjax = new Ajax.Request( url, {method: 'post', parameters: params, onComplete: showResponse_mail, onCreate : indicate} );

    }


function index_show_groups(undergroup, pos, page_pos, width, flash)
    {
       var url    = 'content/index_show_groups.php';
	   flash_param='';
	   if(flash=='1') flash_param='flash=1&';
      var params = flash_param+'undergroup='+undergroup+'&pos='+pos+'&page_pos='+page_pos+'&width='+width;
//alert(params);
var myAjax = new Ajax.Request( url, {method: 'post', parameters: params, onComplete: showResponse_mail, onCreate : indicate} );

    }

	
	function game_show_scr(id, no)
    {
       var url    = 'content/game_show_scr.php';
       var params = 'id='+id+'&no='+no;
        
var myAjax = new Ajax.Request( url, {method: 'post', parameters: params, onComplete: showResponse_mail, onCreate : indicate} );

    }

    function showResponse_mail(originalRequest)
    {
        //put returned XML in the textarea
        $('send_block').update(originalRequest.responseText);
		$('indicator').hide();
		$('send_block').show();
		   
    }
	
	
	


function mail_send()
    {
       var url    = 'content/mail_send.php';
       var params = 'email='+$F('emailo')+'&name='+$F('name')+'&text='+$F('text')+'&number='+$F('number');
        
var myAjax = new Ajax.Request( url, {method: 'post', parameters: params, onComplete: showResponse_mail, onCreate : indicate} );

    }

    function showResponse_mail(originalRequest)
    {
        //put returned XML in the textarea
        $('send_block').update(originalRequest.responseText);
		$('indicator').hide();
		$('send_block').show();
		   
    }
	
	
	
	
	
	//ВСПЛЫВАЮЩАЯ ПОДСКАЗКА ДЛЯ ФЛЕШ_РАСКРАСОК
/*
Cursor scroller script- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/
var initialvisible=0
	function show_tip_paint_flash()
{
if (initialvisible==0){
$('curscroll').style.visibility="visible"
initialvisible=1
}
$('curscroll').style.left=document.body.scrollLeft+event.clientX-140;
$('curscroll').style.top=document.body.scrollTop+event.clientY+10;
}

function hide_tip_paint_flash()
{
if (initialvisible==1){
$('curscroll').style.visibility="hidden";
initialvisible=0;
}
}

	
	
	
	
	
	
	
	
	
	function indicate(originalRequest)
    {
        //put returned XML in the textarea
	$('send_block').hide();
     $('indicator').show();
    }
