<!--  -->
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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

<!-- Email Display Protection -->
function showEmail(user, domain, tld, title){ 
   var emailId = user + "\u0040" + domain + "." + tld; 
   var url = "mailto:" + emailId; 

   if(!title){ 
       title = emailId; 
   } 
   document.write("<a href='" + url + "'>" + title + "</a>"); 
} 

<!-- Capital letters -->

function changeCase(frmObj) {
var index;
var tmpStr;
var tmpChar;
var preString;
var postString;
var strlen;
tmpStr = frmObj.value.toLowerCase();
strLen = tmpStr.length;
if (strLen > 0)  {
for (index = 0; index < strLen; index++)  {
if (index == 0)  {
tmpChar = tmpStr.substring(0,1).toUpperCase();
postString = tmpStr.substring(1,strLen);
tmpStr = tmpChar + postString;
}
else {
tmpChar = tmpStr.substring(index, index+1);
if (tmpChar == " " && index < (strLen-1))  {
tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
preString = tmpStr.substring(0, index+1);
postString = tmpStr.substring(index+2,strLen);
tmpStr = preString + tmpChar + postString;
         }
      }
   }
}
frmObj.value = tmpStr;
}



<!-- tellfriend popup -->
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


///// open windows
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}




<!-- mailbox newopenclose div -->

function open_close_div(id) {
if(document.all) { // IE
	if (document.all[id].style.display == 'none') {
		document.all[id].style.display = 'block';
	} else {
		document.all[id].style.display = 'none';
	}
}
if(!document.all && document.getElementById) { // Netscape 6
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block';
	} else {
		document.getElementById(id).style.display = 'none';
	}
}
}

<!-- mouseover newopenclose div -->
function open_div(id) {
if(document.all) { // IE
	document.all[id].style.display = 'block';
}
if(!document.all && document.getElementById) { // Netscape 6
		document.getElementById(id).style.display = 'block';
}
}

function close_div(id) {
if(document.all) { // IE
		document.all[id].style.display = 'none';
}
if(!document.all && document.getElementById) { // Netscape 6
		document.getElementById(id).style.display = 'none';
}
}




<!-- small user DIV -->

var opened_div;

var opened_div;

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){

if( opened_div ) { overlayclose( opened_div ); }

if (document.getElementById){
var subobj=document.getElementById(subobjstr)
document.onclick=function(e){
clicktohide(curobj, subobjstr, e)
}
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
opened_div = subobjstr;
return false
}
else
return true
}

function overlayrollover(curobj, subobjstr, opt_position){

if( opened_div ) { overlayclose( opened_div ); }

if (document.getElementById){
var subobj=document.getElementById(subobjstr)
document.onmousemove=function(e){
clicktohiderollover(curobj, subobjstr, e)
}
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
opened_div = subobjstr;
return false
}
else
return true
}


function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

function clicktohide(linkobj, subobj, e){
var currentnode=(window.event)? event.srcElement : e.target
var hidesubobj=true
while (currentnode.tagName!="BODY" && currentnode.tagName!="HTML"){
//if (currentnode.id==subobj || currentnode==linkobj){
if ( currentnode==linkobj){
 hidesubobj=false
 break
}
currentnode=currentnode.parentNode
}
if (hidesubobj)
overlayclose(subobj)
}


function clicktohiderollover(linkobj, subobj, e){
var currentnode=(window.event)? event.srcElement : e.target
var hidesubobj=true
while (currentnode.tagName!="BODY" && currentnode.tagName!="HTML"){
if (currentnode.id==subobj || currentnode==linkobj){
//if ( currentnode==linkobj){
 hidesubobj=false
 break
}
currentnode=currentnode.parentNode
}
if (hidesubobj)
overlayclose(subobj)
}


