// Main-body code
function outbound() {
	var myLinks = new Array;
	myLinks = document.links;
	var myRE = /^http:\/\/www.veiled-chameleon.com/;
	var myAF = /^http:\/\/www.veiled-chameleon.com\/cgi-bin\/newfront\/link.cgi/;
	var myMP3 = /.mp3$/;
	var myWMA = /.wma$/;
	var myMOV = /.mov$/;

	for (var iL=0;iL<myLinks.length;iL++) {
		if (myLinks[iL].href.search(myRE) || (myLinks[iL].href.search(myAF) == 0)) { // Returns the position of myRE on the search string
			document.links[iL].target = '_blank';
		}
//		if (myLinks[iL].href.search(myMP3) > -1) { // Returns the position of myRE on the search string
		if ((myLinks[iL].href.search(myMP3) > -1) || (myLinks[iL].href.search(myWMA) > -1) || (myLinks[iL].href.search(myMOV) > -1)) { // Returns the position of myRE on the search string
			document.links[iL].target = '_blank';
		}
	}
}

// Webcam code
var myWebcam;
var i;
var myEndcam;
function webcamTimer() {
	var myImages = new Array();
	myImages = document.images;
	for (i=0;i<myImages.length;i++) {
		if (document.images[i].src == 'http://www.camchatting.com/~cam000/Ouroboros.jpg') {
			myWebcam = setInterval("document.images[i].src='http://www.camchatting.com/~cam000/Ouroboros.jpg?n=' + Math.round(Math.random() * 1000000)", 59000);
			myEndcam = setTimeout("clearInterval(myWebcam)", 600000);
			break;
		}
	}
}
//-->

////////////////////////////////////////////
//  Day by Day Cartoon Code - Begin       //
////////////////////////////////////////////
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 parseUrl()
{
	var Url = "http://www.daybydaycartoon.com/";
	var today = new Date;
	var day = (today.getDate()).toString(); //CHANGE THIS WHEN DBD GOES SCREWY
	var month = today.getMonth();
	month = month + 1;
	var mo = month.toString();
	var yr = today.getYear().toString();
	if(day.length < 2)
	{
		day = "0" + day;
	}
	if(mo.length < 2)
	{
		mo = "0" + (mo);
	}
	if (yr.length == 3)
	{
		yr = yr.substr(1,2);
	}
	if(yr.length > 2)
	{
		var b = yr.length - 2;
		yr = yr.substr(b,2);
	}
	
	Url = Url + mo + day + yr + ".jpg";
	
	return Url;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
////////////////////////////////////////////
//  Day by Day Cartoon Code - Begin       //
////////////////////////////////////////////


////////////////////////////////////////////
// Below this line, only Movable Type code//
////////////////////////////////////////////
function OpenComments (c) {
    window.open(c,
                    'comments',
                    'width=480,height=480,scrollbars=yes,status=yes');
}

function OpenTrackback (c) {
    window.open(c,
                    'trackback',
                    'width=480,height=480,scrollbars=yes,status=yes');
}


