
////////////////detect browser/////////////////////////////////////////

var ie, ns, ver, br;

if (navigator.appName == "Netscape") {
   br="ns";ns =1;
} else {
   br="ie";ie=1;
}
ver = navigator.appVersion.substring(0,1);


////////////////Generic image swapping functions///////////////////////

document.lastImgs = new Array;

function PreloadImages() { 
  images = new Array;
  for (x=0; x<PreloadImages.arguments.length; x++) {
  	images[x]=new Image;
  	images[x].src=PreloadImages.arguments[x];
  	}
}

function SwapImage () {
  if (document.images) {
   if (document.lastImgs.length) {
      RestoreImage();
   }
   a = SwapImage.arguments;
   inum = 0;
   for (x = 0; x < a.length; x+=2) {
      oldimg = a[x];
      newimg = a[x+1];
      document.images[oldimg].oldsrc = document.images[oldimg].src;
      document.images[oldimg].src=newimg;
      
      document.lastImgs[inum] = oldimg;
      inum++;
   
    }
  }
}

function RestoreImage () {
  if (document.images) {
   for (x = 0; x < document.lastImgs.length; x++) {
      img = document.lastImgs[x];
      document.images[img].src=document.images[img].oldsrc;
   }
   document.lastImgs = new Array;
  }
}

var restoreImgName = ""; 
var restoreImgSrc = "";

function SwapLayers (hideLayer,showLayer) {
  if(document.layers) {
   restoreImgName=document.layers[hideLayer].document.images[0];
   restoreImgSrc=restoreImgName.src;
   document.layers[hideLayer].document.images[0].src=showLayer;
  }
  else {
  restoreImgName=document.images[hideLayer];
  restoreImgSrc=restoreImgName.src;
  document.images[hideLayer].src=showLayer;
  }
}

function RestoreLayer () {
  restoreImgName.src=restoreImgSrc;
}

function newWindow(url, height, width, nameW, scrollbars, resize, buttons) {
    if (nameW==""){nameW='popup';}
    if (scrollbars != 1) {scrollbars = "no";} else {scrollbars = "yes";}
    if (resize != 1) {resize = "no";} else {resize = "yes";}
    if (buttons != 1) {buttons = "no";} else {buttons = "yes";}
 if (navigator.appVersion.indexOf('4') != -1) {
 // Vars for centering the new window on Version 4 Browsers
 xTop = screen.width/2 - (width/2);
 yTop = screen.height/2 - (height/2);
 p = window.open(url, nameW, 'height='+height+',width='+width+',scrollbars='+scrollbars+',resizable='+resize+',menubar='+buttons+',toolbar='+buttons+',status=0,location='+buttons+',directories=0,left=' + xTop + ',top=' + yTop + '');
 } else {
 p = window.open(url, nameW, 'height='+height+',width='+width+',scrollbars='+scrollbars+',resizable='+resize+',menubar='+buttons+',toolbar='+buttons+',status=0,location='+buttons+',directories=0,left=150,top=200');
 }
 p.focus();
}

function submitenter(myfield,e,action)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   eval(action);
   return false;
   }
else
   return true;
}

function valEmail(str, blankOk, complexOk) {

  if (blankOk == "") {
   blankOk = true;
  }
  
  if (complexOk == "") {
   complexOk = false;
  }  
   
  if (str == "" && blankOk == -1) {
   return false;
  } else {
     var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
     var reg2 = /^(\w|\.)+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
     var reg3 = /^(\w|\s|\.)*<(.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?))>$/; //valid (John Miles <john@integritive.com>)
     if (complexOk) {
        if (str && !(!reg1.test(str) && (reg2.test(str) || reg3.test(str)))) { // if not blank, and syntax is invalid 
         return false;
        }
     } else {
        if (str && !(!reg1.test(str) && reg2.test(str))) { // if not blank, and syntax is invalid
         return false;
        }
     }
  }
     return true;
}

/*-------------------------------------------------
************* Parameter Settings ******************
---------------------------------------------------*/


function imenus_data0(){


	this.enable_visual_design_mode = false			//turns the visual design pad option on or off

	this.main_is_horizontal = true
	this.menu_showhide_delay = 150



   /*---------------------------------------------
   Images (expand and pointer icons)
   ---------------------------------------------*/

	/*this.main_expand_image = "images/arrow_main.gif"
	this.main_expand_image_hover = "images/arrow_main.gif"
	this.main_expand_image_width = "7"
	this.main_expand_image_height = "5"
	this.main_expand_image_offx = "-1"
	this.main_expand_image_offy = "5"

	this.sub_expand_image = "images/arrow_sub.gif"
	this.sub_expand_image_hover = "images/arrow_sub.gif"
	this.sub_expand_image_width = "10"
	this.sub_expand_image_height = "13"
	this.sub_expand_image_offx = "0"
	this.sub_expand_image_offy = "0"

	this.main_pointer_image = 'images/pointer_down.gif'
	this.main_pointer_image_width = '10'
	this.main_pointer_image_height = '11'
	this.main_pointer_image_offx = '-5'
	this.main_pointer_image_offy = '-14'

	this.sub_pointer_image = 'images/pointer_right.gif'
	this.sub_pointer_image_width = '11'
	this.sub_pointer_image_height = '10'
	this.sub_pointer_image_offx = '-13'
	this.sub_pointer_image_offy = '-5'

	this.sub_pointer_image0_6 = 'images/pointer_left.gif'
	this.sub_pointer_image_offx0_6 = '142'

	this.sub_pointer_image0_7 = 'images/pointer_left.gif'
	this.sub_pointer_image_offx0_7 = '142'

	this.sub_pointer_image0_8 = 'images/pointer_left.gif'
	this.sub_pointer_image_offx0_8 = '142'*/


   /*---------------------------------------------
   Global Menu Styles
   ---------------------------------------------*/

	//Main Menu

	this.main_container_styles = ""
	this.main_item_styles = ""
	this.main_item_hover_styles = ""
	this.main_item_active_styles = "background: #FFFFFF"


	//Sub Menu

	this.subs_container_styles = "font-family: tahoma, arial, helvetica, sans-serif; background-color:#B07F5C; border-style:solid; border-color:#61241B; border-width:1px; padding-top:5px; padding-bottom:5px; "
	this.subs_item_styles = "color:#FFFFFF; text-align:left; font-size:13px; font-weight:bold; text-decoration:none; padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; border-bottom: solid 1px #C8A48B"
	this.subs_item_hover_styles = "background-color:#C8A48B; "
	this.subs_item_active_styles = "text-decoration:underline; "



}
