﻿function openWindow(width,height,url,name) {
    x = (640 - width)/2, y = (480 - height)/2;

	if (screen) {
	    y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
	}

	name = window.open(url,name,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	name.focus();
				
}

function selectRadioButton(selectedElement, container) {
   
    var radioButtons = document.getElementById(container).getElementsByTagName("input");
    for(var i = 0; i < radioButtons.length; i++) {
        if(radioButtons[i] == selectedElement) {
            radioButtons[i].checked = true;
        } else {
            radioButtons[i].checked = false;
        }
    }
}

function checkEnter(e)
{   
    if(navigator.userAgent.indexOf("Firefox")!=-1)
    {  
        if(e.which == 13)                
        {
            document.getElementById('searchbox_008524148112279989318:-5ri0dsnjl0').sa.click()
        }
    }            
    if (navigator.appVersion.indexOf("MSIE")!=-1)
    {
        if(event.keyCode == 13)
        {
            document.getElementById('searchbox_008524148112279989318:-5ri0dsnjl0').sa.click()
        }
    }
}

function clearSearch(elem)
{
   if(elem.value == "Search")
   {
     elem.value = "";
   }
}

function showSearch(elem)
{
   if(elem.value == "")
   {
     elem.value = "Search";
   }
}