/****************************************************\
| Honeycomb Worldwide UI 1.0                         |
| Copyright by BonaSource Inc. (bonasource.com) 2003 |
\****************************************************/


var bkModDDOverColorN = "#B6C9F2";
var bkModDDOverColorO = "#DFE6F3";

function bkModDDOver(obj, st) {
  if(!isDOM) return;
	var i, objStyle;
	objStyle = (obj.style) ? obj.style : obj;
	objStyle.backgroundColor = (st) ? bkModDDOverColorO : bkModDDOverColorN;
}

//========================================================

function showClickBKModDDMenuLI(mItemName) {
	for(i=0; i<coM; i++) {
		if(!upMenu[i][0]) continue;
    if(mItemName == upMenu[i][0]) break;
	}
	if(upMenu[i][1] && upMenu[i][1].isExist() && upMenu[i][1].isVisible()) upMenu[i][1].hide();
	else showBKModDDMenuLI(mItemName);
}

function showBKModDDMenuLI(mItemName) {
  var i, p, mPosX, mPosY;
  imPos = new Array();
  for(i=0; i<coM; i++) {
		if(!upMenu[i][0]) continue;
    if(mItemName != upMenu[i][0]) {
			if(upMenu[i][1] && upMenu[i][1].isExist()) upMenu[i][1].hide();
    }
    else {
      cancelCloseMenuLI();
      if(upMenu[i][1] && upMenu[i][1].isExist()) {
        mPosX = upMenu[i][2].getAbsoluteLeft() + upMenu[i][2].getWidth() - upMenu[i][1].getWidth();
        if(mPosX + upMenu[i][1].getWidth() - getScrollX() > getWindowWidth())
          if((mPosX = getWindowWidth() - upMenu[i][1].getWidth()) < 0) mPosX = 0;
        mPosY = upMenu[i][2].getAbsoluteTop() + upMenu[i][2].getHeight() + 0;
        if(mPosY + upMenu[i][1].getHeight() - getScrollY() > getWindowHeight())
          mPosY = upMenu[i][2].getAbsoluteTop() - upMenu[i][1].getHeight() + 2;
        upMenu[i][1].moveTo(mPosX, mPosY);
        upMenu[i][1].show();
        curTM = 1000;
      }
      else {
        curTM = 0;
      }
    }
  }
}

//========================================================
// 		original
//========================================================

var mmOverBGColorN = "#FFFFFF";
var mmOverBGColorO = "#CDD9EB";

function mmOver(obj, st) {
	if(!isDOM || !obj) return;
	var i, objStyle;
	var objTD = obj.getElementsByTagName('TD');
	var objTDLength = objTD.length;
	for(i = 0; i < objTDLength; i++) {
		objStyle = (objTD[i].style) ? objTD[i].style : objTD[i];
		objStyle.backgroundColor = (st) ? mmOverBGColorO : mmOverBGColorN;
		if(objTD[i].firstChild && objTD[i].firstChild.nodeName && objTD[i].firstChild.nodeName == 'A') {
			objStyle = (objTD[i].firstChild.style) ? objTD[i].firstChild.style : objTD[i].firstChild;
			objStyle.textDecoration = (st) ? 'underline' : 'none';
		}
	}
}

var smOverBGColorN = "#FFFFFF";
var smOverBGColorO = "#CDD9EB";

function smOver(obj, st) {
	if(!isDOM || !obj) return;
	var i, objStyle;
	var objTD = obj.getElementsByTagName('TD');
	var objTDLength = objTD.length;
	for(i = 0; i < objTDLength; i++) {
		objStyle = (objTD[i].style) ? objTD[i].style : objTD[i];
		objStyle.backgroundColor = (st) ? smOverBGColorO : smOverBGColorN;
		if(objTD[i].firstChild && objTD[i].firstChild.nodeName && objTD[i].firstChild.nodeName == 'A') {
			objStyle = (objTD[i].firstChild.style) ? objTD[i].firstChild.style : objTD[i].firstChild;
			objStyle.textDecoration = (st) ? 'underline' : 'none';
		}
	}
}

