<!-- Hide from JavaScript-Impaired Browsers;

var NS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5);
var FF3 = (document.getElementById);
var IE4 = (document.all);
var NN4 = (document.layers);

/* Image Flips */
homeoff = new Image (85, 19);
homeoff.src = "/img/htop-navbut-home0.gif";
homeon = new Image (85, 19);
homeon.src = "/img/htop-navbut-home1.gif";
girloff = new Image (85, 19);
girloff.src = "/img/htop-navbut-girl0.gif";
girlon = new Image (85, 19);
girlon.src = "/img/htop-navbut-girl1.gif";
gearoff = new Image (85, 19);
gearoff.src = "/img/htop-navbut-gear0.gif";
gearon = new Image (85, 19);
gearon.src = "/img/htop-navbut-gear1.gif";
eventoff = new Image (85, 19);
eventoff.src = "/img/htop-navbut-event0.gif";
eventon = new Image (85, 19);
eventon.src = "/img/htop-navbut-event1.gif";
vidoff = new Image (85, 19);
vidoff.src = "/img/htop-navbut-vid0.gif";
vidon = new Image (85, 19);
vidon.src = "/img/htop-navbut-vid1.gif";
blogoff = new Image (85, 19);
blogoff.src = "/img/htop-navbut-blog0.gif";
blogon = new Image (85, 19);
blogon.src = "/img/htop-navbut-blog1.gif";
freeoff = new Image (85, 19);
freeoff.src = "/img/htop-navbut-free0.gif";
freeon = new Image (85, 19);
freeon.src = "/img/htop-navbut-free1.gif";
tekoff = new Image (85, 19);
tekoff.src = "/img/htop-navbut-tek0.gif";
tekon = new Image (85, 19);
tekon.src = "/img/htop-navbut-tek1.gif";
photooff = new Image (85, 19);
photooff.src = "/img/htop-navbut-photo0.gif";
photoon = new Image (85, 19);
photoon.src = "/img/htop-navbut-photo1.gif";

/* Menus */
var timeID = 0;
var menus = new Array();
menus[0] = "girlsdiv";

document.onclick = hideAllMenus;

function imgflipSelect(imgname, selectobj) {
	var objname  = selectobj.name;
	var objindex = selectobj.selectedIndex; 
	objindex += 1; // indices start at 0, variables start at 1
	
	var elem = document.getElementById(imgname);
	elem.src = eval(objname+objindex);
}

function imgflipFile(imgname, newsrc) {
	newsrc = "img/" + newsrc;
	document[imgname].src = newsrc;
}

function imgflip(imgname, newsrc) {
	document[imgname].src = newsrc.src;
}

function GotoPage(element) {
	var page = element.options[element.selectedIndex].value;
	if (page=="-") {
		element.selectedIndex = 0;
		element.setfocus;
		return false;
    } else if (page.indexOf("www") > 0) {
        window.location = page;
        window.location.target = "blank";
        return false;
	} else if (page.indexOf("/") > 0) {
		page += "index.php";
		window.location = page;
		return false;
	} else {
		page += ".php";
		window.location = page;
		return false;
	}
}

