// Progressbar - Version 2.6
// Author: Brian Gosselin of http://scriptasylum.com

var imagenames=[ 'img/index2_01.jpg' , 'img/index2_02.jpg' , 'img/index2_03.jpg' , 'img/index2_04.jpg' , 'img/index2_05.jpg' , 'img/index2_06.jpg' , 'img/index2_07.jpg' , 'img/index2_08.jpg' , 'img/index2_09.jpg' , 'img/index2_10.jpg' , 'img/index2_11.jpg' , 'img/index2_12.jpg' , 'img/index2_13.jpg' , 'img/index2_14.jpg' , 'img/index2_15.jpg' , 'img/index2_16.jpg' , 'img/index2_17.jpg' , 'img/index2_18.jpg' , 'img/index2_19.jpg' , 'img/index2_20.jpg' , 'img/index2_21.jpg' , 'img/index2_22.jpg' , 'img/index2_23.jpg' , 'img/index2_24.jpg' , 'img/index2_25.jpg' , 'img/index2_26.jpg' , 'img/index2_27.jpg' , 'img/index2_28.jpg' , 'img/index2_29.jpg' , 'img/index2_30.jpg' , 'img/index2_31.jpg' , 'img/index2_32.jpg' , 'img/index2_33.jpg' , 'img/index2_34.jpg' , 'img/index2_35.jpg' , 'img/index2_36.jpg' , 'img/index2_37.jpg' , 'img/index2_38.jpg' , 'img/index2_39.jpg' , 'img/index2_40.jpg' , 'img/index2_41.jpg' , 'img/index2_42.jpg' , 'img/index2_43.jpg' , 'img/index2_44.jpg' , 'img/index2_45.jpg' , 'img/index2_46.jpg' , 'img/index2_47.jpg' , 'img/index2_48.jpg' , 'img/index2_49.jpg' , 'img/index2_50.jpg' , 'img/index2_51.jpg' , 'img/index2_52.jpg' , 'img/index2_53.jpg' , 'img/index2_54.jpg' , 'img/index2_55.jpg' , 'img/index2_56.jpg' , 'img/index2_57.jpg' , 'img/index2_58.jpg' , 'img/index2_59.jpg' , 'img/index2_60.jpg' , 'img/index2_61.jpg' , 'img/index2_62.jpg' , 'img/index2_63.jpg' , 'img/index2_64.jpg' , 'img/index2_65.jpg' , 'img/index2_66.jpg' , 'img/index2_67.jpg' , 'img/index2_68.jpg' , 'img/index2_69.jpg' , 'img/index2_70.jpg' , 'img/index2_71.jpg' , 'img/index2_72.jpg' , 'img/index2_73.jpg' , 'img/index2_74.jpg' , 'img/index2_75.jpg' , 'img/index2_76.jpg' , 'img/index2_77.jpg' , 'img/index2_78.jpg' , 'img/index2_79.jpg' , 'img/index2_80.jpg' , 'img/index2_81.jpg' , 'img/index2_82.jpg' , 'img/index2_83.jpg' , 'img/index2_84.jpg' , 'img/spacer.gif' ];

var yposition=350;						//POSITION OF LOAD BAR FROM TOP OF WINDOW, IN PIXELS
var loadedcolor='#B7B7B7';				// PROGRESS BAR COLOR
var unloadedcolor='#000000';			// BGCOLOR OF UNLOADED AREA
var barheight=8;						// HEIGHT OF PROGRESS BAR IN PIXELS
var barwidth=200;						// WIDTH OF THE BAR IN PIXELS
var bordercolor='#ffffff';				// COLOR OF THE BORDER
var textColor='#ffffff';				// COLOR OF TEXT IN LOADING BAR
var textSize='12px';					// SIZE OF TEXT IN LOADING BAR
var textFont='verdana,arial,helvetica,sans-serif';           // FONT FAMILY OF TEXT IN LOADING BAR
var loadonce=false;						// IF THIS VALUE IS true THE BAR WILL NOT DISPLAY IF THE USER
										// RETURNS TO THE PAGE, SET TO false TO HAVE THE BAR REAPPEAR IF
										// THE USER RETURNS TO THE PAGE.

// THE FUNCTION BELOW CONTAINS THE ACTION(S) TAKEN ONCE IMAGES ARE DONE LOADING.
// IF NO ACTION IS DESIRED, TAKE EVERYTHING OUT FROM BETWEEN THE CURLY BRACES ({})
// BUT LEAVE THE FUNCTION NAME AND CURLY BRACES IN PLACE. PRESENTLY, IT IS SET TO
// HIDE THE BAR, BUT CAN BE CHANGED EASILY. TO CAUSE A REDIRECT, INSERT THE FOLLOWING
// LINE IN BETWEEN THE CURLY BRACES:
// document.location.href="http://www.redirect_page.html";
// JUST CHANGE THE ACTUAL PAGE IT "POINTS" TO.

