N   = (document.layers) ? true:false;                 // netscape 4
I   = (document.all) ? true:false;                    // ie4+
DOM = ((document.getElementById)&&(!I))?true:false;   // ns6 etc.
MAC = (navigator.platform=="MacPPC")?true:false;   // Mac
SAFARI = (navigator.userAgent.indexOf('Safari')>-1)?true:false;   // Mac
Ixp   = (document.all)&&(navigator.userAgent.indexOf('Windows NT 5.1')>-1) ? true:false;                    // windows xp 
IE7   = (document.all)&&(navigator.userAgent.indexOf('MSIE 7')>-1) ? true:false;                    // IE7

//jump menus
function jumpTo(targ,sel){ 
  eval(targ+".location='"+sel.options[sel.selectedIndex].value+"'");
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0 revised by FMI
	if(selObj.options[selObj.selectedIndex].text.indexOf('Choose')>-1){return}
  else{eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;}
}
//Search clear quotes
function clearQuotes(d){
d.keywords.value=d.keywords.value.replace(/["]/g,"");
return
}
//Script for Go Back button
function goBack () {
window.history.go (-1);
}
//standard pop-up
function stdPop(where,title,w,h){
	window.open(where, title, 'toolbar=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+',top=100,left=100')
}
//user groups pop-up
function userPop(where,title,w,h,t,l){
	window.open(where, title, 'toolbar=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+',top='+t+',left='+l+'')
}
//OverView Pop-up
function overPop(){
	window.open('/downloads/overview/overview.html', 'Overview', 'toolbar=no,scrollbars=no,resizable=yes,width=800,height=600,top=100,left=100')
}
function clik(){
}
//Special Charactor Removal
function specialChar(field) {
        var re=/[*]|["]|[']/g;
		adjusted=field.value.replace(re, "");field.value=adjusted;
}
//Techinfo search functions
var ti='http://www.filemaker.com/ti/'; 
function smartClear(formText){
	if (formText.value=='Type search words here'||formText.value=='Type article number here')formText.value=''
}
function goArtNum(){
		var num=document.artNum.num
		if (isNaN(num.value)||num.value.length!=6){
			alert('Please type the 6 digit article number.');}
	else eval("location='"+ti+num.value+".html'")
}
function validSurvey(d){
	var e=new Date()
	var year=e.getTime()+(365*24*60*60*1000)
	e.setTime(year)
	if (document.cookie.indexOf(d.survey.value)>-1)(d.key.value=2)
	if (document.cookie.indexOf(d.survey.value)<0)(d.key.value=1)
	if (document.cookie==''){document.cookie="key="+d.survey.value+"; expires=" + e.toGMTString()}
	else {if(document.cookie.indexOf(d.survey.value)<0){document.cookie+=d.survey.value+"; expires=" + e.toGMTString()}return}
}
function validate(d){
	var e=new Date()
	var year=e.getTime()+(365*24*60*60*1000)
	e.setTime(year)
	if (document.cookie.indexOf(d.survey.value)>-1)(d.key.value=2)
	if (document.cookie.indexOf(d.survey.value)<0)(d.key.value=1)
	if (document.cookie==''){document.cookie="key="+d.survey.value+"; expires=" + e.toGMTString()}
	else {if(document.cookie.indexOf(d.survey.value)<0){document.cookie+=d.survey.value+"; expires=" + e.toGMTString()}return}
}
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;
}

var obj;
var objChild;

function menuinit() {
	//cssjsmenu('globalNav');
	new ProtoFish('globalMain2', '100', 'hover', false); 
	//MM_preloadImages('http://web.softdesign.dk/expressii30/res/res_dfd2/images/top_menu_bg_hover.jpg','http://web.softdesign.dk/expressii30/res/res_dfd2/images/top_menu_bg_hover.jpg');
}

var site;

function setMouseOverStyles(obj){
	//I added which turns on the style to match the rollover effect on the nested list			 
	
			  
			   //obj.style.backgroundImage = 'url(http://web.softdesign.dk/expressii30/res/res_dfd2/images/top_menu_bg_hover.jpg)';
			   //obj.style.backgroundPosition = 'right top';
			   //obj.style.backgroundRepeat =  'no-repeat';

			 
			  //obj.childNodes[0].style.backgroundImage = 'url(http://web.softdesign.dk/expressii30/res/res_dfd2/images/top_menu_bg_hover.jpg)';
			  //obj.childNodes[0].style.backgroundPosition = 'left top';
			  //obj.childNodes[0].style.backgroundRepeat =  'no-repeat';
			  //obj.childNodes[0].style.color = '#FFFFFF';
			  //	  obj.style.backgroundPosition = '89% 0';
			  //if(IE7){obj.style.backgroundPosition = '89% 3';}
		

}
function setMouseOutStyles(){
//Added which turns off the style implemented by the js
				objChild.style.visibility = 'hidden';
//				obj.style.border = '#ffffff solid 0px';
				
				//NEW
				//obj.style.backgroundImage = 'url(http://web.softdesign.dk/expressii30/res/res_dfd2/images/top_menu_bg.jpg)';
				//obj.childNodes[0].style.color ='#747576'
				//obj.childNodes[0].style.backgroundImage = 'url(http://web.softdesign.dk/expressii30/res/res_dfd2/images/top_menu_bg.jpg)';
//End add
}
function elementContains(elmOuter, elmInner){
  while (elmInner && elmInner != elmOuter)
  {elmInner = elmInner.parentNode;}
  if (elmInner == elmOuter){
    return true;}
  return false;
}
function getPageXY(elm)
{
  var point = { x: 0, y: 0 };
  while (elm)
  {
		point.x += elm.offsetLeft;
    	point.y += elm.offsetTop;
    	elm = elm.offsetParent;
	 }
return point;
}
function setPageXY(elm, x, y){
  var parentXY = {x: 0, y: 0 };
  if (elm.offsetParent){
    parentXY = getPageXY(elm.offsetParent);}
	//if(DOM){y+=2}//Mine to give some distance from the parent li
	if(IE7) y-=10;
	elm.style.left = (x) + 'px';elm.style.top = (y) + 'px';
}
function cssjsmenu(menuid){
  var i;
  var j;
  var node;
  var child;
  var parent;
  if (!document.getElementById)
  {
    return true;
  }
  var version;
  var offset;
  offset = navigator.userAgent.indexOf('Opera');
  if (offset != -1){
    version = parseInt('0' + navigator.userAgent.substr(offset + 6), 10);
		if (version < 7){
      return true;}
  }
var menudiv = document.getElementById(menuid);
  // ul
  var ul = new Array();
  for (i = 0; i < menudiv.childNodes.length; i++){
	node = menudiv.childNodes[i];
    if (node.nodeName.toUpperCase() == 'UL'){
      ul[ul.length] = node;}
  }
  // ul > li
  var ul_gt_li = new Array();
  for (i = 0; i < ul.length; i++){
    node = ul[i];for (j = 0; j < node.childNodes.length; j++)
    {
      child = node.childNodes[j];
      if (child.nodeName.toUpperCase() == 'LI'){
        ul_gt_li[ul_gt_li.length] = child;
        child.style.display = 'inline';
        child.style.listStyle = 'none';
        child.style.position = 'static';
		 if(!SAFARI){child.style.borderBottom = '#ffffff solid 0px'} }
    }
  }
  // ul > li > ul
  var ul_gt_li_gt_ul = new Array();
  for (i = 0; i < ul_gt_li.length; i++)
  {
    node = ul_gt_li[i];
    for (j = 0; j < node.childNodes.length; j++)
    {
      child = node.childNodes[j];
      if (child.nodeName.toUpperCase() == 'UL')
      {
        ul_gt_li_gt_ul[ul_gt_li_gt_ul.length] = child;
 
 		parent = child.parentNode; 
        parent.onmouseover = function (e)
        {
          var i;
          var child;
          var point;
          // stop the pure css hover effect
          this.style.paddingBottom = '0';
          for (i = 0; i < this.childNodes.length; i++)
          {
            child = this.childNodes[i];
            if (child.nodeName.toUpperCase() == 'UL')
            {
              point = getPageXY(this);
              setPageXY(child, point.x, point.y + this.offsetHeight);
              child.style.visibility = 'visible';
			 setMouseOverStyles(this);}
			}
          return false;
        };
        parent.onmouseout = function (e)
        {
          var relatedTarget = null;
          if (e){//Nescape&Mozilla&Safari 
		  
            relatedTarget = e.relatedTarget;
	    	if (navigator.product == 'Gecko' && navigator.platform.indexOf('Linux') != -1 && !relatedTarget){
	      		relatedTarget = e.originalTarget;}
          }
          else if (window.event){//IE
          	relatedTarget = window.event.toElement;}
          	if (elementContains(this, relatedTarget)){
            return false;}
          var i;
          var child;
          for (i = 0; i < this.childNodes.length; i++)
          {
            child = this.childNodes[i];
            if (child.nodeName.toUpperCase() == 'UL')
            {
					obj=this;
					objChild=child;
					setMouseOutStyles();
            }
          }
          return false;
        };
      }
    }
  }
  return true;
}
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];}}
}
//---------------Needs cleaning----------------
var interval=200,b,selectObjActive=false
//------------------------End of cleaning-------

