// index page



var w = window, d = document, c = 0;



function $(id) {
return document.getElementById(id);
}



/*@cc_on
@if (@_jscript_version == 5.6) // @tpx: IE6 

{d.execCommand("BackgroundImageCache",false,true);}

/*@end
@*/



function free() {
if (top.location != self.location) {
top.location = self.location;
}
}



function resize() {
if (screen.width <= 1024) {
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
}
else {
if (w.innerWidth) {
var hor = w.innerWidth;
var ver = w.innerHeight;
}
else if (d.documentElement && d.documentElement.clientWidth) {
var hor = d.documentElement.clientWidth;
var ver = d.documentElement.clientHeight;
}
else if (d.body) {
var hor = d.body.clientWidth;
var ver = d.body.clientHeight;
}
if (hor < 824 || ver < 668) {
var hor = 1024;
var ver = 768;
var x = (screen.width - hor)/2;
var y = (screen.height - ver)/2 + 11; // + 11 for personal AWG settings 
top.resizeTo(hor,ver);
top.moveTo(x,y);
}
}
}



function preload() { // custom preload images 
var images = new Array();
for (var i = 0; i < arguments.length; i++) {
images[i] = document.createElement('img');
images[i].setAttribute('src',arguments[i]);
}
}



function status() { // 
w.defaultStatus = ' ';
}



function nav(id) { // custom navigation part one 
$(id).onmouseover = function () {
$(id).className = 'hover';
}
$(id).onmouseout = function () {
$(id).className = '';
}
$(id).onmouseup = function () {
var n = id.charAt(3);
navtoo(n);
}
}



function navtoo(n) { // custom navigation part two 
if (n == 1) {
$('layer10').src = 'cHTML/cHome.html';
$('layer30').className = '';
$('layer31').className = '';
}
else if (n == 2) {
if (c < 16) {
c ++;
if (c < 10) {
c = '0' + c;
}
$('layer10').src = 'cHTML/cPic'+c+'.html';
}
else {
c = 1;
$('layer10').src = 'cHTML/cPic01.html';
}
$('layer30').className = '';
$('layer31').className = '';
}
else if (n == 3) {
if (c > 1) { 
c --;
if (c < 10) {
c = '0' + c;
}
$('layer10').src = 'cHTML/cPic'+c+'.html';
}
else {
c = 16;
$('layer10').src = 'cHTML/cPic16.html';
}
$('layer30').className = '';
$('layer31').className = '';
}
else if (n == 4) {
$('layer10').src = 'cHTML/cLinks.html';
$('layer30').className = 'show';
$('layer31').className = 'show';
}
else if (n == 5) {
email('en');
}
}



function email(lang) { // custom e-mail webmaster window 
w.open('http://www.folderpark.net/e-mail/form.php?e-mail=www.folderpark.net/cody/&lang='+lang+'','webmaster','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=no');
}



function nodots() { // custom no dotted border around links in Fx when clicked, doesn't break keyboard navigation 
var as, i;
as = d.getElementsByTagName('a');
for(i=0; i<as.length; i++) {
as[i].onmousedown = function () {
this.className = 'nodots';
}
as[i].onkeypress = function () {
this.className = '';
}
}
}



function inf() { // custom show and hide information (legend) 
$('inf').onmouseover = function () {
$('inf').className = 'show';
}
$('inf').onmouseout = function () {
$('inf').className = '';
}
}



function tag() { // custom show and hide tag 
$('tag').onmouseover = function () {
$('inv').className = 'show';
$('tag').className = 'show';
}
$('tag').onmouseout = function () {
$('inv').className = '';
$('tag').className = '';
}
}



function tpx() { // custom link to TPX 
$('tpx').onmouseover = function () {
$('tpx').title = ' www.tpx.com.pa ';
}
$('tpx').onmouseup = function() {
w.open('http://www.tpx.com.pa/','');
}
}



w.onload = function() {
free();
resize();
preload('cPix/cOpen/cLoading.gif','cPix/cOpen/cEnter.gif','cPix/cOpen/cOpenAni.gif','cPix/cAll/cNav.gif');
status();
nav('nav1');
nav('nav2');
nav('nav3');
nav('nav4');
nav('nav5');
nodots();
inf();
tag();
tpx();
}