var profileWindow;

function openWin(dest)
{

	var profileWindow1;
	dest = dest + "&W=1";
	profileWindow1 = window.open(dest,'LL','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,alwaysRaised=yes,width=600,height=500');
	profileWindow1.focus();
	return profileWindow1;
}

function openWin2(dest)
{

	profileWindow = window.open(dest,'LL','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,alwaysRaised=yes,width=800,height=500');
	profileWindow.focus();
	return profileWindow;
}

function closeWin()
{
	window.close();
}

function blurWin()
{
	window.blur();
}

function openWinT(dest)
{
	if (profileWindow!=null) closeWin();

	profileWindow = window.open(dest,'LL','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,alwaysRaised=yes,width=600,height=450');
	profileWindow.focus();
	return profileWindow;
}

// fieldname, warningname, remainingname, maxchars
function CheckFieldLength(fn,wn,rn,mc) {
  var len = fn.value.length;
  if (len > mc) {
    fn.value = fn.value.substring(0,mc);
    len = mc;
  }
  document.getElementById(wn).innerHTML = len;
  document.getElementById(rn).innerHTML = mc - len;
}


function changeImgSize(imgName, height, width)
{
document.getElementById(imgName).height=height;
document.getElementById(imgName).width=width;
}

function resizeImgWidth(imgName, width)
{
var currentWidth, currentHeight, resize;

currentWidth=document.getElementById(imgName).width;
currentHeight=document.getElementById(imgName).height;
if (currentWidth>width) {
	resize=width*100/currentWidth;
	document.getElementById(imgName).height=currentHeight*resize/100;
	document.getElementById(imgName).width=width;
	}
}

function getImgWidth(imgName)
{
return document.getElementById(imgName).width;
}

function getImgHeight(imgName)
{
return document.getElementById(imgName).height;
}