function linkTo(a)
{
window.opener.location=a;
self.close();
}
/* ****** upgrade selector script ***** */
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 iHeartFM(selObj,that){
var a=MM_findObj(that)
var p=MM_findObj('currentProd');
a.innerHTML="&nbsp;"+answer[selObj[selObj.selectedIndex].value]
}
/*  end upgrade selector script */

/* Show / Hide Divs Toggle */
/* javascript used for showing and hiding the answers */

function toggle_one( id ) {
	var loc = document.getElementById( id );
	if( loc.className == 'hide' ) {
		loc.className = 'show';
	} else {
		loc.className = 'hide';
	}

	// change the class of the selected faq icon
	var button = id  + '-button';
	var loc_button = document.getElementById( button );
	if( loc_button.className == 'expanded' ) {
	 	loc_button.className = 'collapsed';
	} else {
	 	loc_button.className = 'expanded';
	}
}
/* end Show / Hide Divs Toggle */

/* Show / Hide ALL Divs Toggle */

function toggle_all( id ) {
	var allDivs = document.getElementById( 'faqs' ).getElementsByTagName( 'div' );
	for ( var i = 0; i < allDivs.length; i++ ) {
		if( allDivs[i].className == 'hide' ) {
		 	allDivs[i].className = 'show';
		} else {
		 	allDivs[i].className = 'hide';
		}
  }
  // change the icon of "show all answers"
	var loc_button = document.getElementById( 'show-all-button' );
	if( loc_button.className == 'arrow-expanded' ) {
	 	loc_button.className = 'arrow-collapsed';
	} else {
	 	loc_button.className = 'arrow-expanded';
	}
}
/* end Show / Hide ALL Divs Toggle */

/* Show / Hide Divs Toggle USING PROTOTYPE EFFECTS */
/* javascript used for showing and hiding the answers */

function swap( id ) {
	var loc = document.getElementById( id );
	if( loc.style.display == 'none' ) {
		new Effect.PhaseIn($(id));
	} else {
		new Effect.PhaseOut($(id));
	}

	// change the class of the selected faq icon
	var button = id + '-button';
	var loc_button = document.getElementById( button );
	if( loc_button.className == 'expanded' ) {
		loc_button.className = 'collapsed';
	} else {
		loc_button.className = 'expanded';
	}
}
function swap_all( ) {
	var allDivs = document.getElementById( 'fmsChart' ).getElementsByTagName( 'ul' );
	for ( var i = 0; i < allDivs.length; i++ ) {
		if( allDivs[i].style.display == 'none' ) {
			new Effect.PhaseIn(allDivs[i]);
		}	else {
		  new Effect.PhaseOut(allDivs[i]);
		}
	}
	// change the class of the selected faq icon
	var button = id + '-button';
	var loc_button = document.getElementById( button );
	if( loc_button.className == 'expanded' ) {
		loc_button.className = 'collapsed';
	} else {
		loc_button.className = 'expanded';
	}
}
