//this.focus();

function doShowCase() {
window.open('http://www.carpe-tdm.net/mytdm.asp?name='+ document.FormdoShowCase.nickname.value);
}

 
//setTimeout('self.location="index.php"',300000);

function InfoWindow(thefile,W,H) {
	T = (screen.height - H) /2;L = (screen.width - W) /2;
	window.open(thefile,'InfoWindow','resizable=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width='+ W +',height='+ H +',top='+ T +',left='+ L );
}

function openCP(errURL,errMsg,errLine) {
	W=300;H=300;
	report = 'URL='+ errURL +'&MSG='+ errMsg +'&LN='+ errLine;
	setup='toolbar=no,location=no,directories=no,status=no,menubar=no,width=' + W + ',height=' + (H+50) + ',left=10,top=10';
	setup += ',scrollbars=no,resizable=no';
	pop = window.open ("/tdm/cp_mini.asp?"+report,"CP",setup);
}

//Errorhandling begin
	var errors = new errorObjMaker()
	var count = 0
	
function MyError(msg,url,ln) {
	errors[count] = msg;
	errors[count += 1] = ln;
	count += 1;
//	openCP(url,msg,ln);
//	alert('Greetings CARPE TDM visitor..\r\n\nAn error occurred in file:\r\n\t' + url +'\r\n\nin line : ' + ln +'\r\n\nand the error message is :\r\n\t' + msg +'\r\n\nPlease report this error.\r\n\n\tThank you')
	return true;	//geen foutmelding geven
//	windows('CP').focus();
}
	
function errorObjMaker() {
}
window.onerror = MyError;
	
//end ErrorHandling

//AlienFramesBuster
if (top.location.host != location.host) {
	//insert procedure to write top.location with date to dbase
	top.location = this.location;
	}

MyUrl = location.href
MyFileNoExtension = MyUrl.substring(MyUrl.lastIndexOf('/')+1,MyUrl.lastIndexOf('.'))

var arrDay = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var arrMonth = new Array('JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC');
dNow = new Date();
strlastMod = (document.lastModified && MyUrl.indexOf('.asp')<0) ? document.lastModified : '01/01/01 02:02:02' ;
iYearLastMod = ( eval(strlastMod.substring(6,8)) >= 70 && dNow.getYear() < 2070 ) ? eval(strlastMod.substring(6,8)) + 1900 : eval(strlastMod.substring(6,8)) + 2000;
dLastModDate = new Date();
dLastModDate.setYear(iYearLastMod);
dLastModDate.setMonth(eval(strlastMod.substring(0,2)-1));
dLastModDate.setDate(eval(strlastMod.substring(3,5)));

strLocation = location;
strCopyright = '<A CLASS="innewwindow" HREF="http://www.carpe-tdm.net/copyright.html" TARGET="_blank" TITLE="about copyright">&copy; copyright</A>'
strLastmodified =  arrDay[dLastModDate.getDay()] + ' ' + arrMonth[dLastModDate.getMonth()] + ' '+ dLastModDate.getDate() + DateAppendix(dLastModDate.getDate()) +', ' + dLastModDate.getYear();
strCurrDate = arrDay[dNow.getDay()] + ' ' + arrMonth[dNow.getMonth()] + ' '+ dNow.getDate() + DateAppendix(dNow.getDate()) +', ' + dNow.getYear();


function WriteBack() {
if (window.document.referrer) {
	if (window.document.referrer.domain == location.domain) document.write ('<A HREF="'+ document.referrer +'" TARGET="_top">&lt;&lt; back</A></FONT>')
	}
else document.write ('<A HREF="http://www.carpe-tdm.net" TARGET="_top">to the homepage</A></FONT>');
}

function InfoWindow(thefile,W,H) {
	T = (screen.height - H) /2;L = (screen.width - W) /2;
	window.open(thefile,'InfoWindow','resizable=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width='+ W +',height='+ H +',top='+ T +',left='+ L );
}

