// JavaScript Document
function printThisPage(id) 
{ 
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=600,left=25,top=25"; 

   var sWinHTML = document.getElementById(id).innerHTML; 
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><head><link rel="stylesheet" type="text/css" href="includes/reset-fonts-grids.css">');
       winprint.document.write('<link rel="stylesheet" type="text/css" href="includes/onyx.css">');
       winprint.document.write('<link rel="stylesheet" type="text/css" href="includes/print.css"></head><body>'); 
       winprint.document.write('<div id="doc" class="yui-t4">');
       if (id=='mainContent') {
            winprint.document.write('<div id="mainContent">' + sWinHTML + '</div>');
       }
       else {
            winprint.document.write(sWinHTML); 
       }
       winprint.document.write('</div>');          
       winprint.document.write('</body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}

function fnPrint() {
if (document.getElementById || document.all) {
document.frmPrint.txtPrint.value=document.all.mainContent.innerHTML;
document.frmPrint.txtTitle.value=document.title 
document.frmPrint.submit()
}
else{
windows.alert("Formatted printing is only available in internet explorer 4+ or netscape navigator 6+. Please use your browser print button to print.")
}
	
}

var popUpWin=0;
function popUp(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}




/***********************************************
* DD Tab Menu script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

//Turn menu into single level image tabs (completely hides 2nd level)?
var turntosingle=0 //0 for no (default), 1 for yes

//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes

////////Stop editting////////////////

var previoustab=""

if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

function expandcontent(cid, aobject){
if (disabletablinks==1)
aobject.onclick=new Function("return false")
if (document.getElementById){
highlighttab(aobject)
if (turntosingle==0){
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
}
}
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].className=""
aobject.className="current"
}

function collecttablinks(){
var tabobj=document.getElementById("tablist")
if (tabobj==null){							//added this to prevent errors where there are no tabs
	tabobjlinks=null						//added this to prevent errors where there are no tabs
}
else{
	tabobjlinks=tabobj.getElementsByTagName("A")
}
}

function do_onload(){
collecttablinks()
if (tabobjlinks!=null){				//added this to prevent errors where there are no tabs. Just check if there is any content.
	expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload


/********* END of Dynamic tabs script ********************/



/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

/************ End of bookmark **************/

// Populates the hidden TextBox1 control with the chosen tab's index
// Ajax call to refresh formview1 with proper practice area people and description
function ClientTabSelectedHandler(sender, eventArgs)
{
var myTextBox = document.getElementById("txtID");
var tabStrip = sender;    
myTextBox.value = sender.SelectedIndex + 1;
return false;
}

function clearBox(box) {
		 if(box.value==box.defaultValue) {
	 	 	 box.value = "";
	 	 }
	 }

function mailThisUrl(myString){
	  var u;
	  var m;
	  u = window.location; 
	 //u.replace(new RegExp(/&/g), "&amp;"); //replacing ampersands because they are also used in maito
	  m = "From the Sullivan Festeryga website";
      window.location = "mailto:?subject="+m+"&body="+document.title.replace(' :', '')+" "+u+"";
}