// BROWSER DETECTION

	// convert all chars to lowercase

    var agt = navigator.userAgent.toLowerCase();

    var is_major = parseInt(navigator.appVersion);

    var is_minor = parseFloat(navigator.appVersion);

	

    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

    var is_ie3    = (is_ie && (is_major < 4));

    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );

    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );

	var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);

	var is_gecko = (agt.indexOf('gecko') != -1);	

	var is_opera = (agt.indexOf("opera") != -1);

    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);

    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);

    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);

    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);

    var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk

    var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // new 021205- dmr

    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

    var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128

    var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); // new021205 -- dmr



// POPUP

var remote=null;

function rsinfstrd(n,u,w,h){

	if (n=='max' && screen.width>0 && screen.height>0) {
		remote = window.open(u, "", 'width=' + (screen.width-60) + ',height=' + (screen.height-160) +',top=10,left=10,directories=no,toolbar=yes,resizable=yes,menubar=no,scrollbars=yes,replace');
	}
	else {
		remote = window.open(u, n, 'width=' + w + ',height=' + h +',top=10,left=10,directories=no,toolbar=yes,resizable=no,menubar=no,scrollbars=yes,replace');
	}

	if(remote!=null) {

		if(remote.opener==null)

			remote.opener=self;

		window.name='vv';

		remote.location.href=u;

		return false;

	}

}



// ROLLOVER

function swapimage(id, imgsrc) {

 document.getElementById(id).setAttribute('src', imgsrc);

}



function writemenu(homepage) {

if (is_ie5_5up || is_opera || is_gecko ) {

	var myclass;

	var relpath;

	if (homepage == true) relpath = 'web/'; else relpath = '';

	document.write('<div id="menuuses" class="menudiv" style="width: 160px; position:absolute; visibility:hidden;">');

	myclass = document.location.pathname.indexOf('file_synchronization')!=-1?'class="acurrent"':'';

	document.write('<div><a ' + myclass + ' href="' + relpath + 'file_synchronization.htm">File Synchronization</a></div>');

	myclass = document.location.pathname.indexOf('file_replication')!=-1?'class="acurrent"':'';

	document.write('<div><a ' + myclass + ' href="' + relpath + 'file_replication.htm">File Replication</a></div>');

	myclass = document.location.pathname.indexOf('file_backup')!=-1?'class="acurrent"':'';

	document.write('<div><a ' + myclass + ' href="' + relpath + 'file_backup.htm">File Backup</a></div>');

	myclass = document.location.pathname.indexOf('file_comparison')!=-1?'class="acurrent"':'';

	document.write('<div><a ' + myclass + ' href="' + relpath + 'file_comparison.htm">File Comparison</a></div>');

	document.write('</div>');

	document.write('<div id="menuempty" class="menudivempty"></div>');

	}

}



/* 

FREESTYLE MENU v1.0 RC (c) 2001-2004 Angus Turnbull, http://www.twinhelix.com

Altering this notice or redistributing this file is prohibited.

*/



var isDOM=document.getElementById?1:0,

 isIE=document.all?1:0,

 isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,

 isOp=self.opera?1:0,

 isDyn=isDOM||isIE||isNS4;



function getRef(i, p)

{

 p=!p?document:p.navigator?p.document:p;

 return isIE ? p.all[i] :

  isDOM ? (p.getElementById?p:p.ownerDocument).getElementById(i) :

  isNS4 ? p.layers[i] : null;

};



function getSty(i, p)

{

 var r=getRef(i, p);

 return r?isNS4?r:r.style:null;

};



if (!self.LayerObj) var LayerObj = new Function('i', 'p',

 'this.ref=getRef(i, p); this.sty=getSty(i, p); return this');

function getLyr(i, p) { return new LayerObj(i, p) };



function LyrFn(n, f)

{

 LayerObj.prototype[n] = new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px"; ' +

  'with (this) { '+f+' }');

};

LyrFn('x','if (!isNaN(p)) sty.left=p+px; else return parseInt(sty.left)');

