
//<!-- hide
function findObj(n, d) { //v3.0
  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=findObj(n,d.layers[i].document); return x;
}

/* Functions that swaps images. */
function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function fill2Boxes(box1,box2,srcBox) {
	box1.value=srcBox.value;
	box2.value=srcBox.value;
}
function submitBasicSearch(showbox) {
	if(showbox.value==''){
	  showbox.value='<enter text here>';
	  return false;
	}
}
function testEmpty(testbox) {
	if(testbox.value=='' || testbox.value=='<mandatory field>'){
	  testbox.value='<mandatory field>';
	  return false;
	}
}
function clearField(clearbox) {
	if(clearbox.value=='<mandatory field>' || clearbox.value=='<please enter a valid email address>'){
	  clearbox.value='';
	}
}
function testEmail(emailbox) {
	var at = emailbox.value.indexOf('@');
	var dot = emailbox.value.lastIndexOf('.');
	var length = emailbox.value.length;
	if(at<=0 || at>dot || dot==length-1) {
		emailbox.value='<please enter a valid email address>';
		return false;
	}
}
function testPubsEmailForm(emailform) {
	var submit = true;
	if(testEmail(emailform.SENDER)==false){
		submit=false;
	}
	if(testEmpty(emailform.NAME)==false |
	   testEmpty(emailform.ADD1)==false |
	   testEmpty(emailform.CITY)==false |
	   testEmpty(emailform.PCODE)==false |
	   testEmpty(emailform.CNTRY)==false){
		submit=false;
	}
	return submit;
}
function testNewsletterForm(emailform) {
	var submit = true;
	if(testEmail(emailform.EMAIL)==false){
		submit=false;
	}
	if(testEmpty(emailform.NAME)==false){
		submit=false;
	}
	return submit;
}
//elderberry flash navigation function
function smallwin(targeturl){
	// set dimensions
	var w = 780;
	var h = 570;
	// open the window
	var win = open(targeturl, 'kiosk','screenX=0,screenY=0,left=0,top=0,width=' + w + ',height=' + h +',resizable=0,status=1,menubar=0,toolbar=0,location=0,scrollbars=0');
	//win.moveTo(100, 70);
}

function MM_openBrWindow(theURL,www,hhh, titolo) { //v2.0
  window.open(theURL, titolo,'screenX=0,screenY=0,left=0,top=0,width=' + www + ',height=' + hhh +',resizable=0,status=1,menubar=0,toolbar=0,location=0,scrollbars=0');
}
// stop hiding -->

