function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


//special Workshop reg
var butId = "blank";

function showReg(containerId, buttonId){
    showMe(containerId);   
    if (butId != "blank") showContainer(butId); 
    hideMe(buttonId);
    butId= buttonId;   
}

//popUp div start

var amID = "blank";

function showMe(containerId){

	if(amID != "blank"){

		hideMe(amID);
		
	}

	amID = containerId;

	showContainer(containerId);

}

function showContainer(containerId){
	
	obj = MM_findObj(containerId);

	if (!obj) return;

	obj.style.display = 'block';
}

function hideMe(containerId){
	
	obj2 = MM_findObj(containerId)

	if (!obj2) return;

	obj2.style.display = 'none';

}

//popUp div end


//home page fady start

var myID = "blank";

function fadeHomeSwapOut() {
		var speed = Math.round(5000 / 100); 
	opacity1('homeMudAnts', 100, 0, 5000,speed);
	setTimeout("opacity('homeBubbleCats', 0, 100, 5000," + speed + ")",1000);
	setTimeout("opacity1('homeBubbleCats', 100, 0, 5000," + speed + ")",6000);
	setTimeout("opacity('homePumpkinWorld', 0, 100, 5000," + speed + ")",7000);
	setTimeout("opacity1('homePumpkinWorld', 100, 0, 5000," + speed + ")",12000);
	setTimeout("opacity('homeZingerPinger', 0, 100, 5000," + speed + ")",13000);
	setTimeout("opacity1('homeZingerPinger', 100, 0, 5000," + speed + ")",18000);
	setTimeout("opacity('homeShellChildren', 0, 100, 5000," + speed + ")",19000);
	setTimeout("opacity1('homeShellChildren', 100, 0, 5000," + speed + ")",24000);
	setTimeout("opacity('homeFurkleStroyWilliams', 0, 100, 5000," + speed + ")",25000);
	setTimeout("opacity1('homeFurkleStroyWilliams', 100, 0, 5000," + speed + ")",30000);
	setTimeout("opacity('homeMudAnts', 0, 100, 5000," + speed + ")",31000);
	setTimeout("fadeHomeSwapOut2()",36000);

}

function fadeHomeSwapOut2() {
		var speed = Math.round(5000 / 100); 
	opacity1('homeMudAnts', 100, 0, 5000,speed);
	setTimeout("opacity('homeBubbleCats', 0, 100, 5000," + speed + ")",1000);
	setTimeout("opacity1('homeBubbleCats', 100, 0, 5000," + speed + ")",6000);
	setTimeout("opacity('homePumpkinWorld', 0, 100, 5000," + speed + ")",7000);
	setTimeout("opacity1('homePumpkinWorld', 100, 0, 5000," + speed + ")",12000);
	setTimeout("opacity('homeZingerPinger', 0, 100, 5000," + speed + ")",13000);
	setTimeout("opacity1('homeZingerPinger', 100, 0, 5000," + speed + ")",18000);
	setTimeout("opacity('homeShellChildren', 0, 100, 5000," + speed + ")",19000);
	setTimeout("opacity1('homeShellChildren', 100, 0, 5000," + speed + ")",24000);
	setTimeout("opacity('homeFurkleStroyWilliams', 0, 100, 5000," + speed + ")",25000);
	setTimeout("opacity1('homeFurkleStroyWilliams', 100, 0, 5000," + speed + ")",30000);
	setTimeout("opacity('homeMudAnts', 0, 100, 5000," + speed + ")",31000);
	setTimeout("fadeHomeSwapOut()",36000);

}

function fadeHomeSwapOutText() {
		var speed = Math.round(5000 / 300); 
	opacity1('homeMudAntsText', 100, 0, 5000,speed);
	setTimeout("opacity('homeBubbleCatsText', 0, 100, 5000," + speed + ")",2000);
	setTimeout("opacity1('homeBubbleCatsText', 100, 0, 5000," + speed + ")",7000);
	setTimeout("opacity('homePumpkinWorldText', 0, 100, 5000," + speed + ")",9000);
	setTimeout("opacity1('homePumpkinWorldText', 100, 0, 5000," + speed + ")",13000);
	setTimeout("opacity('homeZingerPingerText', 0, 100, 5000," + speed + ")",15000);
	setTimeout("opacity1('homeZingerPingerText', 100, 0, 5000," + speed + ")",19000);
	setTimeout("opacity('homeShellChildrenText', 0, 100, 5000," + speed + ")",21000);
	setTimeout("opacity1('homeShellChildrenText', 100, 0, 5000," + speed + ")",25000);
	setTimeout("opacity('homeFurkleStroyWilliamsText', 0, 100, 5000," + speed + ")",27000);
	setTimeout("opacity1('homeFurkleStroyWilliamsText', 100, 0, 5000," + speed + ")",31000);
	setTimeout("opacity('homeMudAntsText', 0, 100, 5000," + speed + ")",33000);
	setTimeout("fadeHomeSwapOut2Text()",37000);

}