LyrFn('y','if (!isNaN(p)) sty.top=p+px; else return parseInt(sty.top)');



if (!self.page) var page = { win:self, minW:0, minH:0, MS:isIE&&!isOp };



page.elmPos=function(e,p)

{

 var x=0,y=0,w=p?p:this.win;

 e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;

 if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}

 else if (e && e.focus && e.href && this.MS && navigator.platform.indexOf('Mac')>-1)

 {

  e.onfocus = new Function('with(event){self.tmpX=clientX-offsetX;' +

   'self.tmpY=clientY-offsetY}');

  e.focus();x=tmpX;y=tmpY;e.blur()

 }

 else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}

 return{x:x,y:y};

};



function FSMenu(myName, nested, cssProp, cssVis, cssHid)

{

 this.myName = myName;

 this.nested = nested;

 // Some CSS settings.

 this.cssProp = cssProp;

 this.cssVis = cssVis;

 this.cssHid = cssHid;

 this.cssLitClass = '';

 // The 'root' menu doesn't actually exist; it's an imaginary node that acts as a parent to

 // other menu nodes and shows/hides them as necessary.

 this.menus = { root: new FSMenuNode('root', this) };

 this.menuToShow = [];

 this.mtsTimer = null;

 this.showDelay = 0;

 this.hideDelay = 500;

};



FSMenu.prototype.show = function(mN) { with (this)

{

 // Set menuToShow to the function parameters, and a timer to call the root menu over() function if

 // no other menu node picks up the show event.

 menuToShow = arguments;

 clearTimeout(mtsTimer);

 mtsTimer = setTimeout(myName + '.menus.root.over()', 10);

}};



FSMenu.prototype.hide = function(mN) { with (this)

{

 // Clear the above timer and route the hide event to the appropriate menu node.

 clearTimeout(mtsTimer);

 if (menus[mN]) menus[mN].out();

}};



function FSMenuNode(id, obj)

{

 this.id = id;

 this.obj = obj;

 this.lyr = this.child = this.args = this.par = this.timer = null;

 var node = this;



 this.over = function(evt) { with (node) with (obj)

 {



  // Ensure NS4 calls the show/hide function within this layer first.

  if (isNS4 && evt && lyr.ref) lyr.ref.routeEvent(evt);

  clearTimeout(timer);



  if (menuToShow)

  {

   // Pull information out of menuToShow[], and clear the default root.show() timeout.

   clearTimeout(mtsTimer);

   var a = menuToShow, m = a[0];

   menuToShow = null;

   if (!menus[m] || !menus[m].lyr.ref) menus[m] = new FSMenuNode(m, obj);

   var c = menus[m];

   if (c == node) return;

   // Stop any impending show/hide of the child menu.

   clearTimeout(c.timer);

   if (c != child && c.lyr.ref)

   {

    // We have a genuinely new child menu to show. Give it some properties, set a timer to show it.

    c.args = a;

    c.par = node;

    if (showDelay) c.timer = setTimeout(myName + '.menus["' + c.id + '"].show()', showDelay);

    else c.show();

   }

  }



  // For non-nested menus, mimic event bubbling.

  if (!nested && par) par.over();

 }};



 this.out = function(evt) { with (node) with (obj)

 {

  // Basically the same as over(), this cancels impending events and sets a hide timer.

  if (isNS4 && evt && lyr && lyr.ref) lyr.ref.routeEvent(evt);

  clearTimeout(timer);

  timer = setTimeout(myName + '.menus["' + id + '"].hide()', hideDelay);

  if (!nested && par) par.out();

 }};



 // Finally, now we have created our menu node, get a layer object for the right ID'd element

 // in the page, and assign it onmouseout/onmouseover events.

 if (id != 'root') with (this) with (lyr = getLyr(id)) if (ref)

 {

  if (ref.addEventListener)

  {

   ref.addEventListener('mouseover', this.over, false);

   ref.addEventListener('mouseout', this.out, false);

  }

  else

  {

   if (isNS4) ref.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);

   ref.onmouseover = this.over;

   ref.onmouseout = this.out;

  }

 }

};



