/* PixieTrix Comix Header version 1.0
Copyright (c) 2008-2011 Kisai c/o PixieTrix Comix, all rights reserved.
This script has been written specificly for use on the PixieTrix Comix
sites and is not permitted to be used on any site other than those as
listed on the www.pixietrixcomix.com website.

For any questions about the technical operation of this script please
contact kisai at keenspot.

Unlike keenspot sites, the PixieTrix header goes on the inside of the 
first div, not body. For sake of simplicity we need to know the id of
where it is to appear.

Other promo data (MC/EC boxes) is completely optional.
*/

var U_SUNDAY=0x1;
var U_MONDAY=0x2;
var U_TUESDAY=0x4;
var U_WEDNESDAY=0x8;
var U_THURSDAY=0x10;
var U_FRIDAY=0x20;
var U_SATURDAY=0x40;



//Bar size
var pixiheaderdiv= document.createElement('div');
pixiheaderdiv.position="absolute";//absolute for fixed position layouts
pixiheaderdiv.setAttribute('id','pixietrixbar');
pixiheaderdiv.style.backgroundColor="#000000";
pixiheaderdiv.style.borderBottom="3px solid #DCE424";
pixiheaderdiv.style.width="100%";
pixiheaderdiv.style.height="30px";
pixiheaderdiv.style.left="0px";
pixiheaderdiv.style.top="0px";
pixiheaderdiv.style.padding="0px";
pixiheaderdiv.style.margin="0px";

//Logo
var pixilogolink=document.createElement('a');
pixilogolink.setAttribute('href','http://www.pixietrixcomix.com');

var pixilogoimg=document.createElement('img');
pixilogoimg.setAttribute('width','176');
pixilogoimg.setAttribute('height','33');
pixilogoimg.setAttribute('border','0');
pixilogoimg.style.width="176px";
pixilogoimg.style.height="33px";
pixilogoimg.style.left="10px";
pixilogoimg.style.top="0px";
pixilogoimg.style.position="absolute";//absolute for fixed position layouts

pixilogoimg.setAttribute('src','http://www.pixietrixcomix.com/images/pixietrixlogo.gif');
pixilogolink.appendChild(pixilogoimg);
pixiheaderdiv.appendChild(pixilogolink);

var skipshouri=false; //bypass some configuration directives to not break the dropdown on Fragile
function dropswitch(url)        
{
    if (url !== '')  {
if(typeof _gaq == "undefined" || skipshouri==true){
    top.location.href = url;

}else{
_gaq.push(['zoompix._link', url]);
}

    }
}

var pxform=document.createElement('form');
pxform.setAttribute('action','');
pxform.style.position="absolute";

pxform.style.height="1em";
pxform.style.width="50%";
pxform.style.right="10px";
pxform.style.top="4px";
pxform.style.textAlign="right";
var pxselect=document.createElement('select');
pxselect.setAttribute('name','siteIndex');
pxselect.setAttribute('onchange','dropswitch(this.options[selectedIndex].value);');
pxform.appendChild(pxselect);

pixiheaderdiv.appendChild(pxform);

var cstripdiv= document.createElement('div');
cstripdiv.setAttribute('id','pixiestrip');
cstripdiv.style.backgroundColor="#000000";
//cstripdiv.style.padding="0px";
//cstripdiv.style.margin="0px";
//cstripdiv.style.overflow="hidden";

var acstripimg=document.createElement('img');
acstripimg.setAttribute('width','74');
acstripimg.setAttribute('height','43');
acstripimg.setAttribute('border','0');
acstripimg.style.border="0px";
acstripimg.style.width="54px";
acstripimg.style.height="43px";
acstripimg.style.margin="3px 2px 3px 2px";
acstripimg.style.left="0px";
acstripimg.style.top="0px";
//acstripimg.style.position="relative";

acstripimg.setAttribute('src',"http://www.pixietrixcomix.com/images/Pixietrix_bar.png");
var cstripdivbutton= document.createElement('div');
cstripdivbutton.setAttribute('id','pixiestripbutton');
cstripdivbutton.style.backgroundColor="#000000";
cstripdivbutton.style.position="absolute";
cstripdivbutton.style.left="70px";
cstripdivbutton.style.top="0px";

var cprevbar=document.createElement('img');
cprevbar.setAttribute('src',"http://www.pixietrixcomix.com/images/prev_bar.png");
cprevbar.setAttribute('width','9');
cprevbar.setAttribute('height','43');
cprevbar.setAttribute('border','0');

cprevbar.style.position="absolute";
cprevbar.style.left="58px";
cprevbar.style.top="0px";