function fadeHomeSwapOut2Text() {
	var speed = Math.round(5000 / 300); 
	opacity1('homeMudAntsText', 100, 0, 5000,speed);
	setTimeout("opacity('homeBubbleCatsText', 0, 100, 5000," + speed + ")",2000);
	setTimeout("opacity1('homeBubbleCatsText', 100, 0, 5000," + speed + ")",7000);
	setTimeout("opacity('homePumpkinWorldText', 0, 100, 5000," + speed + ")",9000);
	setTimeout("opacity1('homePumpkinWorldText', 100, 0, 5000," + speed + ")",13000);
	setTimeout("opacity('homeZingerPingerText', 0, 100, 5000," + speed + ")",15000);
	setTimeout("opacity1('homeZingerPingerText', 100, 0, 5000," + speed + ")",19000); 
	setTimeout("opacity('homeShellChildrenText', 0, 100, 5000," + speed + ")",21000);
	setTimeout("opacity1('homeShellChildrenText', 100, 0, 5000," + speed + ")",25000);
	setTimeout("opacity('homeFurkleStroyWilliamsText', 0, 100, 5000," + speed + ")",27000);
	setTimeout("opacity1('homeFurkleStroyWilliamsText', 100, 0, 5000," + speed + ")",31000);
	setTimeout("opacity('homeMudAntsText', 0, 100, 5000," + speed + ")",33000);
	setTimeout("fadeHomeSwapOutText()",37000);

}

function opacity(myId, opacStart, opacEnd, millisec, speed) { 
	
	obj = MM_findObj(myId);
	obj.style.display = 'block';
	obj.style.opacity = 0;
    obj.style.MozOpacity = 0;
    obj.style.KhtmlOpacity = 0;
    obj.style.filter = "alpha(opacity=" + 0 + ")";
	
    //speed for each frame 
    
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens 
    /*if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + myId + "')",(timer * speed)); 
            timer++; 
        } 
    } else */if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + myId + "')",(timer * speed)); 
            timer++; 
        } 
    }

} 

function opacity1(myId, opacStart, opacEnd, millisec, speed) { 
	
	obj = MM_findObj(myId);
	obj.style.display = 'block';
	obj.style.opacity = 100;
    obj.style.MozOpacity = 100;
    obj.style.KhtmlOpacity = 100;
    obj.style.filter = "alpha(opacity=" + 100 + ")";
	
    //speed for each frame 
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + myId + "')",(timer * speed)); 
            timer++; 
        } 
    } /*else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + myId + "')",(timer * speed)); 
            timer++; 
        } 
    }*/

} 

//change the opacity for different browsers 
function changeOpac(opacity, myId) { 
    var object = document.getElementById(myId).style; 
    object.opacity = (opacity / 100); //for newer Mozilla
    object.MozOpacity = (opacity / 100); //for older Mozilla
    object.KhtmlOpacity = (opacity / 100); //for Konquerer on Linux and Safari on Mac
    object.filter = "alpha(opacity=" + opacity + ")"; //for IE
}

//home page fady end

// print jobby start

var myPrintId = "blank";

function printMe(myTextId, myDivId){
	
	txt = MM_findObj(myTextId);
	
	div = MM_findObj(myDivId);
	
	var replacedString = txt.value;
	var matchIndex = txt.value.indexOf( "\n" );
	while (matchIndex != -1) {
        replacedString = replacedString.replace( "\n", "<br/>" )
        matchIndex = replacedString.indexOf( "\n" );
    }
	div.innerHTML = replacedString;
	
	//this is where i call the print style sheet
	/*setActiveStyleSheet('normal', 'printDiv');
	
	//this is where i print
	window.print();
	
	//this is where i change the style sheet back
	setActiveStyleSheet('printDiv', 'normal');	*/
	
	setActiveStyleSheet('normal', 'printDiv');
	setTimeout("doPrint()", 1000);
}

function doPrint() {
	window.print();
	setTimeout("printPageReset()", 1000);
}

function printPageReset() {
	setActiveStyleSheet('printDiv', 'normal');
}

function setActiveStyleSheet(off, on) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title") == off) {
       a.disabled = true;
	 }
	 if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title") == on) {
       a.disabled = false;
	 }       
   }
}

// print jobby end