// JavaScript Document
var sss="";
function getSelectValue(selectObject)
	{
		//document.write(selectObject).options[selectObject.selectedIndex].value);
		
	return selectObject.options[selectObject.selectedIndex].value
	}
//
function getId(id)
    {
	return document.getElementById(id);
	}
//
function vbrTown(selectObject,id)
	{ var objct=getId(id);
	//document.write(selectObject.value);
		if(getSelectValue(selectObject)!=1)
		{
		objct.style.visibility='hidden';	
		//document.registr.town1.type='hidden';
		}
		else
		{
		//document.registr.town1.type='text';
		objct.style.visibility='visible';
		}
	}
function Pluss(l,n)
{var txt=n.value;
	if (txt!='' && l.value!='')
		{
		//txt="<a href='"+l.value+"'>"+txt+"</a>";
		txt=txt.link(l.value);
		sss="";
		sss=txt+";;;";
		l.value='';
		n.value='';
		document.otvet_n.link_n[0].selected=true;
		txt="";
		document.otvet_n.linkin.value=document.otvet_n.linkin.value+sss;
		}
}
function Back()
	{
	location="http://www.kraslib.ru/index.html?page=5&page_m=1"
	}
function Link(lnk)
	{var str=getSelectValue(lnk);
		if(str!="")
		{
	 	/*getId('n_l').style.visibility='hidden';*/
	 	document.otvet_n.link.value=str;
		document.otvet_n.link_n1.value=lnk.options[lnk.selectedIndex].text
	 	}
	 	/*else
	 	{
		getId('n_l').style.visibility='visible'; 
		}*/
	}
function Load(lnk)
	{
	Link(lnk);
	}
function getBodyScrollTop()
{
	return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
    function  getPageSize(){
           var xScroll, yScroll;

           if (window.innerHeight && window.scrollMaxY) {
                   xScroll = document.body.scrollWidth;
                   yScroll = window.innerHeight + window.scrollMaxY;
           } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                   xScroll = document.body.scrollWidth;
                   yScroll = document.body.scrollHeight;
           } else if (document.documentElement && document.documentElement.scrollHeight > document.documentElement.offsetHeight){ // Explorer 6 strict mode
                   xScroll = document.documentElement.scrollWidth;
                   yScroll = document.documentElement.scrollHeight;
           } else { // Explorer Mac...would also work in Mozilla and Safari
                   xScroll = document.body.offsetWidth;
                   yScroll = document.body.offsetHeight;
           }

           var windowWidth, windowHeight;
           if (self.innerHeight) { // all except Explorer
                   windowWidth = self.innerWidth;
                   windowHeight = self.innerHeight;
           } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                   windowWidth = document.documentElement.clientWidth;
                   windowHeight = document.documentElement.clientHeight;
           } else if (document.body) { // other Explorers
                   windowWidth = document.body.clientWidth;
                   windowHeight = document.body.clientHeight;
           }

           // for small pages with total height less then height of the viewport
           if(yScroll < windowHeight){
                   pageHeight = windowHeight;
           } else {
                   pageHeight = yScroll;
           }

           // for small pages with total width less then width of the viewport
           if(xScroll < windowWidth){
                   pageWidth = windowWidth;
           } else {
                   pageWidth = xScroll;
           }

           return [pageWidth,pageHeight,windowWidth,windowHeight];
    }

function tab_h(id)
{
	var str=getPageSize();
	var tb=getId(id);
	var tb1=getId(id);
var ua = navigator.userAgent.toLowerCase();
 // Ξοπεδελθμ opera
 if (ua.indexOf("opera") != -1 || ua.indexOf("chrome") != -1) {
   tb.style.height=str[1]+'px';
   //alert(tb);
 }
}
