var strFN='';
aimsState='TX';
function SelectTab(tabName)
			{
			
				if (tabName =='Main')
				{
					if(document.getElementById('mainContent')!= null)
					{
					document.getElementById("mainContent").style.display = 'block';
					if(document.getElementById("fifthColumnContent")!= null)
					{
						document.getElementById("fifthColumnContent").style.display = 'none';
					}
					if(document.getElementById("ContentOptions")!= null)
					{
						document.getElementById("ContentOptions").style.display = 'none';
					}
					document.getElementById("PageProperties").style.display = 'none';
					document.getElementById("TabState1").style.display = 'block';
					if(document.getElementById("TabState2")!= null)
					{
						document.getElementById("TabState2").style.display = 'none';
					}
					if(document.getElementById("TabState4")!= null)
					{
						document.getElementById("TabState4").style.display = 'none';
					}
					document.getElementById("TabState3").style.display = 'none';
					//document.getElementById('hiddenPlaceholder').value = '0';	
					}
				}
				else if(tabName== 'Fifth')
				{
				LoadWidget();
					if(document.getElementById('fifthColumnContent')!= null)
					{
					document.getElementById("mainContent").style.display = 'none';
					if(document.getElementById("fifthColumnContent")!= null)
					{
						document.getElementById("fifthColumnContent").style.display = 'block';
					}
					if(document.getElementById("ContentOptions")!= null)
					{
						document.getElementById("ContentOptions").style.display = 'none';
					}
					document.getElementById("PageProperties").style.display = 'none';
					if(document.getElementById("TabState2")!= null)
					{
						document.getElementById("TabState2").style.display = 'block';
					}
					document.getElementById("TabState1").style.display = 'none';
					document.getElementById("TabState3").style.display = 'none';
					if(document.getElementById("TabState4")!= null)
					{
						document.getElementById("TabState4").style.display = 'none';
					}
					//document.getElementById("hiddenPlaceholder").value = '1';	
					}
				}
				else if(tabName== 'CO')
				{
					if(document.getElementById('ContentOptions')!= null)
					{
					document.getElementById("mainContent").style.display = 'none';
					if(document.getElementById("fifthColumnContent")!= null)
					{
						document.getElementById("fifthColumnContent").style.display = 'none';
					}
					document.getElementById("PageProperties").style.display = 'none';
					if(document.getElementById("ContentOptions")!= null)
					{
						document.getElementById("ContentOptions").style.display = 'block';
					}
					if(document.getElementById("TabState2")!= null)
					{
						document.getElementById("TabState2").style.display = 'none';
					}
					document.getElementById("TabState1").style.display = 'none';
					document.getElementById("TabState3").style.display = 'none';
					if(document.getElementById("TabState4")!= null)
					{
						document.getElementById("TabState4").style.display = 'block';
					}
					//document.getElementById("hiddenPlaceholder").value = '1';	
					}
				}
				else 
				{

					document.getElementById("mainContent").style.display = 'none';
					if(document.getElementById("fifthColumnContent")!= null)
					{
						document.getElementById("fifthColumnContent").style.display = 'none';
					}
					document.getElementById("PageProperties").style.display = 'block';
					if(document.getElementById("TabState2")!= null)
					{
						document.getElementById("TabState2").style.display = 'none';
					}
					if(document.getElementById("ContentOptions")!= null)
					{
						document.getElementById("ContentOptions").style.display = 'none';
					}
					document.getElementById("TabState1").style.display = 'none';
					document.getElementById("TabState3").style.display = 'block';
					if(document.getElementById("TabState4")!= null)
					{
						document.getElementById("TabState4").style.display = 'none';
					}
				}
			}
			

function SelectCaseTab(tabName)
			{
			
				if (tabName =='Main')
				{
					document.getElementById("mainContent").style.display = 'block';					
					document.getElementById("PageProperties").style.display = 'none';
					document.getElementById("TabState1").style.display = 'block';
					document.getElementById("TabState2").style.display = 'none';					
					//document.getElementById('hiddenPlaceholder').value = '0';	
				}
				
				else 
				{
					document.getElementById("mainContent").style.display = 'none';					
					document.getElementById("PageProperties").style.display = 'block';
					document.getElementById("TabState2").style.display = 'block';
					document.getElementById("TabState1").style.display = 'none';					
					//document.getElementById("hiddenPlaceholder").value = '1';	
				}
			}



