//window.onscroll = scroll;
function scroll()
{
	sc();
	sc1();
}

function sc()
{
	if(document.getElementById("Layer1").style.visibility!='hidden')
	{
	 screenW = screen.width;
	 screenH = screen.height;
//	 alert(screenW + " x " + screenH);
	var shw = screenW/2;
	var shh = screenH/2;
	shw = shw+150;
	shh = shh;

	
	
	var toploc = document.documentElement.scrollTop+shh;
	
			//	alert(document.documentElement.scrollTop);
	//		showMe();
			var contentElement = document.getElementById('content');
			contentElement.style.position = 'relative';
			contentElement.style.top = toploc + 'px';
			contentElement.style.left = shw + 'px';
	}
}


function sc1()
{
	if(document.getElementById("Layer2").style.visibility!='hidden')
	{
	screenW = screen.width;
	screenH = screen.height;
	var shw = screenW/2;
	var shh = screenH/2;
	shw = shw+200;
	shh = shh;
	
	var toploc = document.documentElement.scrollTop+shh;
	var contentElement = document.getElementById('ct');
	contentElement.style.position = 'relative';
	contentElement.style.top = toploc + 'px';
	contentElement.style.left = shw + 'px';
	}
}


function HideInfo()
{
	document.getElementById('content').style.display = 'none';
	document.getElementById("Layer1").style.visibility="hidden";

	  var width = document.body.clientWidth;
	  var height = document.body.scrollHeight;
	  document.getElementById("Layer1").style.width = width;
	  document.getElementById("Layer1").style.height = height;


	document.getElementById('ct').style.display = 'none';
	document.getElementById("Layer2").style.visibility="hidden";
}


		<!--
		function getWindowHeight()
		 {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number')
			 {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}


		function getWindowWidth()
		 {
			var windowWidth = 0;
			if (typeof(window.innerWidth) == 'number')
			 {
				windowWidth = window.innerWidth;
			}
			else {
				if (document.documentElement && document.documentElement.clientWidth) {
					windowWidth = document.documentElement.clientWidth;
				}
				else {
					if (document.body && document.body.clientWidth) {
						windowWidth = document.body.clientWidth;
					}
				}
			}
			return windowWidth;
		}



		function setContent() 
		{
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				var windowWidth = getWindowWidth();
//				alert(windowWidth);

				if (windowHeight > 0 && windowWidth>0)
				{
					var contentElement = document.getElementById('content');
					var contentHeight = contentElement.offsetHeight;
					var contentWidth = contentElement.offsetWidth;

					if ((windowHeight - contentHeight > 0) && (windowWidth - contentWidth > 0))
					{
						contentElement.style.position = 'relative';
						contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2))-125 + 'px';
						contentElement.style.left = ((windowWidth / 2) - (contentWidth / 2))-225 + 'px';
					}
					else
					{
						contentElement.style.position = 'static';
					}
				}
			}
		}
		window.onresize = function() {
			setContent();
		}
		//-->

function showMe()
{

//  alert('Test');
	document.getElementById('content').style.display='block';
	document.getElementById("Layer1").style.visibility="visible";

  var width = document.body.clientWidth;
  var height = document.body.scrollHeight;
  
  var wd=(width*.30);
  var ht=(height*.09);

  document.getElementById("Layer1").style.width = width+wd;
  document.getElementById("Layer1").style.height = height+ht;
//  alert(width+wd);

  sc();
}


function showTellFriend(pdtid)
{
//alert(pdtid);

	document.getElementById('ct').style.display='block';
	document.getElementById("Layer2").style.visibility="visible";

  var width = document.body.clientWidth;
  var height = document.body.scrollHeight;
  document.getElementById("Layer2").style.width = width;
  document.getElementById("Layer2").style.height = height;
  document.fri.friname.value='';
  document.fri.frinum.value='';
  document.fri.friemailid.value='';
  document.fri.pdtid.value=pdtid;
  document.fri.friname.focus();
  sc1();
}



function isnck()
{
	if(document.newsfrm.newsemail.value=='')
	{
		alert('Please enter your E-Mail ID to Subscribe..');
		document.newsfrm.newsemail.focus();
		return false;
	}
	if(document.newsfrm.newsemail.value.search(/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i))
	{
		alert("Please input a valid email address!")
		document.newsfrm.newsemail.value='';
		document.newsfrm.newsemail.focus(); 
		return false;
	}
	showMe();
	document.newsfrm.newsemail.disabled=true;
	document.newsfrm.Submit.disabled=true;
	return showCompCat('Newsletter');
}


function isfriemailid()
{
	if(document.fri.friname.value=='')
	{
		alert('Please enter your Name..');
		document.fri.friname.focus();
		return false;
	}
	if(document.fri.frinum.value=='')
	{
		alert('Please enter your Contact Number..');
		document.fri.frinum.focus();
		return false;
	}
	if(document.fri.friemailid.value=='')
	{
		alert('Please enter your E-Mail ID..');
		document.fri.friemailid.focus();
		return false;
	}
	if(document.fri.friemailid.value.search(/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i))
	{
		alert("Please input a valid email address!")
		document.fri.friemailid.value='';
		document.fri.friemailid.focus(); 
		return false;
	}
		HideInfo();
		showMe();
		return showCompCat('Friend');
}
