function showlayer(layer, mainPage){
	var browser=navigator.appName;
	var otherLayer;
	if(layer=='sm_1')
	{
		otherLayer = document.getElementById('sm_2');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_3');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_4');
		otherLayer.style.display="none";
	}
	else if (layer=='sm_2')
	{
		otherLayer = document.getElementById('sm_1');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_3');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_4');
		otherLayer.style.display="none";
	}
	else if (layer=='sm_3')
	{
		otherLayer = document.getElementById('sm_1');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_2');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_4');
		otherLayer.style.display="none";
	}
	else if (layer=='sm_4')
	{
		otherLayer = document.getElementById('sm_1');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_2');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_3');
		otherLayer.style.display="none";
	}
	else
	{
		otherLayer = document.getElementById('sm_1');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_2');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_3');
		otherLayer.style.display="none";
		otherLayer = document.getElementById('sm_4');
		otherLayer.style.display="none";
	}
	
	//check for screen resolution
	var myLayer = document.getElementById(layer);
	var myWidth = pageWidth();

	if (browser == 'Microsoft Internet Explorer')
	{
		  if (layer=='sm_1')
		  {
		  	if (myWidth <=1023)
		  		myLayer.style.left = "-35px";
			else
				myLayer.style.left = ((myWidth-1023)/2) + (-35) -13;  	
		  }
		  else if (layer=='sm_2')
		  {
			if (myWidth  <= 1023)
		  		myLayer.style.left = "127px";
			else 
			  	myLayer.style.left = ((myWidth-1023)/2) + 127 -13; 
		  }
		  else if (layer=='sm_3')
		  {
			if (myWidth  <= 1023)
		  		myLayer.style.left = "240px";
			else
			  	myLayer.style.left = ((myWidth-1023)/2) + 240 -13; 
		  }
		  else if (layer=='sm_4')
		  {
			if (myWidth  <= 1023)
		  		myLayer.style.left = "383px";
			else
			  	myLayer.style.left = ((myWidth-1023)/2) + 383 -13; 
		  }
		  else
		  {
		  	myLayer.style.display=="none" ;
		  }
	}
	else
	{
		  if (layer=='sm_1')
		  {
		  	if (myWidth <=1045)
		  		myLayer.style.left = "-35px";
			else
				myLayer.style.left = ((myWidth-1045)/2) + (-35) -13 + 'px';  	
		  }
		  else if (layer=='sm_2')
		  {
			if (myWidth  <= 1045)
		  		myLayer.style.left = "127px";
			else 
			  	myLayer.style.left = ((myWidth-1045)/2) + 127 -13 + 'px'; 
		  }
		  else if (layer=='sm_3')
		  {
			if (myWidth  <= 1045)
		  		myLayer.style.left = "240px";
			else
			  	myLayer.style.left = ((myWidth-1045)/2) + 242 -13 + 'px'; 
		  }
		  else if (layer=='sm_4')
		  {
			if (myWidth  <= 1045)
		  		myLayer.style.left = "383px";
			else
			  	myLayer.style.left = ((myWidth-1045)/2) + 385 -13 + 'px'; 
		  }
		  else
		  {
		  	myLayer.style.display=="none" ;
		  }
	 } 
	 if (browser == 'Opera')
	 {
		  myLayer.style='display:block';
		  myLayer.style.padding = '12px 2px 2px 2px';
	 }
	 else
	 {
		  myLayer.style.display ='block';
		  myLayer.style.padding = '12px 2px 2px 2px';
		  myLayer.style.position='absolute';
		  myLayer.style.bottom='relative';
		  myLayer.style='text-align:center';
	 }
}
// Browser Window Size and Position
// copyright Stephen Chapman, 3rd Jan 2005, 8th Dec 2005
// you may copy these functions but please keep the copyright notice as well
function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;}
