// JavaScript Document

// DIRECTIONS
PCHnewingtonCT = "<strong><u>From West</u></strong> - I-84 E<br>"
PCHnewingtonCT +=				"Merge onto CT-72 E via EXIT 35 on the LEFT toward CT-9 / NEW BRITAIN. 2.8 miles<br>" 
PCHnewingtonCT += 				"Merge onto CT-9 N via the exit on the LEFT toward NEWINGTON. 2.0 miles<br>" 
PCHnewingtonCT += 				"Take the CT-175 exit- EXIT 29- toward NEWINGTON. 0.2 miles<br>" 
PCHnewingtonCT += 				"Turn RIGHT onto CT-175 / CEDAR ST. 1.7 miles<br>" 
PCHnewingtonCT += 				"Turn LEFT onto CT-176 / MAIN ST. 1.0 miles<br>" 
PCHnewingtonCT += 				"Turn RIGHT onto CT-176 / HARTFORD AVE. 0.6 miles<br>" 
PCHnewingtonCT += 				"Turn LEFT onto N MOUNTAIN RD. 0.3 miles<br>" 
PCHnewingtonCT += 				"End at 730 N Mountain Rd<br><br>"
PCHnewingtonCT +=				"<strong><u>From East</u></strong> - I-84 W<br>"
PCHnewingtonCT += 				"Take the FLATBUSH AVENUE exit- EXIT 45- on the LEFT. 0.8 miles<br>" 
PCHnewingtonCT += 				"Turn LEFT onto FLATBUSH AVE. 0.1 miles<br>" 
PCHnewingtonCT +=				"Turn RIGHT onto BROOKFIELD ST. 0.5 miles<br>" 
PCHnewingtonCT += 				"BROOKFIELD ST becomes STONE ST. 0.2 miles<br>" 
PCHnewingtonCT += 				"STONE ST becomes CT-176. 0.7 miles<br>" 
PCHnewingtonCT += 				"Turn RIGHT onto N MOUNTAIN RD. 0.2 miles<br>" 
PCHnewingtonCT += 				"End at 730 N Mountain Rd<br>" 

OLFhartfordCT = "<font size=+2>Directions to Our Lady Fatima Church, Hartford CT</font><br><br>"
OLFhartfordCT += "<strong><u>From New York:</u></strong> Waterbury area: (I-84 East) Exit 44."
OLFhartfordCT += "At the end of the ramp, take a left onto Prospect Street. At the first light," 
OLFhartfordCT += "turn right onto KaneStreet. Our Lady of Fatima Church will be on your left. (Before the CarWash)<br><br>"
OLFhartfordCT += "<strong><u>From Boston, Glastonbury, etc:</u></strong> (I-84 West) Exit 44." 
OLFhartfordCT += "At the end of the ramp take a right (you are now on Kane Street)." 
OLFhartfordCT += "Go through one light, about 500 yards, the church will be on your left hand side (before the CarWash).<br><br>"
OLFhartfordCT += "<strong><u>From 91 North and South:</u></strong>"
OLFhartfordCT += " From either 91 North or South you will need to pick-up I-84 West. See directions above."


// FUNCTIONS
function writeDirections(directions) {
document.write(directions)
}


function printWin(directions) {
		if (navigator.appName == 'Microsoft Internet Explorer') {
 		newWindow = window.open ('', '', 'directories=0, status=0, menubar=0, scrollbars=0, resizable=1, width=600, height=500');
	}
	else if (navigator.appName == 'Netscape') {
		newWindow = window.open ('', '', 'toolbar=no, menubar=no, location=no, scrollbars=no, resizable=yes, width=600, height=500');
	}
	newWindow.document.write("<html><title>Directions</title><body><table width=100%><tr><td align=right>"
+	"<a href=javascript:window.print()>Print</a> | <a href=javascript:window.close()>Close</a></td></tr>"
+	"<tr><td>" + directions + "</td></tr>"
+	"</table></body></html>");
	newWindow.document.close();
}

function writeEmail(e,c,s) {
	if(!s) s =  'osdias.com';
	document.write('<a class="'+c+'" href="mailto:'+e+'@'+s+'">'+e+'@'+s+'</a>');
}

<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
// -->

<!-- // Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}
// -->
function writeFlashBiotch(w,h,src) {
<!-- 
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) {  // if we've detected an acceptable version
    var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width="'+w+'" height="'+h+'"'
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="'+src+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />'
    + '<embed src="'+src+'" quality="high" bgcolor="#000000" '
    + 'width="'+w+'" height="'+h+'" name="biopreloader" align="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object>';
    document.write(oeTags);   // embed the flash movie
  } else {  // flash is too old or we can't detect the plugin
    var alternateContent = '<div align="center"><font size="4" color="#FFFFFF">Macromedia Flash 8.0 is needed to view the Os Dias Bio Page.<br>'
  	+ 'Please click the link below to download the Flash plugin.<br>'
   	+ '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a></font></div>';
    document.write(alternateContent);  // insert non-flash content
  }
// -->	
}

// directory of normal images
var dir="http://www.osdias.com/images/layout/";
// directory of the OVER images 
var over="http://www.osdias.com/images/layout/over/";

function swapImage(itm,img) {
	itm.src = preImg[img].src;
}
function swapBack(itm,img) {
	itm.src = dir+myImages[img];
}

var myImages = new Array();
myImages.push("home.jpg");
myImages.push("bios.jpg");
myImages.push("media.jpg");
myImages.push("contact.jpg");
myImages.push("links.jpg");

var preImg = new Array();
for(x=0;x<myImages.length;x++){
	preImg[x] = new Image();
	preImg[x].src=over + myImages[x];
	}

// IN THE <IMG> TAG
// onmouseover="swapImage(this,0)" onmouseout="swapBack(this,0)"


function changeColor(txtField) {
	txtField.style.backgroundColor='#666666';
	txtField.style.border='1px dotted #FFFFFF';
}
function changeBack(txtField) {
	txtField.style.backgroundColor='#000000';
	txtField.style.border='1px solid #FFFFFF';
}


// IN THE <IMG> TAG
// onmouseover="swapImage(this,0)" onmouseout="swapBack(this,0)"