cprevbar.style.border="0px";
cprevbar.style.width="9px";
cprevbar.style.height="43px";
cprevbar.style.margin="3px 2px 3px 2px";
cprevbar.onclick=moverbar;



var cnextbar=document.createElement('img');
cnextbar.setAttribute('src',"http://www.pixietrixcomix.com/images/next_bar.png");
cnextbar.setAttribute('width','9');
cnextbar.setAttribute('height','43');
cnextbar.setAttribute('border','0');

cnextbar.style.position="absolute";
cnextbar.style.right="0px";
cnextbar.style.top="0px";



cnextbar.style.border="0px";
cnextbar.style.width="9px";
cnextbar.style.height="43px";
cnextbar.style.margin="3px 2px 3px 2px";
cnextbar.onclick=movefbar;



cstripdiv.appendChild(acstripimg);
cstripdiv.appendChild(cprevbar);
cstripdiv.appendChild(cstripdivbutton);
cstripdiv.appendChild(cnextbar);



function addpsite(a,b,c,d){
//a= TextName
//b= URL to site
//c= button
//d= update schedule
var gofirst=false;
var todaydow=new Date();



if(todaydow.getDay()==0 &&(d & U_SUNDAY)){
gofirst=true;

}
if(todaydow.getDay()==1 &&(d & U_MONDAY)){
gofirst=true;

}
if(todaydow.getDay()==2 &&(d & U_TUESDAY)){
gofirst=true;

}
if(todaydow.getDay()==3 &&(d & U_WEDNESDAY)){
gofirst=true;

}
if(todaydow.getDay()==4 &&(d & U_THURSDAY)){
gofirst=true;

}
if(todaydow.getDay()==5 &&(d & U_FRIDAY)){
gofirst=true;

}
if(todaydow.getDay()==6 &&(d & U_SATURDAY)){
gofirst=true;

}
var inopt=new Option(a,b);
try{
/*
if(gofirst==true){
pxselect.add(inopt,pxselect.firstChild);
}
else
{
*/

pxselect.add(inopt,null);

//}

}
catch(e){
pxselect.add(inopt);

}



if(typeof c != 'undefined'){

var cstriplink=document.createElement('a');
cstriplink.setAttribute('href',b);

cstriplink.setAttribute('class','cstriplinks');
cstriplink.setAttribute('onclick',"zoompix._link(\""+b+"\");return false;");

var cstripimg=document.createElement('img');
cstripimg.setAttribute('title',a);
cstripimg.setAttribute('width','73');
cstripimg.setAttribute('height','43');
cstripimg.setAttribute('border','1');
cstripimg.style.border="1px solid white";
cstripimg.style.width="73px";
cstripimg.style.height="43px";
cstripimg.style.margin="2px 1px 2px 1px";
//cstripimg.style.left="10px";
//cstripimg.style.top="0px";
//cstripimg.style.position="relative";

cstripimg.setAttribute('src',c);
cstriplink.appendChild(cstripimg);
if(gofirst==true){
cstripdivbutton.insertBefore(cstriplink,cstripdivbutton.firstChild);

}else{
cstripdivbutton.appendChild(cstriplink);
}
}
}

function pixiebar(a){
var pixieplace = document.getElementById(a);
pixieplace.insertBefore(cstripdiv,pixieplace.firstChild);

}

function pixieheader(a){
pxselect.selectedIndex=0;
add_zoom(); //adds 'in partnership' piece
var pixieplace = document.getElementById(a);
pixieplace.insertBefore(pixiheaderdiv,pixieplace.firstChild);

}

