﻿// JScript File

function AddToFavorite()
{
	var name = navigator.appName;
	var useragent = navigator.userAgent;
	var version = parseInt(navigator.appVersion);
	var needtoknow = 1;
	
	if ( useragent.indexOf("MSIE") != -1) {
			var index = navigator.userAgent.indexOf("MSIE ");
			if ( index != -1 ) {
				version = parseInt(navigator.userAgent.substring(index+5,index+6));
			}
			if ( version > 4) {
				window.external.AddFavorite(location.href, "Агробизнесконсалтинг - разработка ПО для агробизнеса");
				needtoknow = 0;
			}
	}
	if (needtoknow != 0) {
		alert('Для Вашего браузера в автоматическом режиме нельзя добавить страницу в избранное');
	}   
	
	
	return false;
}
function sethome(o,siteurl,sitename) {
	var name = navigator.appName;
	var useragent = navigator.userAgent;
	var version = parseInt(navigator.appVersion);
	var needtoknow = 1;
	
	if ( useragent.indexOf("MSIE") != -1) {
			var index = navigator.userAgent.indexOf("MSIE ");
			if ( index != -1 ) {
				version = parseInt(navigator.userAgent.substring(index+5,index+6));
			}
			if ( version > 4) {
				o.style.behavior='url(#default#homepage)'; o.setHomePage(siteurl);
				needtoknow = 0;
			}
	}
	if (needtoknow != 0) {
		//openBrWindow('/help/makehomepage.html','winMakeHomepage','location=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=450');
		alert('Для Вашего браузера в автоматическом режиме нельзя установить стартовую страницу');
	}
	return false;
}

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function blocking(nr, isShow)
{
 if (document.layers)
 {
 current = (document.layers[nr].display == 'none') ? 'block' : 'none';
 document.layers[nr].display = current;
 }
 else if (document.all)
 {
 current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
 document.all[nr].style.display = current;
 }
 else if (document.getElementById)
 {
 vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
 document.getElementById(nr).style.display = vista;
 }
}
