var tempStyle;
function editStyle(docID)
{
	tempStyle=document.getElementById(docID).className;
	document.getElementById(docID).style.backgroundColor="#CCFFFF";
	document.getElementById(docID).style.border="1px solid #003366";
	//document.getElementById(docID).className="editMe"	
}
function returnStyle(docID)
{
	document.getElementById(docID).className=tempStyle;
	document.getElementById(docID).style.backgroundColor="";
	document.getElementById(docID).style.border="";
}

function editMe(docID, contentID, pageID, styleName, contentType)
{
	var tempString=document.getElementById(docID).innerText
	var oNewWindow = window.open("editContent.aspx", "edit", "height=600,width=600,status=yes,toolbar=no,menubar=no,location=no")
	doPopulateChildWindow(oNewWindow);
	oNewWindow.document.getElementById("pageID").value=pageID;
	oNewWindow.document.getElementById("contentID").value=contentID;
	oNewWindow.document.getElementById("typeID").value=(contentType=="TEXT"?6:1);
	oNewWindow.document.getElementById("contentName").value=docID;
	oNewWindow.document.getElementById("cssStyle").value=styleName;
	oNewWindow.document.getElementById("editText").value=tempString;
	oNewWindow.showResult();
		
}

function doPopulateChildWindow(oNewWindow)
{
	if (oNewWindow && !oNewWindow.closed && oNewWindow.document	&& oNewWindow.document.forms && oNewWindow.document.getElementById("pageID")) //If child window is loaded populate 
	{
		return;
	}
	else //wait to the child window is loaded and try again
	{
		doPopulateChildWindow(oNewWindow)
	}
}

function PrintThisPage() 
{ 
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 

   var sWinHTML = document.getElementById('mainWebDiv').innerHTML;  
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><LINK href="styles.css" rel=Stylesheet><body>'); 
       winprint.document.write('<img src="/images/tcm-logo.jpg" alt="Teledyne Continental Motors"><br><br>'); 
       winprint.document.write(sWinHTML);
       winprint.document.write('<script language=javascript>document.getElementById("printFriendlyBtn").style.display="none";window.print()</script>');          
       winprint.document.write('</body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}