function pixieheaderforum(){
pxselect.selectedIndex=0;

pixiheaderdiv.style.borderBottom="3px solid #F4982D";


var hlink=document.createElement('a');
hlink.setAttribute('href',"http://www.pixietrixcomix.com/forum/");
hlink.setAttribute('class','addhome');
hlink.setAttribute('onclick',"zoompix._link(\"http://www.pixietrixcomix.com/forum/\");return false;");

var pixihomeimg=document.createElement('img');

pixihomeimg.setAttribute('width','44');
pixihomeimg.setAttribute('height','30');
pixihomeimg.setAttribute('border','0');
pixihomeimg.style.width="44px";
pixihomeimg.style.height="30px";
pixihomeimg.style.left="0px";
pixihomeimg.style.top="0px";
pixihomeimg.style.position="absolute";//absolute for fixed position layouts
pixihomeimg.setAttribute('src','http://www.pixietrixcomix.com/images/pixieforumbar_forum_off.gif');
var pixihomeon=new Image();
pixihomeon.src="http://www.pixietrixcomix.com/images/pixieforumbar_forum_on.gif";
var pixihomeoff=new Image();
pixihomeoff.src="http://www.pixietrixcomix.com/images/pixieforumbar_forum_off.gif";
pixihomeimg.onmouseover=function (){this.src=pixihomeon.src;}
pixihomeimg.onmouseout=function (){this.src=pixihomeoff.src;}
hlink.appendChild(pixihomeimg);
pixiheaderdiv.appendChild(hlink);


pixilogoimg.setAttribute('width','83');
pixilogoimg.setAttribute('height','30');
pixilogoimg.setAttribute('border','0');
pixilogoimg.style.width="83px";
pixilogoimg.style.height="30px";
pixilogoimg.style.left="44px";
pixilogoimg.style.top="0px";
pixilogoimg.style.position="absolute";//absolute for fixed position layouts
pixilogoimg.setAttribute('src','http://www.pixietrixcomix.com/images/pixieforumbar_pixie_off.gif');
var pixilogoon=new Image();
pixilogoon.src="http://www.pixietrixcomix.com/images/pixieforumbar_pixie_on.gif";
var pixilogooff=new Image();
pixilogooff.src="http://www.pixietrixcomix.com/images/pixieforumbar_pixie_off.gif";
pixilogoimg.onmouseover=function (){this.src=pixilogoon.src;}
pixilogoimg.onmouseout=function (){this.src=pixilogooff.src;}


var zslink=document.createElement('a');
zslink.setAttribute('href',"http://www.zoomcomics.com/");
zslink.setAttribute('class','addzoom');
zslink.setAttribute('onclick',"zoompix._link(\"http://www.zoomcomics.com\");return false;");

var zsimg=document.createElement('img');
zsimg.setAttribute('src',"http://www.pixietrixcomix.com/images/pixieforumbar_zoom_off.gif");
zsimg.setAttribute('width','108');
zsimg.setAttribute('height','30');
zsimg.setAttribute('border','0');
zsimg.style.border="0px";
zsimg.style.width="108px";
zsimg.style.height="30px";
zsimg.style.margin="0px";
zsimg.style.left="128px";
zsimg.style.top="0px";
zsimg.style.position="absolute";
zslink.appendChild(zsimg);
pixiheaderdiv.appendChild(zslink);
var pixizoomon=new Image();
pixizoomon.src="http://www.pixietrixcomix.com/images/pixieforumbar_zoom_on.gif";
var pixizoomoff=new Image();
pixizoomoff.src="http://www.pixietrixcomix.com/images/pixieforumbar_zoom_off.gif";

zsimg.onmouseover=function (){this.src=pixizoomon.src;}
zsimg.onmouseout=function (){this.src=pixizoomoff.src;}



var aslink=document.createElement('a');
aslink.setAttribute('href',"http://www.gomanga.com/");
aslink.setAttribute('class','addseas');
aslink.setAttribute('onclick',"zoompix._link(\"http://www.gomanga.com\");return false;");

var asimg=document.createElement('img');
asimg.setAttribute('src',"http://www.pixietrixcomix.com/images/pixieforumbar_sevenseas_off.gif");
asimg.setAttribute('width','89');
asimg.setAttribute('height','30');
asimg.setAttribute('border','0');
asimg.style.border="0px";
asimg.style.width="89px";
asimg.style.height="30px";
asimg.style.margin="0px";
asimg.style.left="236px";
asimg.style.top="0px";
asimg.style.position="absolute";
aslink.appendChild(asimg);
pixiheaderdiv.appendChild(aslink);
var pixisson=new Image();
pixisson.src="http://www.pixietrixcomix.com/images/pixieforumbar_sevenseas_on.gif";
var pixissoff=new Image();
pixissoff.src="http://www.pixietrixcomix.com/images/pixieforumbar_sevenseas_off.gif";
asimg.onmouseover=function (){this.src=pixisson.src;}
asimg.onmouseout=function (){this.src=pixissoff.src;}


var ecb=document.createElement('img');
ecb.setAttribute('src',"http://www.pixietrixcomix.com/images/pixieforumbar_echiboo.gif");
ecb.setAttribute('width','50');
ecb.setAttribute('height','30');
ecb.setAttribute('border','0');
ecb.style.border="0px";
ecb.style.width="50px";
ecb.style.height="30px";
ecb.style.margin="0px";
ecb.style.right="220px";
ecb.style.top="-4px";
ecb.style.verticalAlign="top";
ecb.style.position="absolute";

pxform.appendChild(ecb);

pixiheaderdiv.style.position="relative";
document.body.style.paddingTop="0px";

document.body.insertBefore(pixiheaderdiv,document.body.firstChild);

}


