//antiSpamMail.js
function antiSpamMail (name,sld,tld)
{
	var at   = "@";
	window.location.href = "mailto:" + name + at + sld + "." + tld;
}

//<a href="javascript:antiSpamMail('support','iggsoftware','com')">support</a>
//<a href="javascript:antiSpamMail('designs','allbutt','net')">webmaster</a>


// popup 

//  title="Opens new window" target="_blank" onClick="return showAmigos(this);"
 var amigoswindow;
function showAmigos(url)
{
	amigoswindow=window.open(url,'name','height=500,width=500,resizable,scrollbars,status,left=30,top=30');
	if (window.focus) {amigoswindow.focus();return false;}
}

//  title="Opens new window" target="_blank" onClick="return showDesign(this);"
 var designwindow;
function showDesign(url)
{
	designwindow=window.open(url,'name','height=500,width=500,resizable,scrollbars,status,left=50,top=50');
	if (window.focus) {designwindow.focus();return false;}
}

//  title="Opens new window" target="_blank" onClick="return showCC(this);"
 var callingcard;
function showCC(url)
{
	callingcard=window.open(url,'name','height=500,width=640,resizable,scrollbars,status,left=50,top=50');
	if (window.focus) {callingcard.focus();return false;}
}

//  title="Opens new window" target="_blank" onClick="return showAlbumwed(this);"
 var albumwed;
function showAlbumwed(url)
{
	albumwed=window.open(url,'name','height=400,width=620,resizable,scrollbars,status,left=50,top=50');
	if (window.focus) {albumwed.focus();return false;}
}

// opens a new browser pop up window of a set size
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/*
Generic pop
*/
  function poppic(pic)
    {
    var w = window.open(this, 'popit', 'width=500,height=500');
    var d = w.document;
		var s = ('http://allbutt.net'); // '+s+'
//	var s = (''); // '+s+'
    d.write('<html><head><title>Allbutt.net</title>');
    d.write('<link href="'+s+'/assets/all.css" rel="stylesheet" type="text/css" media="all">');
		d.write('<link href="'+s+'/assets/screen.css" rel="stylesheet" type="text/css" media="screen">');
		d.write('</head><body class="gallery" id="pop">');
    d.write('<img src="' + pic.href + '" alt="&copy; copyright Allbutt.NET">');
		d.write('<div class="button"><a href="javascript:self.close()" class="buttonClose" title="Close this window">Close this window</a></div>');
    d.write('</body></html>');
    d.close();
    w.focus();
    return false;
    }

// title="Opens new window" target="_blank" onClick="return poppicGall(this);"
  function poppicGall(pic)
    {
    var w = window.open(this, 'popit', 'width=600,height=400');
    var d = w.document;
		var s = ('http://allbutt.net'); // '+s+'
//	var s = (''); // '+s+'
    d.write('<html><head><title>Wedding Photo Album</title>');
    d.write('<link href="'+s+'/assets/all.css" rel="stylesheet" type="text/css" media="all" />');
		d.write('<link href="'+s+'/assets/screen.css" rel="stylesheet" type="text/css" media="screen" />');
		d.write('</head><body class="gallery" id="pop">');
    d.write('<img src="' + pic.href + '" alt="&copy; copyright Allbutt.NET">');
		d.write('<div class="button"><a href="javascript:self.close()" class="buttonClose" title="Close this window">Close this window</a></div>');
    d.write('</body></html>');
    d.close();
    w.focus();
    return false;
    }

// title="Opens new window" target="_blank" onClick="return poppicWed(this);"
function poppicWed(pic)
    {
    var w = window.open(this, 'popit', 'width=500,height=500');
    var d = w.document;
		var s = ('http://allbutt.net'); // '+s+'
//		var s = (''); // '+s+'
    d.write('<html><head><title>Wedding Photo Album</title>');
    d.write('<link href="'+s+'/assets/all.css" rel="stylesheet" type="text/css" media="all" />');
		d.write('<link href="'+s+'/assets/screen.css" rel="stylesheet" type="text/css" media="screen" />');
		d.write('</head><body class="gallery" id="pop">');
    d.write('<img src="' + pic.href + '" alt="&copy; copyright Allbutt.NET">');
		d.write('<div class="button"><a href="javascript:self.close()" class="buttonClose" title="Close this window">Close this window</a></div>');
    d.write('</body></html>');
    d.close();
    w.focus();
    return false;
    }


//	title="Opens new window" target="_blank" onClick="return poppicFamily(this);"
  function poppicFamily(pic)
    {
    var w = window.open(this, 'popit', 'width=500,height=500,resizable,scrollbars,status,left=50,top=50');
    var d = w.document;
		var s = ('http://allbutt.net'); // '+s+'
//		var s = (''); // '+s+'
    d.write('<html><head><title>Photo Album picture</title>');
    d.write('<link href="'+s+'/assets/all.css" rel="stylesheet" type="text/css" media="all">');
		d.write('<link href="'+s+'/assets/screen.css" rel="stylesheet" type="text/css" media="screen">');
		d.write('</head><body class="family" id="pop">');
    d.write('<img src="' + pic.href + '" alt="&copy; copyright Allbutt.NET">');
		d.write('<div class="button"><a href="javascript:self.close()" class="buttonClose" title="Close this window">Close this window</a></div>');
    d.write('</body></html>');
    d.close();
    w.focus();
    return false;
    }
				
// to set the browsers status message
function MM_displayStatusMsg(msgStr) {
  status=msgStr;
  document.MM_returnValue = true;
}

// used to display the current date
/*
<script type="text/javascript">
document.write(doClock("Today is ","W0", ", ", "M0", " ", "D0", ", ", "Y0"));
</script>
*/
function doClock() {
    // By Paul Davis - www.kaosweaver.com;
    var t = new Date(), a = doClock.arguments, str = "", i, a1, lang = "1";
    var month = new Array('January','Jan', 'February','Feb', 'March','Mar', 'April','Apr', 'May','May', 'June','Jun', 'July','Jul', 'August','Aug', 'September','Sep', 'October','Oct', 'November','Nov', 'December','Dec');
    var tday = new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
    for (i = 0; i < a.length; i++) {
        a1 = a[i].charAt(1);
        switch (a[i].charAt(0)) {
          case "M":
            if ((Number(a1) == 3) && ((t.getMonth() + 1) < 10)) {
                str += "0";
            }
            str += (a1 == "2") ? t.getMonth() + 1 : month[t.getMonth() * 2 + Number(a1)];
            break;
          case "D":
            if ((Number(a1) == 1) && (t.getDate() < 10)) {
                str += "0";
            }
            str += t.getDate();
            break;
          case "Y":
            str += (a1 == "0") ? t.getFullYear() : t.getFullYear().toString().substring(2);
            break;
          case "W":
            str += tday[t.getDay() * 2 + Number(a1)];
            break;
          default:
            str += unescape(a[i]);
        }
    }
    return str;
}