function popupWindow(newFile, wWnd, hWnd, lWnd, tWnd, text) {
	// increase height and width by status bar height
	hWnd += 32;
	wWnd += 32;
	formatStr = "left="+ lWnd +", top="+ tWnd +", height="+ hWnd +", width="+ wWnd +", location=no, status=no, toolbar=no, menubar=no, resizable=no, scrollbars=no, toolbar=no";
	var ext = newFile.substring(newFile.length-4, newFile.length);
	ext = ext.toLowerCase();
	if (ext == ".jpg" || ext == ".gif" || ext == ".png") {
    	newWindow = window.open ("", "displayWindow", formatStr);
    	newWindow.document.writeln ('<HTML><HEAD><TITLE>Popup Image</TITLE></HEAD><BODY onLoad="self.focus()" onClick="window.close()"><IMG SRC="' + newFile + '"><br><span style="font-size: 9pt;">Click to close</span></BODY></HTML>');	
	} else if (ext == ".mp4" || ext == ".avi" || ext == ".mov" || ext == ".mpeg" || ext == ".wmv") {
    	newWindow = window.open ("", "displayWindow", formatStr);
    	newWindow.document.writeln ('<HTML><HEAD><TITLE>Popup Video</TITLE></HEAD><BODY onLoad="self.focus()" onClick="window.close()"><EMBED SRC="' + newFile + '" AUTOSTART="true" AUTOPLAY="true" CONTROLS="true"></EMBED><br><span style="font-size: 9pt;">Click to close</span></BODY></HTML>');
	} else if (newFile == "" && text != "") {
    	newWindow = window.open ("", "displayWindow", formatStr);
    	newWindow.document.writeln ('<HTML><HEAD><TITLE>Tip</TITLE></HEAD><BODY STYLE=\"background-color: #FFFFC0;\" onLoad="self.focus()" onClick="window.close()"><span style="font-size: 9pt;">' + text + '<p>Click to close</span></BODY></HTML>');	
	} else {
		newWindow = window.open (newFile, "displayWindow", formatStr);
	}
}

function popupWindowSizable(newFile, wWnd, hWnd, lWnd, tWnd) {
	formatStr = "left="+ lWnd +", top="+ tWnd +", height="+ hWnd +", width="+ wWnd +", location=yes, status=yes, toolbar=yes, menubar=no, resizable=yes, scrollbars=yes";
	var ext = newFile.substring(newFile.length-4, newFile.length);
	ext = ext.toLowerCase();
	if (ext == ".jpg" || ext == ".gif" || ext == ".png") {
    	newWindow = window.open ("", "displayWindow", formatStr);
    	newWindow.document.writeln ('<HTML><HEAD><TITLE>Popup Image</TITLE></HEAD><BODY onLoad="self.focus()" onClick="window.close()"><IMG SRC="' + newFile + '"><br>Click to close</BODY></HTML>');	
	} else {
		newWindow = window.open (newFile, "displayWindow", formatStr);
	}
}

function popUnderWindow(newFile, wWnd, hWnd, lWnd, tWnd) {
	formatStr = "left="+ lWnd +", top="+ tWnd +", height="+ hWnd +", width="+ wWnd +", location=no, status=no, toolbar=no, menubar=no, resizable=no, scrollbars=yes";
	var ext = newFile.substring(newFile.length-4, newFile.length);
	ext = ext.toLowerCase();
	if (ext == ".jpg" || ext == ".gif" || ext == ".png") {
    	newWindow = window.open ("", "displayWindow", formatStr);
    	newWindow.document.writeln ('<HTML><HEAD><TITLE>Popup Image</TITLE></HEAD><BODY onLoad="self.focus()" onClick="window.close()"><IMG SRC="' + newFile + '"><br>Click to close</BODY></HTML>');	
	} else {
		newWindow = window.open (newFile, "displayWindow", formatStr);
	}

	newWindow.blur();
	window.focus;
}

function textCounter(field, countfield, maxlimit) {
    if (field.value.length > maxlimit) {
		// if too long...trim it!
    	field.value = field.value.substring(0, maxlimit);
    } else { 
    	// otherwise, update 'characters left' counter
		var elem = document.getElementById(countfield);
	   	elem.innerHTML = field.value.length;
    }
}

function click(e) {
	if (document.layers || navigator.appName.indexOf('Netscape')>-1 || document.getElementById&&!document.all) {
        if (e.which==2 || e.which==3) {
            alert('This page is (c) Teknidome Gaming Centres and may not be reproduced or copied.');
            return false;
        }
    } else {
        if (window.event.button==2 || window.event.button==3) {
            alert('This page is (c) Teknidome Gaming Centres and may not be reproduced or copied.');
            return false; 
        }
    }
}
if (document.layers) {
    window.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=click;
} else {
    document.oncontextmenu=new Function("alert('This page is (c) Teknidome Gaming Centres and may not be reproduced or copied.'); return false")
}

