//created by terrilein 2003

/*
Change Skin Script - Craig Suffolk (http://www.proboards.com)
This script was first featured on KSE (http://knockstar.proboards2.com)
This copyright noticed must stay intact for use
*/

var scheme = getCookie('template2');
var cssVar= new String("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-rose.css\">");
if (scheme == 'IBG') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/IBG.css\">";
} else if (scheme == 'mali') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-mali.css\">";
} else if (scheme == 'dabuzz') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/dabuzz.css\">";
} else if (scheme == 'cky') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/ckytest.css\">";
} else if (scheme == 'red') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-red.css\">";
} else if (scheme == 'green') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-green.css\">";
} else if (scheme == 'purple') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-purple.css\">";
} else if (scheme == 'yellow') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-yellow.css\">";
} else if (scheme == 'gray') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-black.css\">";
} else if (scheme == 'fire') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-fire.css\">";
} else if (scheme == 'blue') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-blue.css\">";
} else if (scheme == 'sea') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-sea.css\">";
} else if (scheme == 'baby') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-baby.css\">";
} else if (scheme == 'rasta') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-rasta.css\">";
} else if (scheme == 'smstars') {
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-smstars.css\">";
} else {
scheme = 'default';
cssVar="<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/gray-rose.css\">";
}

var myLocation= new String(window.location);
if (myLocation.indexOf('testboard') !=-1 || myLocation.indexOf('admintest')!=-1){
window.document.write('<span ID="TestThisStyle" Style="visibility:hidden">' + cssVar + '</span>');
}else{
document.write(cssVar);
}

