function openPopup(url, width, height, scroll) {
	if(scroll==true) {
		popupWindow = window.open(url,"popupWin","resizable=1, toolbar=0,location=0,menubar=0,scrollbars=1,width="+width+"height="+height);
	}
	else {
		popupWindow = window.open(url,"popupWin","resizable=1, toolbar=0,location=0,menubar=0,scrollbars=0,width="+width+"height="+height);
	}
}

function openEmbeddedPopup(url, width, height, scroll) {
	// get the window width
	var myWidth = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	}
	
	embeddedPopup.location.href = url;
	var thisElement = document.getElementById("embeddedPopup");
	var offset = (myWidth - width) / 2;
	
	thisElement.className = 'embeddedPopup';
	thisElement.style.width = width + 'px';
	thisElement.style.height = height + 'px';
	thisElement.style.left = offset + 'px';
	thisElement.style.top = '100px';
	
	
}

function closeEmbeddedPopup() {
	var thisElement = window.frameElement;
	thisElement.className = 'embeddedPopupHide';
}




function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
}