function pixiedrop(a){
//dropdown only.
pxselect.selectedIndex=0;
var pixieplace = document.getElementById(a);
pixieplace.insertBefore(pxform,pixieplace.firstChild);
if(a=="shouribar"){skipshouri=true; }

}

function pixiebar(a){
var pixieplace = document.getElementById(a);
pixieplace.insertBefore(cstripdiv,pixieplace.firstChild);
}

function movefbar(){

cstripdivbutton.appendChild(cstripdivbutton.removeChild(cstripdivbutton.firstChild));
}
function moverbar(){

cstripdivbutton.insertBefore(cstripdivbutton.removeChild(cstripdivbutton.lastChild),cstripdivbutton.firstChild);
}

function latest_ECt(a){
var eclink=document.createElement('a');
eclink.setAttribute('href',"http://www.eeriecuties.com");
eclink.setAttribute('class','ec_t');
eclink.setAttribute('onclick',"zoompix._link(\"http://www.eeriecuties.com\");return false;");
var ecimg=document.createElement('img');
ecimg.setAttribute('src',"http://www.eeriecuties.com/images/latest_ec_Wb.png");
ecimg.setAttribute('title',"Latest Eerie Cuties");
ecimg.setAttribute('width','160');
ecimg.setAttribute('height','99');
ecimg.setAttribute('border','0');
ecimg.style.border="0px";
ecimg.style.width="160px";
ecimg.style.height="99px";
ecimg.style.margin="0px";
var pixieplace = document.getElementById(a);
eclink.appendChild(ecimg);
pixieplace.appendChild(eclink);

}
function latest_MCt(a){
var mclink=document.createElement('a');
mclink.setAttribute('href',"http://www.magickchicks.com");
mclink.setAttribute('class','mc_t');
mclink.setAttribute('onclick',"zoompix._link(\"http://www.magickchicks.com\");return false;");

var mcimg=document.createElement('img');
mcimg.setAttribute('src',"http://www.magickchicks.com/images/latest_mc_Tb.png");
mcimg.setAttribute('title',"Latest Magick Chicks");
mcimg.setAttribute('width','160');
mcimg.setAttribute('height','99');
mcimg.setAttribute('border','0');
mcimg.style.border="0px";
mcimg.style.width="160px";
mcimg.style.height="99px";
mcimg.style.margin="0px";
var pixieplace = document.getElementById(a);
mclink.appendChild(mcimg);
pixieplace.appendChild(mclink);

}

function add_seas(){
var aslink=document.createElement('a');
aslink.setAttribute('href',"http://www.gomanga.com/");
aslink.setAttribute('class','addseas');
aslink.setAttribute('onclick',"zoompix._link(\"http://www.gomanga.com\");return false;");

var asimg=document.createElement('img');
asimg.setAttribute('src',"http://www.paranormalmysterysquad.com/images/presents.gif");
asimg.setAttribute('title',"presents a Seven Seas Entertainment comic!");
asimg.setAttribute('width','357');
asimg.setAttribute('height','33');
asimg.setAttribute('border','0');
asimg.style.border="0px";
asimg.style.width="357px";
asimg.style.height="33px";
asimg.style.margin="0px";
asimg.style.left="186px";
asimg.style.top="0px";
asimg.style.position="absolute";
aslink.appendChild(asimg);
pixiheaderdiv.appendChild(aslink);

}
function add_zoom(){
var aslink=document.createElement('a');
aslink.setAttribute('href',"http://www.zoomcomics.com/");
aslink.setAttribute('class','addzoom');
aslink.setAttribute('onclick',"zoompix._link(\"http://www.zoomcomics.com\");return false;");

var asimg=document.createElement('img');
asimg.setAttribute('src',"http://www.pixietrixcomix.com/images/zoominpartnerbarlogo.png");
asimg.setAttribute('title',"in partnership with Zoom Comics");
asimg.setAttribute('width','255');
asimg.setAttribute('height','33');
asimg.setAttribute('border','0');
asimg.style.border="0px";
asimg.style.width="255px";
asimg.style.height="33px";
asimg.style.margin="0px";
asimg.style.left="186px";
asimg.style.top="0px";
asimg.style.position="absolute";
aslink.appendChild(asimg);
pixiheaderdiv.appendChild(aslink);

}



//NAME IN HEADER,LINK IN BAR/HEADER, BAR IMAGE,UPDATE DAYS