FSMenuNode.prototype.show = function() { with (this) with (obj)

{

 // This is called to show the menu node in question (it's a method of the node object).

 // It sets the parent's child to this, and hides any existing children.

 if (!par) return;

 if (par.child && par.child != this) par.child.hide();

 par.child = this;



 // This is the positioning routine, it can be deleted if you're not using it.

 // It pulls values out of the stored args[] array, and uses the page.elmPos function in the

 // cross-browser code to find the pixel position of the parent item + menu.

 var offR = args[1], offX = args[2], offY = args[3], lX = 0, lY = 0,

  doX = ''+offX!='undefined', doY = ''+offY!='undefined';

 if (offR && (doX||doY))

 {

  with (page.elmPos(offR, par.lyr ? par.lyr.ref : 0)) lX = x, lY = y;

  if (doX) lyr.x(lX + eval(offX));

  if (doY) lyr.y(lY + eval(offY));

 }



 // Append the 'highlighted' CSS classname to the current CSS classname.

 if (offR && cssLitClass && !isNS4) offR.className += (offR.className?' ':'') + cssLitClass;

 lyrVis(1);

}};



FSMenuNode.prototype.hide = function() { with (this) with (obj)

{

 // Same as show() above, but this clears the child/parent settings and hides the menu.

 if (!par) return;

 // This is an NS4 hack as its mouse events are notoriously unreliable. Remove if needed.

 if (isNS4 && self.isMouseIn && isMouseIn(lyr.ref)) return show();

 // Restore the original CSS class of the triggering element.

 if (args[1] && cssLitClass && !isNS4)

  args[1].className = args[1].className.replace(new RegExp('\\s*' + cssLitClass + '$'), '');

 // Hide the menu node element, and any child nodes.

 if (lyr) lyrVis(0);

 if (child) child.hide();

 if (par && par.child == this) par.child = null;

 par = null;

}};



FSMenuNode.prototype.lyrVis = function(sh) { with (this) with (obj)

{

 // Called by show() and hide() above, this sets the CSS properties of the menu node element.

 lyr.sty[cssProp] = sh ? cssVis : cssHid;

}};





function getFieldValue (strFieldName, Domain)

{

    var strFieldValue = "";

	var mystr = document.referrer;

	if (mystr.indexOf(Domain) > -1) {

		if (strFieldName != '') {

		    var objRegExp = new RegExp("[&|\?|\;]" + strFieldName + "=([^&]+)","gi");

		    if (objRegExp.test(document.referrer)) {

    		    strFieldValue = unescape(RegExp.$1);

			}

		}

		else { strFieldValue = Domain; }

	}

    return strFieldValue;

}



function hide(divID) {

	if (document.layers && document.layers[divID] != null) {

		document.layers[divID].style.display = 'none';

		document.layers[divID].visibility = 'hidden';

		return true;

		}

	else if (document.all) {

		document.all[divID].style.display = 'none';

		document.all[divID].style.visibility = 'hidden'; 

		return true;

	}

	else if (document.getElementById) {

		document.getElementById(''+divID+'').style.display = 'none';

		document.getElementById(''+divID+'').style.visibility = 'hidden';

		return true;

	}

	return false;

}



function setCookie(name, value, expires, path, domain, secure)

{

    document.cookie= name + "=" + escape(value) +

        ((expires) ? "; expires=" + expires.toGMTString() : "") +

        ((path) ? "; path=" + path : "") +

        ((domain) ? "; domain=" + domain : "") +

        ((secure) ? "; secure" : "");

}



function getCookie(name)

{

    var dc = document.cookie;

    var prefix = name + "=";

    var begin = dc.indexOf("; " + prefix);

    if (begin == -1)

    {

        begin = dc.indexOf(prefix);

        if (begin != 0) return '';

    }

    else

    {

        begin += 2;

    }

    var end = document.cookie.indexOf(";", begin);

    if (end == -1)

    {

        end = dc.length;

    }

    return unescape(dc.substring(begin + prefix.length, end));

}