function Inflate(pic,W,H,info) {
	if (document.forms["ShowView"]) strOnBlur = (document.forms["ShowView"].onblur_close.checked == true) ? ' onblur="this.close();"' : ''
	else strOnBlur = ''	//onblur="this.close();"';
	MyDate = new Date();
	MyTime = MyDate.getTime();
	setup='toolbar=no,location=no,directories=no,status=no,menubar=no,width=' + W + ',height=' + (H+50) + ',left=100,top=100';
	setup += ',scrollbars=no,resizable=no';
	pop = window.open ("","Showview"+MyTime,setup);
	strInflate = '<HTML><head><Title>' + info +' ( @ Carpe TDM )</Title></head>'+
		'<BODY BGCOLOR="#ffffff" topmargin="0" leftmargin="0" rightmargin="0"'+ strOnBlur +' onload="this.focus();"><BASEFONT SIZE=2 face="verdana">'+
		'<A HREF="/tdm/index.html" TARGET="_blank"><IMG SRC="' + pic + '" HEIGHT='+ H + ' WIDTH=' + W +' VSPACE="0" BORDER="0" ALT="click away to close, click on image to go to the HomePage"></A>'+
		'<DIV ALIGN="center">' + info +'</DIV></body></HTML>';
	pop.document.write(strInflate);
	pop.document.close();//for the onBlur to work.
}

function DateAppendix(d) {
	d= d.toString();
	if (eval(d) <10 || eval(d) >=20) {
		switch(d.charAt(d.length-1)) {
			case '0':
				return 'st';
				break;
			case '1':
				return 'st';
				break;
			case '2':
				return 'nd';
				break;
			case '3':
				return 'rd';
				break;
			default :
				return '';
				break;
			}
		}
	else return 'th';
}

function writeFooter(){
MyString = '<BR CLEAR="all"><DIV ALIGN="center"><FONT SIZE=1>'+
	'<B><A HREF="http://www.carpe-tdm.net/" TARGET="_top" TITLE="homepage">www.carpe-tdm.net</A></B>'+
	document.location.pathname +	//	'<BR>modified ' + strLastmodified +
	'<BR>'+
	strCopyright +
	'</FONT></DIV><BR CLEAR="all">'
document.write(MyString);
}


var mydomain="carpe-tdm.net"

//(1=yes, 0 will render a checkbox for manual selection)
var auto=1

if (!auto)
document.write('<form name="targetmain"><input type="checkbox" name="targetnew" checked onClick="dynamiclink()">Open off-site links in new window</form>')

function dynamiclink(){
	if (auto||(!auto&&document.targetmain.targetnew.checked)){
	for (i=0; i<=(document.links.length-1); i++) {
		if (document.links[i].hostname.indexOf(mydomain)==-1&&document.links[i].href.indexOf("http:")!=-1)
		document.links[i].target="_blank"
		}
	}
	else
	for (i=0; i<=(document.links.length-1); i++) {
		if (document.links[i].hostname.indexOf(mydomain)==-1)
		document.links[i].target=""
		}
}

//above added later

PreviousPage = "/mainmenu.asp";
PreviousPageStringStatus = "No previous page registered. Go to mainmenu?";
PreviousPageString = "no previous page"

if (window.document.referrer) {
	PreviousPage = window.document.referrer;
	if (window.document.referrer.domain == location.domain) {
		PreviousPageStringStatus = "previous page : " + window.document.referrer;
		PreviousPageString = "previous page";
		}
	else	{
		PreviousPageStringStatus = "leaving Carpe TDM for " + window.document.referrer;
		PreviousPageString = "to previous site";
		}
	}



// Milonic DHTML Menu version 3.3.11

// The following line is critical for menu operation, and must appear only once.
menunum=0;menus=new Array();_d=document;function addmenu(){menunum++;menus[menunum]=menu;}function dumpmenus(){mt="<script language=javascript>";for(a=1;a<menus.length;a++){mt+=" menu"+a+"=menus["+a+"];"}mt+="<\/script>";_d.write(mt)}
//Edit below
effect = "Alpha(style=0,opacity=85);Shadow(color='#999999', Direction=135, Strength=5)"//"Fade(duration=0.3);Alpha(style=0,opacity=85);Shadow(color='#999999', Direction=135, Strength=5)" // Special effect string for IE5.5 or above please visit http://www.milonic.co.uk/menu/filters_sample.php for more filters

timegap=500				// The time delay for menus to remain visible
followspeed=5			// Follow Scrolling speed
followrate=40			// Follow Scrolling Rate
suboffset_top=10;		// Sub menu offset Top position 
suboffset_left=10;		// Sub menu offset Left position