function popUpWindow (window_width, window_height, window_name, window_url, _resizeable, _scrollbars )
			{
				var options="resizable="+_resizeable+",scrollbars="+_scrollbars+",width="+window_width+",height="+window_height+"";
				popupWin=window.open(window_url, window_name, options);
				
				return false;
			}

			function showContextHelp( obj )
			{
				popUpWindow( 550, 360, 'context', 'http://netservices.verizon.net/portal/help/popup.jsp?' + obj, 0, 1 );
			}

			// opens a flash window, playing the .swf specified in 'path'
			// note, path is the root-relative UNC path - kjr
			function showTutorial( title, movie ) 
			{
				
				/*
				var width=570;
				var height=408;
				var player= '/NROneRetail/NR/rdonlyres/9799F592-A00A-4B7C-AAD8-07522A3028B5/0/VOLHelp_Player.swf';
				//var url = 'http://' +location.host+ '/residentialhelp/templates/flash.aspx?Movie='+movie+'&title='+title+'&width='+width+'&height='+height;
				var url = 'http://' +location.host+ '/residentialhelp/templates/flash.aspx?Movie='+escape(movie)+ '&title='+escape(title)+'&width='+width+'&height='+height+'&flashvars='+escape(flashvars;
				popUpWindow( width, height, '', url, 0, 0 ); */;


var width=550;
				var height=380;
//				var player= '/NROneRetail/NR/rdonlyres/9799F592-A00A-4B7C-AAD8-07522A3028B5/0/VOLHelp_Player.swf';
				var player= '/ResidentialHelp/images/Flash/VOLHelp_Player.swf';
				movie = 'SubMovieURL=http://' +location.host+ movie +'&SubMovieName=' + title ;//+'bgcolor=E2EBF1';
				//var url = 'http://' +location.host+ '/residentialhelp/templates/flash.aspx?Movie='+movie+'&title='+title+'&width='+width+'&height='+height;
				var url = 'http://' +location.host+ '/residentialhelp/templates/flash.aspx?Movie='+escape(player)+ '&title='+escape(title)+'&width='+width+'&height='+height +'&flashvars='+escape(movie);
				popUpWindow( width, height, '', url, 0, 0 ); 
				
			}

			// opens a flash window, playing the .swf specified in 'movie' in the player .swf at 'player'
			// note, movie and player are the root-relative UNC paths - kjr

			//function showTutorialCustom( flashvars, player, width, height, bgcolor ) 
			//{
				//popUpWindow( width, height, 'FlashTutorial', 'http://netservices.verizon.net/portal/help/flash.jsp?player='+escape(player)+'&width='+width+'&height='+height+'&bgcolor='+bgcolor+'&flashvars='+escape(flashvars), 0, 0 );
			//}
			
			function showTutorialCustom(XMLFile, FlashVar,player, width, height)
			{
			 //var FlashFile='XMLFile=http://'+location.host+'/residentialhelp/images/flash/volntDSL2.xml&BeginChapterFilename=http://'+location.host+flashvars;
			 var XMLFile = 'XMLFile=http://'+location.host+ XMLFile;
			 XMLFile = XMLFile + '&BeginChapterFilename='+FlashVar;
			 
			 var url = 'http://' +location.host+ '/residentialhelp/templates/flash.aspx?Movie='+escape(player)+'&width='+width+'&height='+height+'&flashvars='+escape(XMLFile);
			// alert(url);
			 popUpWindow( width, height, 'FlashTutorial', url, 0, 0 );
			}
			
function setDisplay()
{

	if(document.getElementById("hiddenPlaceholder").value == '0')
	{
	
		document.getElementById("fifthColumnContent").style.display = 'none';
		document.getElementById("mainContent").style.display = 'block';
	}
	else
	{
		
		document.getElementById("fifthColumnContent").style.display = 'block';
		document.getElementById("mainContent").style.display = 'none';
	}
	
}

function oneCMS_Redirector(sURL)
{
	document.location.href = sURL;
}	

