﻿//document.onkeypress = entsub; 
function entsub(e) 
{
var KeyID = (window.event) ? event.keyCode : e.keyCode;
//alert(window.event.keyCode);
  if (KeyID == 40 )
  {
  if(document.getElementById("sugg_0")!= undefined)
  {
  document.getElementById("sugg_0").style.backgroundColor="black";
  document.getElementById("sugg_0").style.color="white";
  document.getElementById("sugg_0").focus();
  }
  }
  else
  {
   // do nothing
  }
}
function tablinks(e,nid, pid , tid, count, name, total)
{
var KeyID = (window.event) ? event.keyCode : e.keyCode;
//alert(window.event.keyCode);
  if (KeyID == 40 )
  {
      document.getElementById(nid).focus();
      document.getElementById(nid).style.color="white";
      document.getElementById(nid).style.backgroundColor="black";
      document.getElementById(tid).style.color="black";
      document.getElementById(tid).style.backgroundColor="white";  
  }

  if (KeyID == 38 && count != 0 )
  {
       document.getElementById(pid).focus();
       document.getElementById(pid).style.color="white";
       document.getElementById(pid).style.backgroundColor="black";
       document.getElementById(tid).style.color="black";
       document.getElementById(tid).style.backgroundColor="white";
  }
  if (KeyID == 13)
  {
    document.getElementById(tid).click();
  }
  return false;
}
function R(n){
return Math.floor(Math.random()*n);
}

function writeSomeText(){
var s="";
for(var ii=0; ii<2000; ii++)
s+=ii + (R(30)<2 ? "<br>" : "")
return s;
}

function getInnerHeight(iframe){
var d=iframe.contentWindow ?
iframe.contentWindow.document :
iframe.contentDocument;
var h=0;
if(d){
if(d.documentElement && d.compatMode &&
d.compatMode=="CSS1Compat")
h=d.documentElement.scrollHeight;
else if(d.body)
h=d.body.scrollHeight;
if(h) h+=getInsets(d);
}
return (h||10)+"px"; //300 is a default value
}

function getInsets(d){
if(d.body.currentStyle)
with (d.body.currentStyle)
return (parseInt(marginTop)||0) +
(parseInt(marginBottom)||0) +
(parseInt(paddingTop)||0) +
(parseInt(paddingBottom)||0);
if(d.defaultView && d.defaultView.getComputedStyle)
with (d.defaultView)
return parseInt(getComputedStyle(d.body,"").
getPropertyValue("margin-top"))+
parseInt(getComputedStyle(d.body,"").
getPropertyValue("margin-bottom"))+
parseInt(getComputedStyle(d.body,"").
getPropertyValue("padding-top"))+
parseInt(getComputedStyle(d.body,"").
getPropertyValue("padding-bottom"));
return 0;
}




                function autoSuggest(keyword)
                {
                    loadURL('/test2.aspx?keyword='+keyword);
                }

				
				
				
				
				
				function stf(url,windowid)
				{
				    window.radopen(url, windowid);
				}
																			

				function OnClientClose(radWindow)
				{					
				var oValue = radWindow.Argument;	
				//alert(oValue.NameValue);
				}																		
				

    function chkbxClear(cbId, cbId2, fields)
    {
    document.getElementById(cbId).checked = false;
    document.getElementById(cbId2).checked = false;
    if(fields > 0)
    {
    var i = 0
    while(i<fields)
    {
    document.getElementById(cbId2+'_'+i).checked = false;
    i++;
    }
    }
    }