function bookmark() {
	browser = navigator.appName;
	if (browser.indexOf("Netscape")>-1) {
		document.addBookmark("Teknidome PC Gaming: Gaming for the Elite","http://www.teknidome.com");
	} else {
		window.external.AddFavorite("http://www.teknidome.com", "Teknidome PC Gaming: Gaming for the Elite");
	}
}

function toggleLayer(elemID) {
    var elem, vis;
	
    if (document.getElementById) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (document.all) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (document.layers) // this is the way nn4 works
    	elem = document.layers[elemID];
    
	vis = elem.style;
    // if the style.display value is blank we try to figure it out here
	if (elem.offsetWidth != undefined && elem.offsetHeight != undefined) {
        if ((vis.display == '' || vis.display == 'none')) {
        	vis.display = 'block';
    	} else {
      		vis.display = 'none';
    	}
	}
}

function showLayer(elemID) {
    var elem, vis;
	
    if (FF3) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (IE4) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (NN4) // this is the way nn4 works
    	elem = document.layers[elemID];
    
	vis = elem.style;
    // if the style.display value is blank we try to figure it out here
    if ((vis.display == '' || vis.display == 'none') && elem.offsetWidth != undefined && elem.offsetHeight != undefined) {
		if (FF3)
			vis.display = 'block';
		else if (IE4)
			vis.visibility = 'visible';
		else if (NN4)
			vis.visible = 'visible';
	}
}

function hideLayer(elemID) {
    var elem, vis;
	
    if (FF3) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (IE4) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (NN4) // this is the way nn4 works
    	elem = document.layers[elemID];
    
	vis = elem.style;
    // if the style.display value is blank we try to figure it out here
    if ((vis.display != '' && vis.display != 'none') && elem.offsetWidth != undefined && elem.offsetHeight != undefined) {
		if (FF3)
			vis.display = 'none';
		else if (IE4)
			vis.visibility = 'hidden';
		else if (NN4)
			vis.visible = 'hide';
	}
}

function hideLayerDelay(elemID) {
	timeID = setTimeout("hideLayer('"+elemID+"')", 500);
}

function hideLayerCancel() {
	if (timeID > 0) clearTimeout(timeID);
}

function hideAllMenus() {
	for (i=0; i<menus.length; i++) {
		hideLayer(menus[i]);
	}
	if (timeID > 0) clearTimeout(timeID);
}

function moveDiv(elemID, newX, newY, offsetX, offsetY) {
	var elem;
	
    if (FF3) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (IE4) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (NN4) // this is the way nn4 works
    	elem = document.layers[elemID];
		
	if (elem) {
        newX = newX + offsetX;
        newY = newY + offsetY;
        elem.style.left = newX + 'px';
        elem.style.top = newY + 'px';
	}
}

function resizeBioDiv(newH) {
	var elemID;
	var elem;
	var newH;
	
	elemID = "bioid";
    if (document.getElementById) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (IE4) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (NN4) // this is the way nn4 works
    	elem = document.layers[elemID];
	
	if (elem) {
        elem.style.height = newH + 'px';
	}
}

function getDivX(elemID) {
	var elem;
	
    if (FF3) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (IE4) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (NN4) // this is the way nn4 works
    	elem = document.layers[elemID];
		
	if (elem) {
		return parseInt(elem.style.left);
	}
}

function getDivY(elemID) {
	var elem;
	
    if (FF3) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (IE4) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (NN4) // this is the way nn4 works
    	elem = document.layers[elemID];
		
	if (elem) {
		return parseInt(elem.style.top);
	}
}

function changeLayerText(elemID, NewText) {
	var elem;
	
    if (document.getElementById) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (document.all) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (document.layers) // this is the way nn4 works
    	elem = document.layers[elemID];

	if (elem) elem.innerHTML = NewText;	
}

function changeLayerImage(elemID, src, height, width, alt) {
	var elem;
	
    if (document.getElementById) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (document.all) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (document.layers) // this is the way nn4 works
    	elem = document.layers[elemID];

	if (elem) elem.innerHTML = "";	
}

function addOption(theSel, theText, theValue) {
    var newOpt = new Option(theText, theValue);
    var selLength = theSel.length;
    theSel.options[selLength] = newOpt;
}

