/*	Function for handling Enter button when using multiple Submit buttons.
	Used by 
		searchboxes.ascx
		quicksearch.ascx
*/
function KeyDownHandler(btn)
{
	// process only the Enter key
	if (event.keyCode == 13)
	{
		// cancel the default submit
		event.returnValue=false;
		event.cancel = true;
		// submit the form by programmatically clicking the specified button
		btn.click();
	}
}

/*	Function for showing a layer centered on screen when a search is initiated.
	Used by 
		searchboxes.ascx
		quicksearch.ascx
*/
var isClicked = false;
	
function DisplayProgressBar()
{
	if(isClicked)
		return false;
	isClicked = true;
	
	var oElement = document.createElement('div');
	oElement.setAttribute("id", "ProgressBar");
	oElement.style.border = '1px solid black';
	oElement.style.padding = '20 100 20 100';
	oElement.style.background = '#efefef';
	oElement.style.color = '#000000';
	oElement.innerHTML = '<span id="blinkme">S&#248;ker...</span>';
	document.body.appendChild(oElement);
	window.setInterval("Blink();",500);
	
	return true;
}

function Blink()
{
	if(document.all['blinkme'].style.color=='#000000')
		document.all['blinkme'].style.color='#efefef';
	else
		document.all['blinkme'].style.color='#000000';
		
}

/************************************************************************************************************/

<!--
 if (window.screen) 
 {
 
   if (screen.width != 800)
    {
     if (screen.width < 800)
       {
       var px = 400;
       var py = 10;
       }
     else
       {
       var px = 785;
       var py = 10;
       }
    }
   else
    {
     var px = 585;
     var py = 10;
    }
 
 }

function OpenPartsList(showme) {
  if (window.popup && window.popup.closed)
   {
    popup = null;
    popup = window.open(showme,"popper","left="+px+",top="+py+",scrollbars=1,resizable=1,width=220,height=330","replace=true");
   }
  if (window.popup)
   {
    popup.location.href = showme;
    popup.focus();
   }
  else
   popup = window.open(showme,"popper","left="+px+",top="+py+",scrollbars=1,resizable=1,width=220,height=330","replace=true");
 }

function PopDown() {
 if (window.popup && (!(popup.closed)))
  popup.close();
 }
 
	
/************************************************************************************************************/

var newwindow;
function OpenEditWindow(url)
{
	newwindow=window.open(url,'mywindow','height=700px,width=850px,top=200,left=200,resizable=1,scrollbars=1');
	if (window.focus) {newwindow.focus()}
}



