﻿

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

var tempX = 0
var tempY = 0
var fpFlag;
var oldKeyCode;

function getMouseXY(e) {

var posx = 0;
	var posy = 0;/*
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY || document.body) 	
	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	*/
    tempX = posx;
    tempY = posy;

    	
  return true;
}
    
function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;} 

function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;} 

function popitup(url,_width,_height) {
	newwindow=window.open(url,"popup","height="+_height+",width="+_width+",status=0,scrollbars=1,left = "+tempX+",top = "+tempY+"");
	if (window.focus) {newwindow.focus()}

    //tempX+=window.screenTop;
    //tempY+=window.screenLeft;

	//newwindow.moveTo(tempX,tempY);
	//newwindow.resizeTo(_width,_height);
	
	   
	return false;
}

var fpKeyControl;




function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function showOrHideAllDropDowns(newState) {
    
    var elements = document.documentElement.getElementsByTagName('select');
    for (var i=0; i<elements.length; i++) {
        elements[i].style.visibility = newState;
    }
}





function Default2PopupGetir(ctlId)
{
    popitup("rg.aspx?id="+ctlId+"&size=o3",800,600);
}