function buildbarheader(){
addpsite("More comics for you!","http://www.pixietrixcomix.com",undefined,0); //Must be Last (if IE9 works) or first if not.

addpsite("Amazing Agent Jennifer","http://www.amazingagentjennifer.com/","http://www.pixietrixcomix.com/images/AAJ_bar.png",U_MONDAY|U_WEDNESDAY|U_FRIDAY);
addpsite("Amazing Agent Luna","http://www.amazingagentluna.com/","http://www.pixietrixcomix.com/images/AAL_bar.png",U_MONDAY|U_TUESDAY|U_WEDNESDAY|U_THURSDAY|U_FRIDAY);
addpsite("Aoi House","http://www.aoihouse.net/","http://www.pixietrixcomix.com/images/AOI_bar.png",U_MONDAY|U_TUESDAY|U_WEDNESDAY|U_THURSDAY|U_FRIDAY);
addpsite("Dracula Everlasting","http://www.draculaeverlasting.com/","http://www.pixietrixcomix.com/images/DE_bar.png",U_MONDAY|U_WEDNESDAY|U_FRIDAY);
addpsite("Eerie Cuties","http://www.eeriecuties.com/","http://www.pixietrixcomix.com/images/EC_bar.png",U_MONDAY|U_WEDNESDAY);
addpsite("Fragile","http://www.fragilestory.com/","http://www.pixietrixcomix.com/images/FR_bar.png",U_TUESDAY|U_THURSDAY);
addpsite("Lizzie Newton","http://www.lizzienewton.com/","http://www.pixietrixcomix.com/images/LN_bar.png",U_MONDAY|U_WEDNESDAY|U_FRIDAY);
addpsite("Magick Chicks","http://www.magickchicks.com/","http://www.pixietrixcomix.com/images/MC_bar.png",U_TUESDAY|U_FRIDAY);
addpsite("Ma3 (Rated R)","http://www.menagea3.net/","http://www.pixietrixcomix.com/images/MA3_bar.png",U_TUESDAY|U_THURSDAY|U_SATURDAY);
addpsite("Paranormal Mystery Squad","http://www.paranormalmysterysquad.com/","http://www.pixietrixcomix.com/images/PMS_bar.png",U_MONDAY|U_WEDNESDAY|U_FRIDAY);
addpsite("Penny & Aggie","http://www.pennyandaggie.com/");
addpsite("School Bites","http://www.schoolbites.net/","http://www.pixietrixcomix.com/images/SB_bar.png",U_MONDAY|U_WEDNESDAY|U_FRIDAY);
addpsite("Springiette","http://www.springiette.net/","http://www.pixietrixcomix.com/images/SP_bar.png",U_WEDNESDAY|U_SUNDAY);
addpsite("Vampire Cheerleaders","http://www.vampirecheerleaders.net/","http://www.pixietrixcomix.com/images/VC_bar.png",U_MONDAY|U_WEDNESDAY|U_FRIDAY);
addpsite("Witch Hunter","http://www.witchhuntercomic.com/","http://www.pixietrixcomix.com/images/WH_bar.png",U_MONDAY|U_WEDNESDAY|U_FRIDAY);
addpsite("Cool Cat Studio (completed)","http://www.coolcatstudio.com/");

}
buildbarheader();
if(typeof _gaq=="undefined" || skipshouri==true){

}
else{
 _gaq.push(['zoompix._setAccount', 'UA-28944221-1']);
 _gaq.push(['zoompix._setDomainName', 'none']);
 _gaq.push(['zoompix._setAllowLinker', true]);

 _gaq.push(['zoompix._trackPageview']);
}


function miku(){

if(document.getElementById("wcr_div"))
{
var unfixprev=document.getElementById("wcr_btn-1");
unfixprev.setAttribute('onclick',"top.location.href=\""+unfixprev.title+"\"");
var unfixnext=document.getElementById("wcr_btn1");
unfixnext.setAttribute('onclick',"top.location.href=\""+unfixnext.title+"\"");

var pzmz=document.getElementById("wcr_imagenes");
pzmz.parentNode.removeChild(pzmz);

var pztz=document.getElementById("wcr_links_imgs");
pztz.parentNode.removeChild(pztz);
var pzry=document.getElementById("wcr_btnfit");
pzry.parentNode.removeChild(pzry);
var pzrz=document.getElementById("wcr_btnlayout");
pzrz.parentNode.removeChild(pzrz);
var pqry=document.getElementById("wcr_imagen");
pqry.id="c"+(Math.ceil(Math.random() * 256)-1)+"i";

var pqrz=document.getElementById("wcr_div");
pqrz.id="c"+(Math.ceil(Math.random() * 256)-1)+"";


}
}
window.addEventListener("load",miku,true);

var switchTo5x=true;
