/* antispam mailing script */
function writeMail (login, serv, subj, addons)
{
if (!subj) subj='From site www.winsitemap.com';
var string='<nobr><a href="mailto:'+login+'@'+serv+'?subject='+subj+'" '+addons+'>'+login+'@'+serv+'</a></nobr>';
document.write (string);
}

/* input placeholder script */
function InputPlaceholder (input, value, cssFilled, cssEmpty)
{
var thisCopy = this

this.Input = input
this.Value = value
this.SaveOriginal = (input.value == value)
this.CssFilled = cssFilled
this.CssEmpty = cssEmpty

this.setupEvent (this.Input, 'focus', function() {return thisCopy.onFocus()})
this.setupEvent (this.Input, 'blur',  function() {return thisCopy.onBlur()})
this.setupEvent (this.Input, 'keydown', function() {return thisCopy.onKeyDown()})

if (input.value == '') this.onBlur();

return this
}

InputPlaceholder.prototype.setupEvent = function (elem, eventType, handler)
{
if (elem.attachEvent)
{
elem.attachEvent ('on' + eventType, handler)
}

if (elem.addEventListener)
{
elem.addEventListener (eventType, handler, false)
}
}

InputPlaceholder.prototype.onFocus = function()
{
if (!this.SaveOriginal &&  this.Input.value == this.Value)
{
this.Input.value = ''
}
else
{
this.Input.className = ''
}
}

InputPlaceholder.prototype.onKeyDown = function()
{
this.Input.className = ''
}

InputPlaceholder.prototype.onBlur = function()
{
if (this.Input.value == '' || this.Input.value == this.Value)
{
this.Input.value = this.Value
this.Input.className = this.CssEmpty
}
else
{
this.Input.className = this.CssFilled
}
}

/* contractible menu script */

function rollover(img,ref){ document.images[img].src = ref; }

function findObj(n) { 
var x; 
var ns6 = document.getElementById ? 1 : 0 
var ie = document.all ? 1 : 0 
var ns = document.layers ? 1 : 0 
if(ns6){x = document.getElementById(n) } 
if(ie){x = document.all[n] } 
if(ns){x = document[n] } 
return x; 
} 

var oldLayer = "";
var oldPic = "";

function showLayer1(layerName, picName, arrDn, arrUp)
 {
var obj;
if (oldLayer)
     {obj=findObj(oldLayer); if (obj.style) {obj=obj.style; }
    obj.display='none';
    rollover(oldPic, arrDn);
  }
         obj=findObj(layerName); if (obj.style) {obj=obj.style;}
    if (oldLayer!=layerName){obj.display='block'; oldLayer=layerName; oldPic = picName; rollover(picName, arrUp);}
        else {obj.display='none';  oldLayer=""; oldPic = ""; rollover(picName, arrDn);}
    }