var action=function()
{
document.location.href="index_de.htm";
}

//*****************************************************//
//********  NO NEED TO EDIT BEYOND THIS POINT  ********//
//*****************************************************//

var NS4 = (document.layers)? true : false;
var IE4 = (document.all)? true : false;
var blocksize=(barwidth-2)/(imagenames.length);
barheight=Math.max(barheight,4);
var loaded=0;
var perouter=null;
var perdone=null;
var images=new Array();
var txt='';
if(NS4){
txt+='<table cellspacing=0 cellpadding=0 border=0><tr><td>';
txt+='<ilayer name="perouter" visibility="hide" height="'+barheight+'" width="'+barwidth+'">';
txt+='<layer width="'+barwidth+'" height="'+barheight+'" bgcolor="'+bordercolor+'" top="0" left="0"></layer>';
txt+='<layer width="'+(barwidth-2)+'" height="'+(barheight-2)+'" bgcolor="'+unloadedcolor+'" top="1" left="1"></layer>';
txt+='<layer name="perdone" width="'+(barwidth-2)+'" height="'+(barheight-2)+'" bgcolor="'+loadedcolor+'" top="1" left="1"></layer>';
txt+='<layer width="'+(barwidth-2)+'" height="'+(barheight-2)+'" top="1" left="1">';
txt+='<table cellpadding=0 cellspacing=0 border=0 width="'+(barwidth-2)+'" height="'+(barheight-2)+'"><tr><td align="center" valign="middle">';
txt+='<span style="color:'+textColor+'; font-size:'+textSize+'; font-family:'+textFont+'"><br>Loading Commander';
txt+='</td></tr></table>';
txt+='</layer>';
txt+='</ilayer>';
txt+='</td></tr></table>';
}else{
txt+='<div id="perouter" style="position:relative; visibility:hidden; background-color:'+bordercolor+'; width:'+barwidth+'px; height:'+barheight+'px;">';
txt+='<div style="position:absolute; top:1px; left:1px; width:'+(barwidth-2)+'px; height:'+(barheight-2)+'px; background-color:'+unloadedcolor+'; font-size:1px;"></div>';
txt+='<div id="perdone" style="position:absolute; top:1px; left:1px; width:0px; height:'+(barheight-2)+'px; background-color:'+loadedcolor+'; font-size:1px;"></div>';
txt+='<div style="position:absolute; top:2px; left:1px; width:'+(barwidth-2)+'px; height:'+(barheight-2)+'px; color:'+textColor+'; font-size:'+textSize+'; font-family:'+textFont+'; text-align:center; cursor:default"><br>Loading Commander</div>';
txt+='</div>';
}
document.write(txt);

//THIS FUNCTION BY MIKE HALL OF BRAINJAR.COM
function findlayer(name,doc){
var i,layer;
for(i=0;i<doc.layers.length;i++){
layer=doc.layers[i];
if(layer.name==name)return layer;
if(layer.document.layers.length>0)
if((layer=findlayer(name,layer.document))!=null)
return layer;
}
return null;
}

function loadimages(){
perouter=(NS4)?findlayer('perouter',document):(IE4)?document.all['perouter']:document.getElementById('perouter');
perdone=(NS4)?perouter.document.layers['perdone']:(IE4)?document.all['perdone']:document.getElementById('perdone');
if(NS4)perouter.captureEvents(Event.MOUSEUP);
perouter.onmouseup=hidebar;
clipEl(perdone,0,0,barheight-2,0);
if(NS4)perouter.visibility="show";
else perouter.style.visibility="visible";
for(n=0;n<imagenames.length;n++){
images[n]=new Image();
images[n].src=imagenames[n];
if(images[n].complete)dispbars();
images[n].onload=dispbars;
images[n].onerror=dispbars;
}}

function dispbars(){
loaded++;
clipEl(perdone, 0, blocksize*loaded, barheight-2, 0);
if(loaded>=imagenames.length)setTimeout('action()', 800);
}

function hidebar(){
if(NS4)perouter.visibility="hide";
else perouter.style.visibility="hidden";
}

function clipEl(el, ct, cr, cb, cl){
if(NS4){
el.clip.left=cl;
el.clip.top=ct;
el.clip.right=cr;
el.clip.bottom=cb;
}else el.style.width=cr+'px';
}

//CREDIS TO DYNAMICDRIVE FOR THE FUNCTION BELOW
function get_cookie(Name) {
var search=Name+"=";
var returnvalue="";
if(document.cookie.length>0){
offset=document.cookie.indexOf(search);
if(offset!=-1){
offset+=search.length;
end=document.cookie.indexOf(";",offset);
if(end==-1)end=document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset,end));
}}
return returnvalue;
}

window.onload=function(){
var okPB=false;
if (loadonce){
if(get_cookie("progB")==""){
okPB=true;
document.cookie="progB=yes";
}}
else okPB=true;
if(okPB)setTimeout('loadimages()',300);
}