function mmGo(obj) {
	if(!isDOM || !obj) return;
	event.cancelBubble = true;
	var objA = obj.getElementsByTagName("A");
  window.location = objA[0].href;
}

//========================================================

function BSMenu() {
  this.div = new Array();
  this.dcounter = 0;
}

BSM = BSMenu.prototype;

BSM.add = function(bsdObj) {
  this.div[this.dcounter++] = bsdObj;
}

BSM.render = function() {
  var bsdc, i, j, obj, ls, rs, str, resstr, arr, arItem, nstrb, nstre, coLt, coClt, coCt, coItem;
  arLt = new Array();
  arClt = new Array();
	arCt = new Array();
  for(bsdc = 0; bsdc < this.dcounter; bsdc++) {
    obj = this.div[bsdc];
		str = obj.lt; coLt = 0;
		nstrb = 0;
		while((nstre = str.indexOf("##", nstrb)) != -1) {
			arLt[coLt++] = str.substring(nstrb, nstre);
			arLt[coLt++] = str.substring(nstre, nstre + 8);
			nstrb = nstre + 8;
		}
		arLt[coLt] = str.substring(nstrb);
		str = obj.clt; coClt = 0;
		nstrb = 0;
		while((nstre = str.indexOf("##", nstrb)) != -1) {
			arClt[coClt++] = str.substring(nstrb, nstre);
			arClt[coClt++] = str.substring(nstre, nstre + 8);
			nstrb = nstre + 8;
		}
		arClt[coClt] = str.substring(nstrb);
		str = obj.ct; coCt = 0;
		nstrb = 0;
		while((nstre = str.indexOf("##", nstrb)) != -1) {
			arCt[coCt++] = str.substring(nstrb, nstre);
			arCt[coCt++] = str.substring(nstre, nstre + 8);
			nstrb = nstre + 8;
		}
		arCt[coCt] = str.substring(nstrb);
		arr = obj.links;
		resstr = "";
    for(i = 0; i < obj.counter; i++) {
	  if(arr[i].state == 1) {
	    arItem = arLt;
			coItem = coLt;
	  }
		else if(arr[i].state == 2) {
	    arItem = arClt;
			coItem = coClt;
	  }
	  else {
	    arItem = arCt;
			coItem = coCt;
	  }
	  for(j = 0; j <= coItem; j++) {
	    switch (arItem[j]) {
		  	case '##DVID##': resstr += obj.id; break;
		  	case '##ITID##': resstr += 't' + i + obj.id; break;
		  	case '##LINK##': resstr += arr[i].url; break;
		  	case '##TEXT##': resstr += arr[i].text; break;
		  	case '##TRGT##': resstr += arr[i].target; break;
		  	default: resstr += arItem[j];
			}
	  }
    }
	str = obj.dt;
	nstrb = str.indexOf("##DVID##");
    ls = str.substring(0, nstrb);
    rs = str.substring(nstrb + 8);
    str = ls + obj.id + rs;
    nstrb = str.indexOf("##ITMS##");
    ls = str.substring(0, nstrb);
    rs = str.substring(nstrb + 8);
    str = ls + resstr + rs;
    document.write(str);
  }
}

function BSDiv(id, level, divTempl, linkTempl, curLinkTempl, curTempl) {
  this.id = "d" + level + id;
  this.level = level;
  this.links = new Array();
  this.counter = 0;
  this.dt = divTempl;
  this.lt = linkTempl;
  this.clt = (curLinkTempl) ? curLinkTempl : '';
  this.ct = (curTempl) ? curTempl : '';
}

BSD = BSDiv.prototype;

BSD.add = function(state, url, text, target) {
  this.links[this.counter++] = new BSItem(state, url, text, target);
}

BSD.itemOff = function(itm) {
  this.links[itm-1][0] = 0;
}

function BSItem(state, url, text, target) {
  this.state = state;
  this.url = url;
  this.text = text;
  this.target = (!target || target == "") ? "_top" : target;
}

