function AskResult(formfield, pageurl, ww, wh) {
  window.restext = formfield;
  myWindow = open(pageurl, "displayWindow",
  "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=" + ww + ",height=" + wh);
}

function erase_fld(formfield)
{
  formfield.value = "";
}

function closeIt() {
  close();
}

function popup(url,name,width,height) {
	var features = [
		['toolbar',	0],
		['directories',	0],
		['menubar',	0],
		['status',	0],
		['resizable',	1],
		['location',	0],
		['scrollbars',	0],
		['copyhistory',	0]
		]
	for (var nr = 4; nr < popup.arguments.length; nr++) {
		var param = popup.arguments[nr].split('=')
		for (var i = 0; i < features.length; i++)
			if (features[i][0] == param[0]) {
				features[i][1] = param[1]
				break
				}
		if (i == features.length)
			features[i] = param
		}
	var featureString = 'width=' + width + ',height=' + height
	for (var i = 0; i < features.length; i++)
		featureString += ',' + features[i][0] + '=' + features[i][1]
	window.open(url,name,featureString)
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj( n, d ) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function SetMe(i,t) {
  x = MM_findObj ( i, d ) ; document.images[x].src = t;
}

function markallfordelete(check_on)
{
for(i=0; i<document.forms["movethem"].elements.length; i++)
{
if(document.forms["movethem"].elements[i].type == "checkbox" &&
document.forms["movethem"].elements[i].name.substring(0, 5) == "mvbox")
document.forms["movethem"].elements[i].checked = check_on;
}
}

function viewPort() {
var h = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
var w = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
return { width : w , height : h }
}

function checkWidth(warningtext){
	width = document.getElementById('msg_body').offsetWidth;
	if (width > 599){
		document.getElementById('wide_warning').innerHTML = '<div style="padding: 4px; text-align: center; color: #59A75F; font-weight: bold; background-color: #E4F8EB;">' + warningtext + '</div><div style="height: 4px;"><!-- --></div>';
	}
}

function checkScrollbars(){
	vp = viewPort();
	if(vp.width < 900)
		horexists = 1;
	else
		horexists = 0;
		
	if(vp.height < document.getElementsByTagName('body')[0].offsetHeight)
		verexists = 1;
	else
		verexists = 0;
	 
	return { hor : horexists, ver : verexists }
}

function floaterSetPos(){
	nh = true;
	fl = document.getElementById('floater');
	flcross = document.getElementById('flcross');
	if (fl.offsetWidth + fl.offsetWidth > 200){
		if (typeof(visible_flcross) != 'undefined' && visible_flcross != null){
			op_moz = visible_flcross;
			op_ie = Math.round(visible_flcross *100)
		} else {
			op_moz = 0.4;
			op_ie = 40;
		}
		if (op_moz == 0){
			aop_moz = 0;
			aop_ie = 0;
		} else {
			aop_moz = 1.0;
			aop_ie = 100;
		}
		if (typeof(disable_flcross) == 'undefined'){
			disable_flcross = 0;
		}
		if (!document.getElementById('flcross') && disable_flcross != 1){
			fl.innerHTML = '<div style="height: 30px;"><img id="flcross" name="flcross" src="img/g/cross.gif"' +
				' style="position: relative; z-index: 999999; top: 30px;opacity:'+op_moz+';filter:alpha(opacity='+op_ie+')"' +
				' onmouseover="this.style.opacity='+aop_moz+';this.filters.alpha.opacity='+aop_ie+'"' +
				' onmouseout="this.style.opacity='+op_moz+';this.filters.alpha.opacity='+op_ie+'"' +
				' onclick="document.getElementById(\'floater\').innerHTML=\'\'"' +
				' ></div>' + fl.innerHTML + '';
		} else {
			setTimeout('floaterSetPos()', 200);
			nh = false;
		}
	}
	if (navigator.appName && navigator.appName == 'Microsoft Internet Explorer'){
		if (fl){
			fl.style.visibility = 'hidden';
			fl.style.position = 'absolute';
			fl.style.visibility = 'visible';
		}
		if (nh){
			setTimeout('floaterSetPos()', 1000);
		}
	}
};

function floater2SetPos(){
	nh2 = true;
	fl2 = document.getElementById('floater2');
	flcross2 = document.getElementById('flcross2');
	if (fl2.offsetWidth + fl2.offsetWidth > 200){
		if (typeof(visible_flcross2) != 'undefined' && visible_flcross2 != null){
			op_moz2 = visible_flcross2;
			op_ie2 = Math.round(visible_flcross2 *100)
		} else {
			op_moz2 = 0.4;
			op_ie2 = 40;
		}
		if (op_moz2 == 0){
			aop_moz2 = 0;
			aop_ie2 = 0;
		} else {
			aop_moz2 = 1.0;
			aop_ie2 = 100;
		}
		if (typeof(disable_flcross2) == 'undefined'){
			disable_flcross2 = 0;
		}
		if (!document.getElementById('flcross2') && disable_flcross2 != 1){
			fl2.innerHTML = '<div style="height: 30px; width: 250px;"><img id="flcross2" name="flcross2" src="img/g/cross.gif"' +
				' style="position: relative; z-index: 999999; top: 30px; left: 220px; opacity:'+op_moz2+';filter:alpha(opacity='+op_ie2+')"' +
				' onmouseover="this.style.opacity='+aop_moz2+';this.filters.alpha.opacity='+aop_ie2+'"' +
				' onmouseout="this.style.opacity='+op_moz2+';this.filters.alpha.opacity='+op_ie2+'"' +
				' onclick="document.getElementById(\'floater2\').innerHTML=\'\'"' +
				' ></div>' + fl2.innerHTML + '';
		} else {
			setTimeout('floater2SetPos()', 200);
			nh2 = false;
		}
	}
	if (navigator.appName && navigator.appName == 'Microsoft Internet Explorer'){
		if (fl2){
			fl2.style.visibility = 'hidden';
			fl2.style.position = 'absolute';
			fl2.style.visibility = 'visible';
			if (document.getElementById('flcross2')){
				document.getElementById('flcross2').style.visibility = 'hidden';
				document.getElementById('flcross2').style.position = 'absolute';
				document.getElementById('flcross2').style.visibility = 'visible';
			}			
		}
		if (nh2){
			setTimeout('floater2SetPos()', 1000);
		}
	}
};