function enableTooltips(id){
var links,i,h;
if(!document.getElementById || !document.getElementsByTagName) return;
AddCss();
h=document.createElement("span");
h.id="btc";
h.setAttribute("id","btc");
h.style.position="absolute";
document.getElementsByTagName("body")[0].appendChild(h);
if(id==null) links=document.getElementsByTagName("a");
else links=document.getElementById(id).getElementsByTagName("a");
for(i=0;i<links.length;i++){
    Prepare(links[i]);
    }
}

function Prepare(el){
var tooltip,t,b,s,l;
t=el.getAttribute("title");
if(t==null || t.length==0) t="link:";
el.removeAttribute("title");
tooltip=CreateEl("span","tooltip");
s=CreateEl("span","top");
s.appendChild(document.createTextNode(t));
tooltip.appendChild(s);
b=CreateEl("b","bottom");
l=el.getAttribute("href");
if(l.length>28) l=l.substr(0,25)+"...";
b.appendChild(document.createTextNode(l));
tooltip.appendChild(b);
setOpacity(tooltip);
el.tooltip=tooltip;
el.onmouseover=showTooltip;
el.onmouseout=hideTooltip;
el.onmousemove=Locate;
}

function showTooltip(e){
document.getElementById("btc").appendChild(this.tooltip);
Locate(e);
}

function hideTooltip(e){
var d=document.getElementById("btc");
if(d.childNodes.length>0) d.removeChild(d.firstChild);
}

function setOpacity(el){
el.style.filter="alpha(opacity:95)";
el.style.KHTMLOpacity="0.95";
el.style.MozOpacity="0.95";
el.style.opacity="0.95";
}

function CreateEl(t,c){
var x=document.createElement(t);
x.className=c;
x.style.display="block";
return(x);
}

function AddCss(){
var l=CreateEl("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
l.setAttribute("href","bt.css");
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
}

function Locate(e){
var posx=0,posy=0;
if(e==null) e=window.event;
if(e.pageX || e.pageY){
    posx=e.pageX; posy=e.pageY;
    }
else if(e.clientX || e.clientY){
    if(document.documentElement.scrollTop){
        posx=e.clientX+document.documentElement.scrollLeft;
        posy=e.clientY+document.documentElement.scrollTop;
        }
    else{
        posx=e.clientX+document.body.scrollLeft;
        posy=e.clientY+document.body.scrollTop;
        }
    }
document.getElementById("btc").style.top=(posy+10)+"px";
document.getElementById("btc").style.left=(posx-20)+"px";
}



<!-- CSS SWITCH -->

function change_css(title)
{
    var c, i, t;

    if(!(c = document.styleSheets)) {return;}

    i = c.length;
    while(i--) 
    {
       if((t = c[i].title)) 
       {
           c[i].disabled = (title != t);
       }
    }

   var cookie_date = new Date ( 2015, 01, 01 );
   var cookie_value ="css2="+title+
                     "; expires=" + cookie_date.toGMTString()+'; path=/;'; 
   document.cookie = cookie_value;

}

function set_default_css()
{
   css_cookie = readCookie( 'css2');
   if( css_cookie == 2 )
   {
      change_css(2);
   }
   else
   {
      change_css(1);
   }
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}


<!-- Email Spam shield -->
function showEmail(user, domain, tld, title){ 
   var emailId = user + "\u0040" + domain + "." + tld; 
   var url = "mailto:" + emailId; 

   if(!title){ 
       title = emailId; 
   } 
   document.write("<a href='" + url + "'>" + title + "</a>"); 
} 

function check_mess_fields(frm)
{

  document.getElementById('err1').innerHTML = "";
  document.getElementById('err2').innerHTML = "";
  noerr = true;

  if( frm.title.value.length < 2 ) 
  {
     document.getElementById('err1').innerHTML = "<font color = '#FF0000'>Error: subject must be at least 2 chars</font>";
     noerr = false;
  }

  if( frm.message.value.length < 2 ) 
  {
     document.getElementById('err2').innerHTML = "<font color = '#FF0000'>Error: message must be at least 2 chars</font>";
     noerr = false;
  }

 if(  noerr ) 
 {
    return SendMessageForm( frm );
 }

 return noerr;
}

