function ShowMenu(sender)
{
	var lastString = "";
	if(sender.className.match("Last")!=null){
		lastString = sender.className.match("Last");}
	
	if(sender.className.match("First")!=null){
		lastString = sender.className.match("First");}
			
	sender.className = "Selected"+lastString;
	
	var ulTag = RemovePreviousTextNode(sender.parentNode.lastChild);
	ulTag.style.display = "block";
	ulTag.style.visibility = "visible";
	sender.onclick = function() {HideMenu(sender)}		
}
function HideMenu(sender)
{
	var lastString = "";
	if(sender.className.match("Last")!=null){
		lastString = sender.className.match("Last");}
		
	if(sender.className.match("First")!=null){
		lastString = sender.className.match("First");}
		
	sender.className = "Unselected"+lastString;
	
	var ulTag = RemovePreviousTextNode(sender.parentNode.lastChild);
	ulTag.style.display = "none";	
	ulTag.style.visibility = "hidden";
	sender.onclick = function() {ShowMenu(sender)}		
}

function RemoveTextNode(startBrother)
{
  endBrother=startBrother;
  if(endBrother!=null)
  {  
      while(endBrother.nodeType!=1)
      {
        endBrother = endBrother.nextSibling;
      }
  }
  return endBrother;
};
function RemovePreviousTextNode(startBrother)
{
  endBrother=startBrother;
  if(endBrother!=null)
  {  
      while(endBrother.nodeType!=1)
      {
        endBrother = endBrother.previousSibling;
      }
  }
  return endBrother;
};









		var selected = 1;
		function showPic (whichpic) 
		{
			if(whichpic.id  == 'cntn' || whichpic.id =='cntp')
			{
				if(whichpic.id  == 'cntn')
				{	
					selected++;
					if(document.getElementById('cnt'+selected))
					{
						document.getElementById('bannerImage').src = document.getElementById('cnt'+selected).href;	
						selPage('cnt'+selected);
						unSelPage('cnt'+(selected-1));
					}
					else
					{
						selected--;
					}
				}
				else
				{
					selected--;
					if(document.getElementById('cnt'+selected))
					{
						document.getElementById('bannerImage').src = document.getElementById('cnt'+selected).href;	
						selPage('cnt'+selected);
						unSelPage('cnt'+(selected+1));
					}
					else
					{
						selected++;
					}
				}
				
			}
		 	else if (document.getElementById) 
			{
			  document.getElementById('bannerImage').src = whichpic.href;	
				
			  unSelPage('cnt'+selected);
			  selected = whichpic.innerHTML;
			  selPage('cnt'+selected);
			  return false;
			} 
			else 
			{
			  return true;
			}
		}
		function selPage(item)
		{
			document.getElementById(item).style.fontWeight = "bold";
			document.getElementById(item).style.textDecoration = "underline";
		}
		function unSelPage(item)
		{
			document.getElementById(item).style.fontWeight = "";
			document.getElementById(item).style.textDecoration = "";
		}
		

		
function WatermarkFocus(txtElem, strWatermark) {
 if (txtElem.value == strWatermark) txtElem.value = '';
}

function WatermarkBlur(txtElem, strWatermark) {
 if (txtElem.value == '') txtElem.value = strWatermark;
}
function checkSearch(frm, strWatermark)
{
	if(strWatermark == frm.text.value || frm.text.value.length == 0 ){ return false;}
	else {return true;}
}