function changeskin(change) {
var scheme = change;
var name = 'template2';
var pathname = location.pathname;
var myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var ExpDate = new Date ();
ExpDate.setTime(ExpDate.getTime() + (180 * 24 * 3600 * 1000));
setCookie(name,scheme,ExpDate,myDomain);
}
function getCookie(name){
var cname = name + "="; 
var dc = document.cookie; 
if (dc.length > 0) { 
begin = dc.indexOf(cname); 
if (begin != -1) { 
begin += cname.length; 
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}

function setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) + 
((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
((secure == null) ? "" : "; secure");
}

//**********************************************************************************

/*
Copyright (c) 2003 Test Your Style
http://testyourstyle.proboards2.com/index.cgi
License is granted if and only if this entire
copyright notice is included. By Terri Lindhurst.
*/

function displayMenu(divObj1, divObj2, menuType){
   if(divObj2.innerHTML==""){
	divObj2.innerHTML=getMenuHTML(menuType);   
	//divObj1.style.zIndex='99';
	//divObj1.style.zIndex=divObj1.style.zIndex+1;
   }else{
      divObj2.innerHTML="";
    //divObj1.style.zIndex='1';
   }
}

var gradientFolder="http://www.lindhurst.de/gradientlist/";
function UpdateTextField(gradURL){
gradientSRC.value = gradientFolder + gradURL;
}

function getMenuHTML(tableType){
switch(tableType){
case "menu":
      docHTML="<TABLE align=center cellpadding=\"2\" cellspacing=\"0\" >";
   docHTML=docHTML+"<TR>";
  docHTML=docHTML+"<td>";
   docHTML=docHTML+"<select Style=\"width:130\" onChange=\"changeskin(this.options[this.selectedIndex].value); window.location.reload();\">";
   docHTML=docHTML+"<option>Change Skin";
   docHTML=docHTML+"<option>";
   docHTML=docHTML+"<option value=\"smstars\"> sun, moon & stars";
   docHTML=docHTML+"<option value=\"rose\"> default";
   docHTML=docHTML+"<option value=\"IBG\"> IBG";
   docHTML=docHTML+"<option value=\"mali\"> Mali black";
   docHTML=docHTML+"<option value=\"dabuzz\"> Da Buzz";
   docHTML=docHTML+"<option value=\"cky\"> CKY";
   docHTML=docHTML+"<option value=\"blue\"> blue";
   docHTML=docHTML+"<option value=\"red\"> red";
   docHTML=docHTML+"<option value=\"green\"> green";
   docHTML=docHTML+"<option value=\"purple\"> purple";
   docHTML=docHTML+"<option value=\"yellow\"> yellow";
   docHTML=docHTML+"<option value=\"gray\"> gray";
   docHTML=docHTML+"<option value=\"fire\"> fire";
   docHTML=docHTML+"<option value=\"sea\"> sea";
   docHTML=docHTML+"<option value=\"baby\"> baby";
   docHTML=docHTML+"<option value=\"rasta\"> rasta";
   docHTML=docHTML+"</select></td>";
  docHTML=docHTML+"</TR><TR>";
docHTML=docHTML+"<td>";
   docHTML=docHTML+"<select Style=\"width:130\" onchange=\"window.location=this.options[this.selectedIndex].value; return false;\">";
   docHTML=docHTML+"<option>Board Navigation";
   docHTML=docHTML+"<option>";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi\">Home";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?board=general\">General Board";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?board=support\">Support";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?board=skins\">Skin Requests/Submissions";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?board=sugsnbugs\">Suggestions/Bug Reports";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?board=testboard\">Test Board";
   docHTML=docHTML+"</select></td>";
   docHTML=docHTML+"</TR><TR>";
   docHTML=docHTML+"<td>";
   docHTML=docHTML+"<select Style=\"width:130\" onchange=\"window.location=this.options[this.selectedIndex].value; return false;\">";
   docHTML=docHTML+"<option>Other Services";
   docHTML=docHTML+"<option>";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?action=search\"> Search";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?action=mlall\"> Members";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?action=calendar\">Calendar"; 
  docHTML=docHTML+"</select></td>";
   docHTML=docHTML+"</TR><TR>";
   docHTML=docHTML+"<td>";
   docHTML=docHTML+"<select Style=\"width:130\" onchange=\"window.location=this.options[this.selectedIndex].value; return false;\">";
   docHTML=docHTML+"<option>Affiliates";
   docHTML=docHTML+"<option>";
http://skinsector.proboards17.com/index.cgi
   docHTML=docHTML+"<option value=\"http://gameadmin.proboards2.com/index.cgi\">Gamer Graphics";
   docHTML=docHTML+"<option value=\"http://affiliate.proboards17.com/index.cgi\"><i>Pro</i>Network";
   docHTML=docHTML+"<option value=\"http://www.computerforums.org\">ComputerForums";
   docHTML=docHTML+"<option value=\"http://affiliate.proboards17.com/index.cgi\">Affiliate Room";
   docHTML=docHTML+"<option value=\"http://adfounder.proboards19.com/index.cgi\">Leava\' Link";
   docHTML=docHTML+"<option value=\"http://freak.proboards12.com/index.cgi\">Freak\'s Forums";
   docHTML=docHTML+"<option value=\"http://testyourstyle.proboards2.com/index.cgi?board=general&action=display&num=1053428295\">Want to affiliate?";
  docHTML=docHTML+"</select></td>";
  docHTML=docHTML+"</TR></TABLE>";
   return docHTML;

case "gradient":
var GradientAr = new Array;
  for(i=1;i<33;i++){
  GradientAr[GradientAr.length]="grad" + i + ".gif";
  }

  var newRow = 0;
  var listEnd=false;
  docHTML="<table width=\"100%\" border=\"1\" cellspacing=\"1\" cellpadding=\"4\">";
  docHTML=docHTML+"<TR>";
  for (i=0; i<GradientAr.length;i++){
     if(newRow==6){
        if(newRow==GradientAr.length) listEnd=true;
	docHTML=docHTML+"</tr><tr>";
        newRow=0;
     }
     newRow++;
     docHTML=docHTML+"<td onclick=\"UpdateTextField('" + GradientAr[i] + "');\" Style=\"cursor:hand; height:28px; background-image: url('" + gradientFolder + GradientAr[i] +"'); background-repeat :repeat-x;\"></td>";
  }
  if(listEnd==false)docHTML=docHTML+"</tr><tr>";
  docHTML=docHTML+"<td colspan=6 Style=\"border:none\"><input type=\"text\" ID=\"gradientSRC\"></td>";
  docHTML=docHTML+"</tr></table>";
  return docHTML;
   }
}
//**********************************************************************************

/*
created by terrilein 2003
*/


checkboxstyle();

function checkboxstyle()
{
   var inputItems= document.getElementsByTagName('INPUT');
   var element;
      for (i=0; i<inputItems.length; i++)
      {
       element = inputItems[i];
       if (element.type == "checkbox" || element.type == "radio" || element.type == "image") {
           element.style.borderStyle="none";
           element.style.backgroundColor="transparent";
           element.style.backgroundImage="none";
           if(element.filters.length !=0) {
              for (x=0; x<element.filters.length; x++)
                  { 
                     element.filters.item(x).enabled=0;
                  }
           }
       }
   }
}

function memberBar(){
// created by terrilein 2003
var myLocation= new String(window.location);
if(myLocation.indexOf("action=mlall")!=-1 || myLocation.indexOf("action=mlletter")!=-1 || myLocation.indexOf("action=mltop")!=-1 || myLocation.indexOf("action=mlstaff")!=-1){
  for (i=0; i<document.links.length;i++){
     var thisLink = new String(document.links[i].href);
     if((thisLink.indexOf("action=mlletter")!=-1 || 
        thisLink.indexOf("action=mlall")!=-1 || 
        thisLink.indexOf("action=mlstaff")!=-1 || 
        thisLink.indexOf("action=mltop")!=-1) &&  thisLink.indexOf("&letter")==-1 &&  thisLink.indexOf("#")==-1) {
        document.links[i].className="titleBar";
     }
  }
}
}


//**********************************************************************************

// Copyright (c) 2003 Test Your Style
// http://testyourstyle.proboards2.com/index.cgi
// License is granted if and only if this entire
// copyright notice is included. By Terri Lindhurst.

var updateBKUP=true;

function testStyle(){
var cssVar=new String(window.document.myStyle.styleSheet.innerText);
TestThisStyle.innerHTML='[<style type="text/css"><!--' + cssVar + '//--></style>]';

for(k=0; k<document.images.length; k++){
if(document.images[k].src.indexOf('/PBTitel-') != -1){
 document.images[k].src=document.myStyle.userPic.value;
}
}
}

function styleCard(jsVal, cssVal){
this.js=jsVal;
this.css=cssVal;
}
styleCard_0=new styleCard("scrollbarArrowColor", "scrollbar-arrow-color");
styleCard_1=new styleCard("scrollbarBaseColor", "scrollbar-base-color");
styleCard_2=new styleCard("scrollbarFaceColor", "scrollbar-face-color");
styleCard_3=new styleCard("scrollbarTrackColor", "scrollbar-track-color");
styleCard_4=new styleCard("scrollbarHighlightColor", "scrollbar-highlight-color");
styleCard_5=new styleCard("scrollbarShadowColor", "scrollbar-shadow-color");
styleCard_6=new styleCard("scrollbar3dLightColor", "scrollbar-3d-light-color");
styleCard_7=new styleCard("scrollbarDarkShadowColor", "scrollbar-darkshadow-color");
styleCard_8=new styleCard("border", "border");
styleCard_9=new styleCard("backgroundImage", "background-image");
styleCard_10=new styleCard("backgroundRepeat", "background-repeat");
styleCard_11=new styleCard("backgroundAttachment", "background-attachment");
styleCard_12=new styleCard("backgroundColor", "background-color");
styleCard_13=new styleCard("fontSize", "font-size");
styleCard_14=new styleCard("fontWeight", "font-weight");
styleCard_15=new styleCard("fontFamily", "font-family");
styleCard_16=new styleCard("color", "color");
styleCard_17=new styleCard("filter", "filter");
styleCard_18=new styleCard("height", "height");
styleCard_19=new styleCard("width", "width");
styleCard_20=new styleCard("padding", "padding");
styleCard_21=new styleCard("textDecoration", "text-decoration");

var styleCard_total=21;

var classAr=new Array;
classAr[classAr.length]="BODY";
classAr[classAr.length]=".windowbg";
classAr[classAr.length]=".windowbg2";
classAr[classAr.length]=".titlebg";
classAr[classAr.length]=".text1";
classAr[classAr.length]=".catbg";
classAr[classAr.length]=".titletext";
classAr[classAr.length]=".cattext";
classAr[classAr.length]=".bordercolor";
classAr[classAr.length]="font";
classAr[classAr.length]="A:link";
classAr[classAr.length]="A:visited";
classAr[classAr.length]="A:hover";
classAr[classAr.length]=".nav:link";
classAr[classAr.length]=".nav:visited";
classAr[classAr.length]=".nav:hover";
classAr[classAr.length]=".titleBar:link";
classAr[classAr.length]=".titleBar:visited";
classAr[classAr.length]=".titleBar:hover";
classAr[classAr.length]=".welcomebg";
classAr[classAr.length]=".menubg";
classAr[classAr.length]="TEXTAREA";
classAr[classAr.length]="INPUT";
classAr[classAr.length]="SELECT";
classAr[classAr.length]=".hr";
classAr[classAr.length]=".quote";
classAr[classAr.length]=".code";
classAr[classAr.length]=".adminuser:link";
classAr[classAr.length]=".adminuser:visited";
classAr[classAr.length]=".adminuser:hover";
classAr[classAr.length]=".gmoduser:link";
classAr[classAr.length]=".gmoduser:visited";
classAr[classAr.length]=".gmoduser:hover";

function getCurrentStyleSheet(){
var titleBar;
var tmpStyleSheet="";
 for(i=0;i<classAr.length;i++){
   titleBar=findStyleRule(classAr[i]);
   if(titleBar==null){
      tmpStyleSheet+=classAr[i] + "{}\n\n";
      }else{
      tmpStyleSheet+=classAr[i] + "{\n";
      for(x=0;x<styleCard_total;x++){
         var whichStyleCardJS=eval("styleCard_" + x + ".js");
         var whichStyleCardCSS=eval("styleCard_" + x + ".css");
         var tryThis= eval("titleBar.style." + whichStyleCardJS );
         if(tryThis!=""){
          tmpStyleSheet+=whichStyleCardCSS + ":" + tryThis + ";\n";
         }
      }
	tmpStyleSheet+="}\n\n";
	window.document.myStyle.styleSheet.value=tmpStyleSheet;
	if(updateBKUP==true)window.document.myStyle.cssBKUP.value=tmpStyleSheet;

    }
 }
}


function findStyleRule(styleName) {
     for (j = 0; j < window.document.styleSheets[1].rules.length; j++) {
      if (window.document.styleSheets[1].rules[j].selectorText == styleName) {
        return window.document.styleSheets[1].rules[j];
      }
    }     
}

function resetThisStyle(){
//"<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.lindhurst.de/css/IBG.css\">"
TestThisStyle.innerHTML='[<style type="text/css"><!--' + window.document.myStyle.cssBKUP.value + '//--></style>]';
updateBKUP=false;
getCurrentStyleSheet();
}

//**********************************************************************************

/*
Copyright © 2003 ProBoards.com
All Rights Reserved

Permission is hereby granted to use this code
solely on message boards hosted by ProBoards.com.
Any other site found to be using this code shall
be in violation of this copyright notice.
*/

function makeTable(){
var statusMessage = 'Welcome to Test Your Style';
var mouseOverColor = 'E1E1E1';

switch(scheme){

case "IBG":
mouseOverColor = '457E95';
break;
case "dabuzz":
mouseOverColor = 'FFB700';
break;
case "mali":
 mouseOverColor = '000000';
break;
case "cky":
 mouseOverColor = '000000';
break;
case "default":
mouseOverColor = 'E1E1E1';
break;
default:
 mouseOverColor = 'E1E1E1';
break;
}

window.status = statusMessage;


tables = document.getElementsByTagName('TABLE');

for(t=0;t<tables.length;t++) 
for(r=0;r<tables[t].rows.length; r++) 
for (c=0;c<tables[t].rows(r).cells.length; c++) 
if((tables[t].rows(r).cells(c).className=="windowbg2" && tables[t].rows(r).cells(c).width=="66%") || (tables[t].rows(r).cells(c).className=="windowbg" && tables[t].rows(r).cells(c).width=="48%")) {
tables[t].rows(r).cells(c).onmouseover = function(){this.style.cursor='hand';this.style.backgroundColor=mouseOverColor;window.status = (this.id.split('|'))[1];};
tables[t].rows(r).cells(c).onmouseout = function(){this.style.backgroundColor=this.bgColor;window.status=statusMessage};
if(tables[t].rows(r).cells(c).innerHTML.match(/href="(.+?)"><B>(.+?)</)) {
if(RegExp.$1 != 0) {
tables[t].rows(r).cells(c).id=RegExp.$1+'|'+RegExp.$2;
tables[t].rows(r).cells(c).onclick = function(){location.href=(this.id.split('|'))[0];};
}
}
}

//**********************start arrow-code***************************
/*
Copyright © 2003 Craig Suffolk, ProBoards.com
All Rights Reserved

Permission is hereby granted to use this code
solely on message boards hosted by ProBoards.com.
Any other site found to be using this code shall
be in violation of this copyright notice.
*/

var moveOverColor = mouseOverColor;
// this is the image of the arrow. If you don't want one, leave this blank
var arrowimage = 'http://www.lindhurst.de/pics/arrow.gif';

addAnc = document.getElementsByTagName('b');
tables = document.getElementsByTagName('TABLE');

if (navigator.appName==='Microsoft Internet Explorer') {

for(b=0;b<addAnc.length;b++) {
if (addAnc[b].innerHTML.match(/Reply #(.+?) on:/)){
anchor=RegExp.$1
addAnc[b].innerHTML=addAnc[b].innerHTML+'<a name="'+anchor+'"></a>';
}
}

for(t=0;t<tables.length;t++) {
for(r=0;r<tables[t].rows.length; r++) {
for (c=0;c<tables[t].rows(r).cells.length; c++) {
if(tables[t].rows(r).cells(c).className=="windowbg2" && tables[t].rows(r).cells(c).width=="20%" && location.href.indexOf('action=')== -1) {
if(arrowimage != '') {
tables[t].rows(r).cells(c).innerHTML='<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td>'+tables[t].rows(r).cells(c).innerHTML+'</td><td><img src="'+arrowimage+'" align="right"></td></tr></table>';
}
tables[t].rows(r).cells(c).onmouseover = function(){this.style.backgroundColor=moveOverColor;this.style.cursor='hand';};
tables[t].rows(r).cells(c).onmouseout = function(){this.style.backgroundColor=this.bgColor;};
tables[t].rows(r).cells(c).onclick = function(){
this.previousSibling.previousSibling.innerHTML.match(/>(.+?)</);
var replyNum=RegExp.$1;
if (replyNum == 0) {
var startNum=0;
} else {
for (n=0;n<replyNum;){
if ((replyNum>=n) && (replyNum<(n+15))){
var startNum=n;
}
n=n+15;
}
}
this.previousSibling.previousSibling.previousSibling.previousSibling.innerHTML.match(/href="(.+?)">/);
var postURL=RegExp.$1;
location=postURL+'&start='+startNum+'#'+replyNum;
};
}
}
}
}
}
//**********************end arrow code********************************************

}

//Generic Drag Script- © Dynamic Drive (www.dynamicdrive.com)
//For full source code and terms of usage,
//visit http://www.dynamicdrive.com

var ie=document.all
var ns6=document.getElementById&&!document.all

var dragapproved=false
var z,x,y

function move(e){
if (dragapproved){
z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
return false
}
}

function drags(e){
if (!ie&&!ns6)
return
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "HTML" : "BODY"

while (firedobj.tagName!=topelement&&firedobj.className!="drag"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.className=="drag"){
dragapproved=true
z=firedobj
z.style.zIndex=z.style.zIndex+1
temp1=parseInt(z.style.left+0)
temp2=parseInt(z.style.top+0)
x=ns6? e.clientX: event.clientX
y=ns6? e.clientY: event.clientY
document.onmousemove=move
return false
}
}
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false;")