BSI = BSItem.prototype;

divTempl = '<div id="##DVID##" style="position:absolute; left:1px; top:1px; z-index:101; visibility: hidden" onMouseOver="flClose=1; cancelCloseMenuLI(); return true" onMouseOut="flClose=0; hideMenuLI(); return true"><table border="0" cellspacing="0" cellpadding="0" class="bgDM"><tr><td class="bgDMTB"><img src="images/z.gif" width="111" height="1"></td></tr>##ITMS##<tr><td class="bgDMTB"><img src="images/z.gif" width="1" height="1"></td></tr></table></div>';

linkTempl = '<tr><td class="bgDMItemN" nowrap onMouseOver="this.style.backgroundColor=\'#A3CDE0\'; return false" onMouseOut="this.style.backgroundColor=\'#F1F3F5\'; return false" onClick="mmGo(this); return false"><nobr><a href="##LINK##" class="dmItemLinkN">##TEXT##</a></nobr></td></tr>';

curLinkTempl = '<tr><td class="bgDMItemCL" nowrap onMouseOver="this.style.backgroundColor=\'#A3CDE0\'; if((this.firstChild.firstChild.style.color=\'#000000\')); return false" onMouseOut="this.style.backgroundColor=\'#F1F3F5\'; if((this.firstChild.firstChild.style.color=\'#1176A0\')); return false" onClick="mmGo(this); return false"><nobr><a href="##LINK##" class="dmItemLinkCL">##TEXT##</a></nobr></td></tr>';

curTempl = '<tr><td class="bgDMItemC" nowrap><nobr><span class="dmItemLinkC">##TEXT##</span></nobr></td></tr>';

//========================================================


divModTempl = '<div id="##DVID##" class="bkDM" style="position:absolute; left: 1px; top: 1px; z-index:30070; visibility: hidden" onMouseOver="flClose=1; cancelCloseMenuLI(); return true" onMouseOut="flClose=0; hideMenuLI(); return true"><table border="0" cellspacing="0" cellpadding="0">##ITMS##</table></div>';

linkModTempl = '<tr><td class="bkDMItemN" onMouseOver="bkModDDOver(this, 1);" onMouseOut="bkModDDOver(this, 0);" onClick="totalHideMenuLI(); ##LINK##; return false" nowrap><nobr><span class="bkDMItemLinkN">##TEXT##</span></nobr></td></tr>';

curLinkModTempl = '';

sepModTempl = '';

//************* 


var tm, flClose = 0, coM = 0, curTM = 1000;
upMenuIni = new Array();
for(i=0; i<100; i++) {
  upMenuIni[i] = 0;
}
upMenu = new Array();
for(i=0; i<100; i++) {
  upMenu[i] = 0;
}

function initMenuLI(nm) {
  upMenuIni[coM] = new Array();
  upMenuIni[coM][0] = nm;
  coM++;
}

function renderMenuLI() {
  var i;
  for(i = 0; i < coM; i++) {
    upMenu[i] = new Array();
    upMenu[i][0] = upMenuIni[i][0];
    upMenu[i][1] = layer('d1' + upMenuIni[i][0]);
	upMenu[i][2] = layer(upMenuIni[i][0]);
  }
}

function showMenuLI(mItemName) {
  var i, p, mPosX, mPosY;
  imPos = new Array();
  for(i=0; i<coM; i++) {
    if(mItemName != upMenu[i][0]) {
      if(upMenu[i][1].isExist()) upMenu[i][1].hide();
    }
    else {
      cancelCloseMenuLI();
      if(upMenu[i][1].isExist()) {
        mPosX = upMenu[i][2].getAbsoluteLeft() + 1;
        if(mPosX + upMenu[i][1].getWidth() > getWindowWidth())
          if((mPosX = getWindowWidth() - upMenu[i][1].getWidth()) < 0) mPosX = 0;
        mPosY = upMenu[i][2].getAbsoluteTop() + upMenu[i][2].getHeight() + 6;
        if(mPosY + upMenu[i][1].getHeight() > getWindowHeight())
          if((mPosY = (imPos[1] - 24 < 0)) < 0) mPosY = 0;
        upMenu[i][1].moveTo(mPosX, mPosY);
        upMenu[i][1].show();
        curTM = 1000;
      }
      else {
        curTM = 0;
      }
    }
  }
}

