
function init(){
    // pngfix();
	// addMattesAndShadows();
    addReflections();    
}


function writetitle(){
    if (self.mynav) {
		document.writeln(" &raquo; "); // &#8250;&#8250;
		document.writeln(self.mynav)
	}
    if (self.mytitle) {
		document.writeln(" :: ")
		document.writeln(self.mytitle)
	}
	else {
		document.writeln(" :: ")
	}
}

function writeHeaderTitle(){
    if (self.mypagetitle) {document.writeln(mypagetitle)}
}

var currfontsize = 1;

function changeFontSize(size){
    if (!currfontsize) {currfontsize = 1}
    if (size == "bigger" && currfontsize < 3) {currfontsize++}
    if (size == "smaller" && currfontsize > 1) {currfontsize--;}
    setActiveStyleSheet("fontsize" + currfontsize);
}

function setActiveStyleSheet(title){

    var i, a, main;

    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
            a.disabled = true;
            if (a.getAttribute("title") == title) 
                a.disabled = false;            
        }
    }
}



function getActiveStyleSheet(){

    var i, a;
    
    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) 
            return a.getAttribute("title");        
    }
    return null;
}



function getPreferredStyleSheet(){

    var i, a;
    
    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1 &&
		a.getAttribute("rel").indexOf("alt") == -1 &&
		a.getAttribute("title")) {
			return a.getAttribute("title");
		}
    }
    return null;   
}


/*
function prefetchLinks() {
//prefetch any links with class "prefetch":

//	var ref = document.referrer.toLowerCase();
//	if (!ref.match('[^/]+//[^/]*patrogan.com/')) {

		$('a.prefetch').each(function(count, it){
			alert("prefetching " + $(it).attr("href") + "...");
			$.ajax({
				url: $(it).attr("href"),
				dataType: "text",
				ifModified: true
				,
				success: function(data, successCode) {
					alert ($(it).attr("href") + " says: " + data);
				}
			});
			
		});
//	}
}
*/

