function winIsOpen(winObjName) {
/* This function checks to see if the specified window object is open
It doesn't matter if the window object hasn't even been initialised yet,
as the function is programmed defensively to work even if the object 
doesn't exist, or doesn't have a .closed property

NOTE THAT THE WINDOW OBJECT NAME MUST BE SUPPLIED AS A 
STRING, NOT AS AN OBJECT REFERENCE

*/
var winObjStatus = eval("typeof("+winObjName+")")
var winObj
var result = false
if (winObjStatus != 'undefined') {
  winObj = eval(winObjName)
  if (typeof(winObj.closed) != 'undefined') {
    result = winObj.closed ? false : true
}}
return result
}



function openChildWin(docName) {

if (! winIsOpen("childWin")) {
  childWin = window.open(docName, "cwin", "left=200,top=100,width=610,height=510,menubar=no,toolbar=yes,location=No,directories=no,scrollbars=yes,status=no,resizable=yes")
} else {
  childWin.location.href = docName
}
focusChildWin()
}




function focusChildWin() {
if (winIsOpen("childWin")) {
  childWin.focus()
  } else {
  alert("Can't focus this window because it isn't currently open!")
  }}


function closeChildWin() {
if (winIsOpen("childWin")) {
  childWin.close()
  } else {
//  alert("Can't close this window because it isn't currently open!")

}}


function SB_swapImgRestore() { 
  var i,x,a=document.SB_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function SB_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=SB_findObj(n,d.layers[i].document); return x;
}

function SB_swapImage() { 
  var i,j=0,x,a=SB_swapImage.arguments; document.SB_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=SB_findObj(a[i]))!=null){document.SB_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function validate(form)
{
input1= form.rcs.value
input2= form.country.options[form.country.selectedIndex].value
input3= form.name.value
input4= form.port.value
input5= form.reg.value
if (input1.length > 0 | input2 != -1 |input3.length > 0 | input4.length > 0 | input5.length > 0 ){
return true
}
else{
alert("Invalid entry!")
return false
}
}
