function menucolor(div,state)
{
	var oDiv, oState
	oDiv = document.getElementById(div)
	if (state == "on"){
		oDiv.className = "navtableOver";
	}
	else{
		oDiv.className = "navtable";
	}
}
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------

/*******************************************************
FLASH DETECT 3
All code by Ryan Parman and mjac, unless otherwise noted.
(c) 1997-2004 Ryan Parman and mjac
http://www.skyzyx.com
*******************************************************/

// This script will test up to the following version.
flash_versions = 20;

// Initialize variables and arrays
var flash = new Object();
flash.installed=false;
flash.version='0.0';

// Dig through Netscape-compatible plug-ins first.
if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
			flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
			flash.installed = true;
			break;
		}
	}
}

// Then, dig through ActiveX-style plug-ins afterwords
else if (window.ActiveXObject) {
	for (x = 2; x <= flash_versions; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {
				flash.installed = true;
				flash.version = x + '.0';
			}
		}
		catch(e) {}
	}
}

// Create sniffing variables in the following style: flash.ver[x]
// Modified by mjac
flash.ver = Array();
for(i = 4; i <= flash_versions; i++) {
	eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

//*************************** no flash gallery slideshow
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

	Pic[0] = "/images/noflashgallery/gall01.jpg"
	Pic[1] = "/images/noflashgallery/gall02.jpg"
	Pic[2] = "/images/noflashgallery/gall03.jpg"
	Pic[3] = "/images/noflashgallery/gall04.jpg"
	Pic[4] = "/images/noflashgallery/gall05.jpg"
	Pic[5] = "/images/noflashgallery/gall06.jpg"
	Pic[6] = "/images/noflashgallery/gall07.jpg"
	Pic[7] = "/images/noflashgallery/gall08.jpg"
	Pic[8] = "/images/noflashgallery/gall09.jpg"
	Pic[9] = "/images/noflashgallery/gall10.jpg"

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
//***************************
//rollover buttons
function swapImage(id,state){
document.getElementById(id).style.backgroundImage = 'url(images/'+id+state+'.gif)';
}


//preload images
pic1= new Image; 
pic1.src="images/nav_1on.gif"; 
pic2= new Image; 
pic2.src="images/nav_1on.gif"; 
pic3= new Image; 
pic3.src="images/nav_1on.gif"; 
pic4= new Image; 
pic4.src="images/nav_1on.gif"; 
pic5= new Image; 
pic5.src="images/nav_1on.gif"; 
pic6= new Image; 
pic6.src="images/nav_1on.gif"; 
pic7= new Image; 
pic7.src="images/nav_1on.gif"; 
pic8= new Image; 
pic8.src="images/nav_1on.gif"; 

function checkForm(){
	
		var strError;
		var strError2;
		strError2 = '';
		
		strError = 'The following fields require information:\n\n'
		
		if(document.getElementById('name').value == '')
			strError2 = strError2 + 'Name\n'
		
		if(document.getElementById('phone').value == '')
			strError2 = strError2 + 'Phone\n'		
			
		if(document.getElementById('email').value == '')
		strError2 = strError2 + 'Email\n'
		
		if(strError2.length > 0){
			alert(strError + strError2);
			return false;
		}else{
			return true;
		}
		
	
}

function validate_newsletter(form){
	if(!echeck(form.newsletter.value)){
		form.newsletter.value = "Enter valid email";
		return false;
	}
	else{
		//alert("hi");
		//form.submit();
	}
}

function echeck(str) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,6})+$/.test(str)){
return (true)
}
return (false)
}



