function page_select_region(){
 if (document.forms.form_region.sel_field.value != 1) {
      document.location.href=document.forms.form_region.sel_field.value;  }
 }



function auto_tag(tag_name) {
	if (window.attachEvent) {
		window.attachEvent("onload", function() {
			var el = document.getElementsByTagName(tag_name);
			set_auto_tag(el);
		});
	}
}

function set_auto_tag (el) {
	for (var i=0; i<el.length; i++) {
	    if (el[i].target == '_blank'){
			el[i].className+=" onw";
	    }
	}
}

auto_tag("A");

isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isMSIE=document.all && document.all.item //Microsoft Internet Explorer 4+
isNetscape4=document.layers //Netscape 4.*
isOpera=window.opera //Opera
isOpera5=isOpera && isDOM //Opera 5+
isMSIE5=isDOM && isMSIE && !isOpera //MSIE 5+
isMozilla=isNetscape6=isDOM && !isMSIE && !isOpera

var obj;

function getLayer(layerName, parentLayerName){
  if(isDOM){ return document.getElementById(layerName); }
  if(isMSIE){ return document.all[layerName]; }
  if(isNetscape4){ return eval('document.layers[layerName]'); }
  return false;
}


function ts(e,what){
  mousex = e.clientX;
  mousey = e.clientY;
  pagexoff = 0;
  pageyoff = 0;
  if(isMSIE5){
    pagexoff = document.body.scrollLeft;
    pageyoff = document.body.scrollTop;
    bottom = document.body.offsetHeight;
    right=document.body.offsetWidth;
  }
  else{
    pagexoff = window.pageXOffset;
    pageyoff = window.pageYOffset;//mozila
    bottom = window.innerHeight;
    right = window.innerWidth;
  }
  if(getLayer(what)){
    if(isNetscape4)
      obj = getLayer(what);
    else
      obj = getLayer(what).style;

  	if(obj){
	    leftoff = mousex-pagexoff;
     //   right = screen.availWidth;
         widthlayer =document.getElementById(what).offsetWidth;
          //чтоб не выходила за пределы экрана
        if ((leftoff +widthlayer ) > right)
       {
        leftoff = right-widthlayer-30;
        obj.left = (leftoff);
        }
        else
        {
       // alert(right);
        obj.left = (mousex+pagexoff)+8;
        }


        topoff = mousey;
      //  bottom = screen.availHeight;
   //     bottom = document.body.offsetHeight;
     //   alert(document.getElementById(what).offsetHeight);
        heightlayer =document.getElementById(what).offsetHeight;
       //  alert(topoff +document.getElementById(what).offsetHeight);
       //  alert(bottom);
         if ((topoff + heightlayer+10) > bottom)
       {
        topoff = bottom-heightlayer-10;
        obj.top = (topoff);

        }
        else
        {
       // alert(right);
        obj.top = (mousey+pageyoff) + 20;
        }



	    if(isNetscape4)
    	  obj.visibility = 'show';
	    else
    	  obj.visibility = 'visible';
	  }
   }
  return true;
}

function tc(){
  if(obj){
    if(isNetscape4)
      obj.visibility = 'hide';
    else
      obj.visibility='hidden';
  }
  return true
}





/*request presentation*/
function window_open_request_prezent()
{
var text;
text="request_presentation.shtml";
window.open(text,""," resizable=yes,width=500,height=580,scrollbars=yes,top=60,left=100");
}


/*Flash*/
function getFlash(width, height, file, loop, alternate, classid, link, idcont){
   var fleshCont =  document.getElementById(idcont);

  if (MM_FlashCanPlay)
 {
var curProtocol = "http:";
if (null != top.location.protocol && top.location.protocol=='https:')
 {
curProtocol = "https:";
}
 var oeTags = '<p class="flashCC"><OBJECT CLASSID="' + classid + '"'
 + 'WIDTH="' + width + '" HEIGHT="' + height + '"'
 + 'CODEBASE="' + curProtocol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">'
 + '<PARAM NAME="MOVIE" VALUE="' + file + '">'
 + '<PARAM NAME="PLAY" VALUE="true">'
 + '<PARAM NAME="LOOP" VALUE="' + loop + '">'
 + '<PARAM NAME="QUALITY" VALUE="high">'
 + '<param name="wmode" value="opaque" >'
 + '<PARAM NAME="MENU" VALUE="false">'
 + '<EMBED SRC="' + file + '"'
 + 'WIDTH="' + width + '" HEIGHT="' + height + '"'
 + 'PLAY="true"'
 + 'LOOP="' + loop + '"'
 + 'QUALITY="high"'
 + 'MENU="false"'
 + 'wmode="transparent"'
 + 'TYPE="application/x-shockwave-flash"'
 + 'PLUGINSPAGE="' + curProtocol + '//www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
 + '</EMBED>'
 + '</OBJECT></p>';
 /*document.write(oeTags);*/
   fleshCont.innerHTML = oeTags ;

 } else {

 var alternateContent = '<div class="noFlashCont"><p><a href="http://www.keysurvey.com/landing/ua/FreeTrial.jsp"></a></p></div>'

 /*document.write(alternateContent);*/
    fleshCont.innerHTML =  alternateContent;
 }
}



       