function open_popup(sURL, w, h) 
{ 
newwindow = window.open(sURL,"Popup","width="+ w+" ,height="+h+ " ,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
if (window.focus) 
{
newwindow.focus()
}
} 


// scripts to add hide solution description/title placeolders
function AddSolDescPH()
		 {
		  var count = GeneralForm.hidSolCount.value;
		  
		  if(count == 22)
		  {
		   alert("Can not add more than 22 solution descriptions and Titles.");
		  }
		  else
		  {
			if (count== 0)
			{
				count =4;
			}
			else
			{
			count= parseInt(count) +1;
			}
			  
			 var where_to= confirm("By clicking OK you will loose all the changes you have made. To avoid this, click on Cancel, and then save your changes before adding more placeholders. Are you sure you want to continue?");
				if (where_to== true)
				{ 
				  GeneralForm.hidSolCount.value = count ;
			      document.getElementById("VisibleSolDesctxtbx").innerText="<count>"+ count +"</count>" ;
			      GeneralForm.hidEventType.value= "Add";
			      //alert(document.getElementById("VisibleSolDesctxtbx").innerText);
			     // document.location.href(GeneralForm.hidEditURL.value);
			      document.GeneralForm.submit();
			      
				}
				else
				{
				 GeneralForm.hidEventType.value= "";				  				  
				 return where_to;
				}
             
  
			//DisplaySolDesc(count,"block");
			
			
			}
		 }
		 
		 
		 function DeleteSolDescPH()
		 {
		  var count = GeneralForm.hidSolCount.value;
		  
		  if(count == 1)
		  {
		   alert("A minimum of one solution description and title placeholder is required.");
		  }
		  else
		  {
			if (count== 0)
			{
				count =4;
			}
			  
			 var where_to= confirm("By clicking OK you will loose all the changes you have made. To avoid this, click on Cancel, and then save your changes before hiding more placeholders. Are you sure you want to continue?");
				if (where_to== true)
				{ 
				  
				  GeneralForm.hidSolCount.value = count-1 ;
			      document.getElementById("VisibleSolDesctxtbx").innerText="<count>"+ GeneralForm.hidSolCount.value+"</count>"
			 
			      
			      GeneralForm.hidEventType.value= "Hide";			     
			      document.GeneralForm.submit();
			      
				}
				else
				{
				 GeneralForm.hidEventType.value= "";				  				  
				 return where_to;
				}		  
			//DisplaySolDesc(count,"none");
			  
			}
		 }
		 
		 
		 //update xml
		 function UpdateCountXML()
		 {
		  var count = document.getElementById("txtCount").value; 
		  
		  if(count!=0 && count <=22)
		  {
		   var where_to= confirm("By clicking OK you will loose all the changes you have made. To avoid this, click on Cancel, and then save your changes before updating the placeholder count. Are you sure you want to continue?");
		   if (where_to== true)
		   {
		      GeneralForm.hidSolCount.value = count ;
		      document.getElementById("VisibleSolDesctxtbx").innerText="<count>"+ document.getElementById("txtCount").value+"</count>"
			  GeneralForm.hidEventType.value= "SaveCount";
		      document.GeneralForm.submit();
		   }
		   else
		   {
		    GeneralForm.hidEventType.value= "";				  				  
			return where_to;
		   }
		  }
		  else
		  {
		   alert("Please enter a value between 0 and 22.");
		  }
		 }
		 
		 
		 function HideSolutionDescinEdit(count)
		 {
		 
		    for (i=count;i>22;i++)
		    {
		      DisplaySolDesc(count);
		    }
		 }
		 
		 function DisplaySolDesc(count, style)
		 {
		  var myDiv = "Solution" + count;
		  var myTitleToolBar = "toolbar_SolutionTitle" + count ;
		  var myDescToolBar ="toolbar_SolutionDesc" + count;
		  
		  
		  
		  if(document.getElementById(myDiv)!= null)		  
		  { 
		    document.getElementById(myDiv).style.display=style;
		    
		  }
		 
		 }

//code update - 9/24 for insert popup		 
 function openrelationpopup(relurl)
{
	var sFeatures="Width=850px,Height=500px,help=no,resizable=yes,scrollbars=yes,status=no,unadorned=no";
	var newwin = window.open(relurl,'',sFeatures);
	
}
//code update - 9/24 for insert popup


/*
function showTutorial( title, movie ) 
			{
				popUpWindow(570,408,'FlashTutorial','http://netservices.verizon.net/portal/help/flash.jsp?title='+title+'&player=http://onlinehelp.verizon.net/consumer/bin/flash/FlashTutorials/VOLHelp_Player.swf&flashvars='+escape('SubMovieURL='+movie+'&SubMovieName='+title)+'&width=550&height=380&bgcolor=E2EBF1',0,0);
			}

*/