function deleteOption(theSel, theIndex) { 
    var selLength = theSel.length;
    if(selLength>0) {
    	theSel.options[theIndex] = null;
	}
}

function moveOptions(theSelFrom, theSelTo) {
    var selLength = theSelFrom.length;
    var selectedText = new Array();
    var selectedValues = new Array();
    var selectedCount = 0;
    
    var i;

    // Find the selected Options in reverse order
    // and delete them from the 'from' Select.
    for(i=selLength-1; i>=0; i--) {
    	if(theSelFrom.options[i].selected) {
            selectedText[selectedCount] = theSelFrom.options[i].text;
            selectedValues[selectedCount] = theSelFrom.options[i].value;
            deleteOption(theSelFrom, i);
            selectedCount++;
    	}
  	}
  
    // Add the selected text/values in reverse order.
    // This will add the Options to the 'to' Select
    // in the same order as they were in the 'from' Select.
	for(i=selectedCount-1; i>=0; i--) {
    	addOption(theSelTo, selectedText[i], selectedValues[i]);
  	}
  
  	if(NS4) history.go(0);
}

function selectAllOptions(theSel) {
	var i;
	for (i=0; i<theSel.length; i++) {
		theSel.options[i].selected = true;
	}
}

function mouseX(elemID) {
	var val, elem;
	
    if (IE4) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (FF3) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (NN4) // this is the way nn4 works
    	elem = document.layers[elemID];
	
    if (elem.pageX) {
		val = elem.pageX;
    } else if (elem.clientX) {
       	val = (elem.clientX + (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft);
    } else {
		val = null;
	}
	return val;
}

function mouseY(elemID) {
	var val, elem;
	
    if (IE4) // this is the way old msie versions work
    	elem = document.all[elemID];
    else if (FF3) // this is the way the standards work
    	elem = document.getElementById(elemID);
    else if (NN4) // this is the way nn4 works
    	elem = document.layers[elemID];
	
    if (elem.pageY) {
		val = elem.pageY;
    } else if (elem.clientY) {
       	val = (elem.clientY + (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop);
    } else {
		val = null;
	}
	return val;
}

function getMouseX(e){
	var posx = 0;
	if (!e) var e = window.event;
	if (e.pageX) {
		posx = e.pageX;
	} else if (e.clientX) {
		posx = e.clientX + document.body.scrollLeft	+ document.documentElement.scrollLeft;
	}
	return posx;
}

function getMouseY(e){
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageY) {
		posy = e.pageY;
	} else if (e.clientY) {
		posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
	return posy;
}

function findImagePosX(elemID) {
    if (IE4) { // this is the way old msie versions work; we need to loop through all parents adding up coords
    	var x = 0;
		var elem = document.images[elemID];
        while(elem != null){
            x += elem.offsetLeft;
            elem = elem.offsetParent;
        }
	}
    else if (FF3) // this is the way the standards work
    	var x = document.images[elemID].x;
    else if (NN4) // this is the way nn4 works
    	var x = document.images[elemID].x;

	return x;
}

function findImagePosY(elemID) {
    if (IE4) { // this is the way old msie versions work; we need to loop through all parents adding up coords
    	var y = 0;
		var elem = document.images[elemID];
        while(elem != null){
            y += elem.offsetTop;
            elem = elem.offsetParent;
        }
	}
    else if (FF3) // this is the way the standards work
    	var y = document.images[elemID].y;
    else if (NN4) // this is the way nn4 works
    	var y = document.images[elemID].y;
	
	return y;
}

function fillPhotoContent(imgfile, imgtitle, imgdescr, imgexif, alttag, album) {
	document['photocontent'].src = imgfile;
	document['photocontent'].alt = alttag;
	document['photocontent'].title = alttag;
	changeLayerText("phototitle", imgtitle);
	changeLayerText("photodescr", imgdescr);
	changeLayerText("photoexif", imgexif);
	changeLayerText("photoalbum", "Album: " + album);
} 
//End Hide-->