style1=[				// style1 is an array of properties. You can have as many property arrays as you need. This means that menus can have their own style.
"585858",					// Mouse Off Font Color
"E6E5E5",				// Mouse Off Background Color
"000080",				// Mouse On Font Color
"#DDFF00",				// Mouse On Background Color
"000000",				// Menu Border Color 
10,						// Font Size in pixels
"normal",				// Font Style (italic or normal)
"bold",					// Font Weight (bold or normal)
"Verdana, Arial",		// Font Name
3,						// Menu Item Padding
"/tdm/scripts/arrow.gif",			// Sub Menu Image (Leave this blank if not needed)
,						// 3D Border & Separator bar
"66ffff",				// 3D High Color
"000099",				// 3D Low Color
"FFFFFF",				// Current Page Item Font Color (leave this blank to disable)
"808080",					// Current Page Item Background Color (leave this blank to disable)
"/tdm/scripts/arrowdn.gif",			// Top Bar image (Leave this blank to disable)
"ffffff",				// Menu Header Font Color (Leave blank if headers are not needed)
"000099",				// Menu Header Background Color (Leave blank if headers are not needed)
]



addmenu(menu=[		// This is the array that contains your menu properties and details
"mainmenu",			// Menu Name - This is needed in order for the menu to be called
3,					// Menu Top - The Top position of the menu in pixels
220,				// Menu Left - The Left position of the menu in pixels
,					// Menu Width - Menus width in pixels
1,					// Menu Border Width 
,					// Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
style1,				// Properties Array - this is set higher up, as above
1,					// Always Visible - allows the menu item to be visible at all time (1=on/0=off)
"left",				// Alignment - sets the menu elements text alignment, values valid here are: left, right or center
effect,				// Filter - Text variable for setting transitional effects on menu activation - see above for more info
1,					// Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times) (1=on/0=off)
1, 					// Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style (1=on/0=off)
,					// Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on/0=off)
,					// Position of TOP sub image left:center:right
,					// ..Now Obsolete..
,					// Right To Left - Used in Hebrew for example. (1=on/0=off)
,					// Open the Menus OnClick - leave blank for OnMouseover (1=on/0=off)
,					// ID of the div you want to hide on MouseOver (useful for hiding form elements)
,					// Reserved for future use
,					// Reserved for future use
,					// Reserved for future use
,"Carpe&nbsp;&nbsp","show-menu=home","http://www.carpe-tdm.net/tdm/mainmenu.asp","Back to the Main Menu",1 // "Description Text", "URL", "Alternate URL", "Status", "Separator Bar"
,"Sections&nbsp;&nbsp;","show-menu=main","http://www.carpe-tdm.net/tdm/mainmenu.asp","Main menu",1
,"ClubHouse&nbsp;&nbsp;","show-menu=clubhouse","/clubhouse","",1
,"Shop&nbsp;&nbsp;","show-menu=shop","/shop","stickers, tshirts, etc",1
,"Downloads&nbsp;&nbsp;","show-menu=downloads","http://www.carpe-tdm.net/tdm/library/doc45_downloads.asp","manuals, gearing charts, bizcards, desktops, etc",1
,"Guide&nbsp;&nbsp;","show-menu=guide","","where you wanna go?",1
])


	addmenu(menu=["main",
	,,100,1,"",style1,,"left",effect,,,,,,,,,,,,
	,"Forum","http://www.carpe-tdm.net/forum","","open, site based, news forum called TalkAbout",1
	,"Gallery","show-menu=gallery","http://www.carpe-tdm.net/tdm/gallery.asp","pictures, movie clips",1
	,"Garage","http://www.carpe-tdm.net/tdm/garage.asp",,"technical data, How To, Does&Donts",1
	,"Library","http://www.carpe-tdm.net/tdm/library.asp",,"articles, news clippings, comparison tests",1
	,"Links","http://www.carpe-tdm.net/tdm/links.asp",,"like it says: links",1
	,"Market","http://www.carpe-tdm.net/tdm/market.asp",,"wanted or for sale",1
	])
	
		addmenu(menu=["gallery",
		,,170,1,"",style1,,"left",effect,,,,,,,,,,,,
		,"all models","http://www.carpe-tdm.net/tdm/gallery.asp",,"pictures of all available models",0
		,"artistic","http://www.carpe-tdm.net/tdm/gallery.asp?chapter=art",,"desktops, artisitic pictures, sceneries",0
		,"customized","http://www.carpe-tdm.net/tdm/gallery.asp?chapter=custom",,"some particular TDMs",1
		,"ShowCases","http://www.carpe-tdm.net/tdm/members/","","pictures, sound files",1
		])
		

	addmenu(menu=["clubhouse",
	,,100,1,"",style1,,"left",effect,,,,,,,,,,,,
	,"The Forum","http://www.carpe-tdm.net/forum","","open, site based, news forum called TalkAbout",1
	,"The Lounge","http://www.carpe-tdm.net/tdm/lounge.asp TARGET=_blank","","open, site based, news forum called TalkAbout",1
	,"Members list","http://www.carpe-tdm.net/clubhouse",,,1	//,"<img src=newsimage.gif border=0>&nbsp;Dynamic Drive","http://www.dynamicdrive.com",,,1
	,"ShowCases","http://www.carpe-tdm.net/tdm/members/","","pictures, sound files",1
	,"RTT/G2G","show-menu=rttg2g",,"get to gethers",1
	])
	
		addmenu(menu=["rttg2g",
		,,170,1,"",style1,,"left",effect,,,,,,,,,,,,
		,"<img src=/tdm/scripts/newsimage.gif border=0 ALIGN=absmiddle>&nbsp;&nbsp;RTT2004 Ireland","http://www.carpe-tdm.net/tdm/rtt/rtt_2004.asp",,"picture diary",1
		,"<img src=/tdm/scripts/newsimage.gif border=0 ALIGN=absmiddle>&nbsp;&nbsp;RTT2003 Luxemburg","http://www.carpe-tdm.net/tdm/rtt/rtt_2003.asp",,"picture diary",1
		,"Ecosse Distilleries 05/03","http://www.carpe-tdm.net/tdm/rtt/g2g_200305_distillery.asp",,"picture diary",1
		,"Red Lion 09/02","http://www.carpe-tdm.net/tdm/rtt/g2g_20020907_RedLion.asp",,"picture diary",1
		,"5 Countries 08/02","http://www.carpe-tdm.net/tdm/rtt/g2g_20020814_5C.asp",,"picture diary",1
		,"<img src=/tdm/scripts/newsimage.gif border=0 ALIGN=absmiddle>&nbsp;&nbsp;RTT2002 Warmwell","http://www.carpe-tdm.net/tdm/rtt/rtt_2002_uk.asp",,"picture diary",1
		,"Northern Gathering 05/02","http://www.carpe-tdm.net/tdm/rtt/g2g_20020526.asp",,"picture diary",1
		])
	
	addmenu(menu=["shop",
	,,120,1,"",style1,,"left",effect,,,,,,,,,,,,
	,"tshirt 4xTDM","http://www.carpe-tdm.net/tdm/shop/shop004_tshirt_4tdm.asp",,"tshirt with the 4 TDM logos from 91 till 2002 inc",1
	,"WWW sticker","http://www.carpe-tdm.net/tdm/shop/shop002_wwwcarpetdmnet.asp",,"white cutout vinyl :www.carpe-tdm.net",1
	,"UK custom plates","http://www.carpe-tdm.net/tdm/shop/shop001_plates.asp",,"United Kingdom custom plates, with or without extra logos",1
		])

	addmenu(menu=["home",
	,,100,1,"",style1,,"left",effect,,,,,,,,,,,,
	,"Main menu","http://www.carpe-tdm.net/tdm/mainmenu.asp",,"main menu",1
	,"Contact","http://www.carpe-tdm.net/tdm/reception.asp",,"go to reception and fill in the form",1
	,"Report an error","javascript:openCP()",,"This page giving an error? Click!",1
	,"HomePage","http://www.carpe-tdm.net",,"go back to Start",1
		])

	addmenu(menu=["downloads",
	,,100,1,"",style1,,"left",effect,,,,,,,,,,,,
	,"Misc Files","http://www.carpe-tdm.net/tdm/library/doc45_downloads.asp",,"manuals, gearing calculation sheet, ...",1
	,"Desktops","http://www.carpe-tdm.net/tdm/gallery.asp?chapter=art",,"fill your desktop with TDMs",1
		])

	addmenu(menu=["guide",
	,,100,1,"",style1,,"left",,,,,,,,,,,,,
	,"top of page","#top",,"to the top of this page",1
	,PreviousPageString ,PreviousPage,,PreviousPageStringStatus,1
	,"Main menu","http://www.carpe-tdm.net/tdm/mainmenu.asp",,"main menu",1
	,"HomePage","http://www.carpe-tdm.net",,"right at the beginning",1
		])

//"randomdissolve(duration=0.5);Shadow(color='#999999', Direction=135, Strength=5)"

dumpmenus()