function hideMenuLI() {
  if(self.tm) clearTimeout(tm);
  if(!flClose) tm=setTimeout("totalHideMenuLI()", curTM);
}

function totalHideMenuLI(){
  var i;
  for(i=0; i<coM; i++) {
    if(upMenu[i][1].isExist()) upMenu[i][1].hide();
  }
}

function cancelCloseMenuLI(){
  if(self.tm) clearTimeout(tm);
}

//========================================================

var KS=[];
var KScounter=0;
var scrTM;

function KScrolling(text){
  if(text == "") {
    this.text = false;
	return;
  }
  this.number = KScounter++;
  this.speed = 30;
  this.text = text+"<br>"+text;
  KS[this.number] = this;
}

KScrolling.prototype.print=function(){
  if(!this.text) return "<img src=\"/images/z.gif\" class=\"txHomeIS\">";
  if(isMSIE || isMozilla || isOpera7) {
    return ("<div id='KSborder" + this.number + "' class=\"txHomeIS\"><div id='KStext" + this.number + "' class=\"txHomeISText\" style='position: relative; top: 0px; left: 0px; visibility: hidden'>" + this.text + "</div></div>");
  }
  else {
    return (this.text);
    this.badBrowser = true;
  }
}

KScrolling.prototype.scroll=function() {
  if(!this.text) {
    if(isMSIE || isMozilla || isOpera7) {
      document.getElementById('infoBoxPl').style.visibility = 'hidden';
	}
	else {
	  document.images["hlsinfAt"].src = "/images/hlinf-text-blank.gif";
	}
	return;
  }
  if(this.badBrowser) return;
  if(!this.layer) {
    this.layer = layer("KStext" + this.number);
    this.layer.show();
    this.offset = 0;
  }
  else {
    this.offset = (this.offset + 1) % (this.layer.getHeight() / 2);
    this.layer.moveY(-this.offset);
  }
  scrTM = setTimeout("KS[" + this.number + "].scroll()", this.speed);
}

KScrolling.prototype.stopScroll=function() {
  if(scrTM) clearTimeout(scrTM);
}


//========================================================

var isOK;

function checkEmail(fld) {
  var i = 0, coS = 0, cStr, flDot = true;
  var str = document.forms['form3'].elements[fld].value;
  while((i = str.indexOf('@', i + 1)) != -1) coS++;
  while((i = str.indexOf('.', i + 1)) != -1)
    if(str.indexOf('.', i + 1) != -1 && (str.indexOf('.', i + 1) - i) == 1) flDot = false;
  if(coS == 1 && flDot && str.indexOf(' ') == -1 && str.charAt(0) != '.') {
    var lStr = str.substring(0, str.indexOf('@'));
	var rStr = str.substring(str.indexOf('@') + 1, str.length);
	if(lStr.charAt(lStr.length - 1) != '.' && rStr.charAt(0) != '.') {
	  if((coS = rStr.lastIndexOf('.')) != -1) {
	    if((str.lastIndexOf('.') - str.indexOf('@')) > 1) {
	      rStr = rStr.substring(coS + 1, str.length);
	      if(rStr.length > 1) {
		    isOK = true;
		    return true;
		  }
	    }
      }
	}
  }
  isOK = false;
  alert('Please enter valid email');
  return false;
}



dWriteDiv = '<div id="zoomDIVfix" class="divFixSize">WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW</div>';
dWriteDiv += '<div id="zoomDIV" class="divSize" onresize="resDoc();">WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW</div>';

function resDoc() {
  var cz = Math.round(document.all.zoomDIV.offsetWidth / document.all.zoomDIVfix.offsetWidth * 100);
  if(cz > 95 && cz < 105) cz = 100;
  document.body.style.zoom = cz + "%";
}

function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);