function stopError() { return true;}
window.onerror = stopError;

var myRemote;
window.onunload=CloseRemote;

function CloseRemote()
{
	if (myRemote!=null) myRemote.close();
}

function ns_ShowWindowEx(i,newURL,x,y,w,h) {
	var NS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
	if (!NS6)
	{
		IE = (document.all) ? true : false;
		NS4 = (document.layers) ? true : false;
	}
	else
	{
		IE = false;
		NS4 = false;
	}
	
	if(NS4)
	{
		if (myRemote==null) {
			  myRemote = window.open(newURL, '', 'height='+h+',width='+w+',screenX='+x+',left='+x+',screenY='+y+',top='+y+',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0', 'myWindow');
			  myRemote.focus();
		}
		else{
			if(!myRemote.closed)	// Mora zaradi Netscape oti ako myRemote e zatvoren od strana na korisnikot puka
			{
				myRemote.close();
			}
			
			myRemote = window.open(newURL, '', 'height='+h+',width='+w+',screenX='+x+',left='+x+',screenY='+y+',top='+y+',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0', 'myWindow');
			myRemote.focus();
		}	
	}
	else
	{
		if (myRemote==null) {
			  myRemote = window.open(newURL, '', 'height='+h+',width='+w+',screenX='+x+',left='+x+',screenY='+y+',top='+y+',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0', 'myWindow');
			  myRemote.focus();
		}
		else{
			if(!myRemote.closed)	// Mora zaradi Netscape oti ako myRemote e zatvoren od strana na korisnikot puka
			{
				myRemote.close();
			}
			
			myRemote=null;
			myRemote = window.open(newURL, '', 'height='+h+',width='+w+',screenX='+x+',left='+x+',screenY='+y+',top='+y+',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0', 'myWindow');
			myRemote.focus();
		}	
	}
}



function dummy(){
}

//wb2flymenu scripts

var prevPopup=null;
var timeOutID=0;
var subMenuOffset=0;
			
function mouseIn(src,childID)
{
	var chMenu = document.all(childID);
	var posLeft;
	var posTop;
	var posWidth;
	var x;
	var y;
				
	if(prevPopup!=null)
	{
		if(prevPopup!=chMenu)
		{
			prevPopup.style.visibility="hidden";
		}
	}
				
	prevPopup = chMenu;
	posLeft = src.offsetLeft;
	posTop = src.offsetTop;
	posWidth = src.offsetWidth;
				
	y = posTop;
	x = subMenuOffset+posLeft+posWidth;
	chMenu.style.visibility="visible";
	chMenu.style.left = 1+x+"px";
	chMenu.style.top = 1+y+"px";
}
			
function mouseOut(src,childID)
{
	var strEval;
				
	if(!src.contains(window.event.toElement))
	{
		strEval = new String();
		strEval = "MainMenuTimer('" + childID + "')";
		timeOutID = window.setTimeout(strEval,250);
	}
}
			
function MainMenuTimer(childID)
{
	var chMenu = document.all(childID);
	chMenu.style.visibility="hidden";
	if(timeOutID!=0)
	{
		window.clearTimeout(timeOutID);
		timeOutID = 0;
	}
}
			
function subMenuMouseIn(src,elementID)
{
	if(timeOutID!=0)
	{
		window.clearTimeout(timeOutID);
		timeOutID = 0;
	}
}
			
function subMenuMouseOut(src,elementID)
{
	if(!src.contains(window.event.toElement))
	{
		var chMenu = document.all(elementID);
		chMenu.style.visibility="hidden";
	}
}
// end of wb2flymenu


function enableField(thisfield)
{

var x = document.forms['profileSearchForm'].elements;
if (document.profileSearchForm.hid1.value=="")
{
	for (var i=0; i<x.length; i++)
	{
	  if ((x[i].type=="submit") || (x[i].type=="reset") || (x[i].type=="hidden"))
		{
		  x[i].disabled = false;
		}
	  else
		{
	      x[i].disabled = true;
		}
	}
	thisfield.disabled = false;
	document.profileSearchForm.hid1.value="1";
}	
}