// Script by DeLucaMarketing
// V1.2 - 09 Feb 2003

// tedgueller.com Specials
var admin="info@tedgueller.com";
window.defaultStatus = "TedGueller.com - Recycling Art";
var resizetext = 'Klicken Sie hier zum Vergrössern...'

var debug = true; 
function stopError()	{return true;}
//if (!debug) window.onerror=stopError;

var scriptID = "script.js";
var popupWin = false;

function winstatus(text)
{
	window.status = text;
}

//window.onbeforeprint=removeelements
//window.onafterprint=revertback

browser = browserID();
function browserID()
{
	var browser=0;
	if(-1 != navigator.userAgent.indexOf("Opera"))
		browser = 3;
	else if(-1 != navigator.userAgent.indexOf("MSIE"))
		browser = 1;
	else if( -1 != navigator.userAgent.indexOf("Gecko") && -1 != navigator.userAgent.indexOf("Netscape")) // Netscape 6+
		browser = 4;
	else if( -1 != navigator.userAgent.indexOf("Gecko") && -1 == navigator.userAgent.indexOf("Netscape")) // Mozilla
		browser = 5;
	else if(-1 != navigator.userAgent.indexOf("Mozilla"))
		browser = 2;
	return browser;
}

function openWindow(url, name, w, h, flags)
{
	//	flags = 'directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes';
	var winX = (screen.availWidth - w)*.5;
	var winY = (screen.availHeight - h)*.5;
	if (popupWin && !popupWin.closed) popupWin.close();
	popupWin = window.open(url, name, 'width=' + w + ',height=' + h + ', left=' + winX + ',top=' + winY + ',screenX=' + winX + ',screenY=' + winY + ',' + flags);
	popupWin.focus();
}

function openPopup(url, name, w, h, flags, title, file)
{
	//	flags = 'directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes';
	var winX = (screen.availWidth - w)*.5;
	var winY = (screen.availHeight - h)*.5;

	var c = '<html><head><title>DeLucaMarketing</title></head>'
	c += '<frameset rows="50,*,39" frameborder="0" framespacing="0" border="0">'
	c += '<frame name="popup_title" src="popup_title.htm?' + title + '" marginwidth="10" marginheight="0" scrolling="no" noresize>'
	c += '<frame name="popup_content" src="' + file + '" marginwidth="0" marginheight="0" scrolling="yes">'
	c += '<frame name="popup_footer" src="popup_footer.htm" marginwidth="0" marginheight="0" scrolling="no" noresize>'
	c += '</frameset>';
	c += '</html>';
	popupWin = window.open(url, name, 'width=' + w + ',height=' + h + ', left=' + winX + ',top=' + winY + ',screenX=' + winX + ',screenY=' + winY + ',' + flags);
	popupWin.document.write(c);
	popupWin.document.close();
}

function fullsizeWindow()
{
	self.resizeTo(screen.availWidth, screen.availHeight);
}

function removeelements()
{
	document.bgColor="white";
	document.body.background='';
	document.bgColor = "white";
	document.fgColor = "black";
	document.linkColor = "black";
	document.vlinkColor = "black";
	document.alinkColor = "black";
	
   var remove_el = document.all.noprint;
   if (remove_el != '' && remove_el.length == null)
      remove_el.style.display = 'none'
   else
   {
      for (i=0; i<remove_el.length; i++)
         remove_el[i].style.display='none'
   }
}

function revertback()
{
	//alert("Printing done");
   setTimeout("window.location.reload()",50)
}

function date_ddmmmyyyy(date)
{
	var d = date.getDate();
	var m = date.getMonth() + 1;
	var y = date.getYear();
	if (y < 100)	y += 2000;
	if (y < 1000)	y += 1900;
	
	return d + ". " + m + ". " + y;
}

function date_lastmodified()
{
	var lmd = document.lastModified;
	var s   = "";
	var d1;
	if(0 != (d1=Date.parse(lmd)))
		s = "Aktualisiert: " + date_ddmmmyyyy(new Date(d1));
	return s;
}

// -------------------------------------
// Displays "Neu" as long as not expired
// -------------------------------------
function newitem(expire)
{
	tempdate = new Date();
	var year =  tempdate.getYear();
	var month = (tempdate.getMonth()+1);
	var day = tempdate.getDate();

	if (year < 100)	year += 2000;
	if (year < 1000)	year += 1900;

	year*=10000;
	month*=100;

	today =  year + month + day;
	window.status = today
	if (today <= expire)
		document.write('<font color="#FF0000">[Neu]</font>')
}

function NCSSFix()
{
	if (document.NeedsFix.NCSSFix.initWindowWidth != window.innerWidth || document.NeedsFix.NCSSFix.initWindowHeight != window.innerHeight)
    document.location = document.location;
}

function NCSSFixItNow()
{
	if (browser == 2)
	{
		if (typeof document.NeedsFix == 'undefined')
			document.NeedsFix = new Object;
		if (typeof document.NeedsFix.scaleFont == 'undefined')
		{
			document.NeedsFix.NCSSFix = new Object;
			document.NeedsFix.NCSSFix.initWindowWidth = window.innerWidth;
			document.NeedsFix.NCSSFix.initWindowHeight = window.innerHeight;
			// alert("This browser needs a fix!");
		}
		window.onresize = NCSSFix;
	}
}
NCSSFixItNow();

function on(obj)
{
	document.images[obj].src='pics/arrowright-over.gif';
}

function off(obj)
{
	document.images[obj].src='pics/arrowright.gif';
}

function preload()
{
	if (document.images)
	{
		var ar_over = new Image(7,7);
		ar_over.src  = 'http://www.delucamarketing.ch/pics/arrowleft-over.gif';
	}
}


// ----------------------------------------------
// Kommentar zur aktuellen Seite
// ----------------------------------------------
function mailIt(url)
{
	if (url == '')
	{
	   url = location.href;
		var i = url.lastIndexOf("/");
		url = url.substr(++i,99);
	}
   topic="Feedback";
   parent.location.href='mailto:'+admin+'?subject='+topic+' <'+url+'>';
}

function filename(url)
{
	var i = url.lastIndexOf("/");
	return url.substr(++i,99);
}

