// JavaScript Document

//newWindow start
var newWindow = null;

function openWindow(contentURL,windowName,windowWidth,windowHeight) {
	widthHeight = 'height=' + windowHeight + ',width=' + windowWidth;
	newWindow = window.open(contentURL,windowName,widthHeight);
	newWindow.focus()
}
function openWindow2(contentURL,windowName,windowWidth,windowHeight) {
	widthHeight = 'height=' + windowHeight + ',width=' + windowWidth + ',scrollbars=1';
	newWindow = window.open(contentURL,windowName,widthHeight);
	newWindow.focus()
}
function closeWindow() {
	if (newWindow != null)  {	
	 newWindow.close();
	 newWindow = null;
	}
}

function toggleWindow(contentURL,windowName,windowWidth,windowHeight) {
	if (newWindow == null) {
		widthHeight = 'height=' + windowHeight + ',width=' + windowWidth;
		newWindow = window.open(contentURL,windowName,widthHeight);
		newWindow.focus()
	}
	else {	
	 			newWindow.close();
	 			newWindow = null;
	}
}
//newWindow end
//tellafriend start
function newWindow3(mypage,myname,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}
//tellafriend end

