//*********************************************************************//
//******************** DHTML WINDOW DISPLAY ***************************//
//*********************************************************************//
function prDisplayLayerWin(elem){
	prShowFadeOverlay();
	prCenterLayerWin(elem);
	prShowLayerWin(elem);
}
function prShowLayerWin(elem){
	var displayWindow = document.getElementById(elem);
	displayWindow.className = "prShowLayerWin";
}
function prHideLayerWin(elem){
	var displayWindow = document.getElementById(elem);
	displayWindow.className = "prHideLayerWin";
	prHideFadeOverlay();
}
function prCenterLayerWin(elem) {
	var browserHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight);
	var scrollHeight = window.document.body.scrollHeight;
	var scrollWidth = window.document.body.scrollWidth;
	var scrollPositionX = 0;
	var scrollPositionY = 0;
	try {
		scrollPositionX = pageXOffset;
		scrollPositionY = pageYOffset;
	} catch(e) {
		scrollPositionX = document.body.scrollLeft;
		scrollPositionY = document.body.scrollTop;
	}

	var displayWindow = document.getElementById(elem);
	var displayWindowWidth = 712;
	var displayWindowHeight = displayWindow.scrollHeight;

	var styleTop = scrollPositionY + 90;
	var styleLeft = Math.round((scrollWidth - scrollPositionX)/2 - (displayWindowWidth/2) - 10);
	displayWindow.style.top = styleTop + "px";
	displayWindow.style.left = styleLeft + "px";
	
	return false;
}
function prShowFadeOverlay() {
	//************************************************************
	//***** DEFINE ELEMENTS FOR FADE AND CONTENT DISPLAY *********
	//************************************************************
	var fadeBg = document.getElementById('prFormWrapperFade');
	fadeBg.className = "prFadeWrapperOn";
	//************************************************************
	//***** FIND AND SET USER WINDOW HEIGHT/WIDTH ****************
	//************************************************************
	var height;
	var winHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight);
	var scrollHeight = window.document.body.scrollHeight;
	var winWidth = window.document.body.scrollWidth;
	if(winHeight > scrollHeight){
		height = winHeight;
	}else{
		height = scrollHeight;
	}
	//************************************************************
	//*********** DISPLAY FADE BG AND CONTENT DIV ****************
	//************************************************************
	fadeBg.style.height = height + 'px';
	fadeBg.style.width = winWidth + 'px';
	return false;
}
function prHideFadeOverlay() {
	document.getElementById("prFormWrapperFade").className = "prFadeWrapperOff";
	return false;
}
function onYouTubePlayerReady(playerId) {
      ytplayer = document.getElementById("youTubeVideo");
    }
function stop() {
  ytplayer = document.getElementById("youTubeVideo");
  if (ytplayer) {
    ytplayer.stopVideo();
  }
}
function ieHideSelect(state){
	var selectTags = document.getElementsByTagName("SELECT");
	for(var i=0; i<selectTags.length; i++){
		if(state){
			if(selectTags[i].className != "prSelect"){
				selectTags[i].style.display = "none";
			}
		}else{
			selectTags[i].style.display = "block";
		}
	}
}
//*********************************************************************//
//***************** END DHTML WINDOW DISPLAY **************************//
//*********************************************************************//
