﻿var goodToGo = false;


// PDF_g = new Image();
// PDF_g.src = "/images/common/pai_btn_takeonePDF_gray.gif";
// PDF_g_hi = new Image();
// PDF_g_hi.src = "/images/common/pai_btn_takeonePDF_gray_hi.gif";


dot_green = new Image();
dot_green.src = "/images/adoption_programs/SC_map_dot_green.gif";
dot_orange = new Image();
dot_orange.src = "/images/adoption_programs/SC_map_dot_orange.gif";



function showStep(num) {

	// alert('SHOWING: ' + num);

	oldMenu = "stepmenu" + window.lastStep;
	oldBox = "box" + window.lastStep;
		
	newMenu = "stepmenu" + num;
	newBox = "box" + num;
	
	// alert ("OFF: " + oldMenu + "\n\nON: " + newMenu) ;
	
	changeStyle(oldMenu,"off");
	changeStyle(oldBox,"hide");
	
	changeStyle(newMenu,"step_on");
	changeStyle(newBox,"stepsbox");
		
	window.lastStep = num;

}

function showStepHi(num, curnum) {

	// alert('SHOWING: ' + num);

	oldMenu = "stepmenu" + window.lastStep;		
	newMenu = "stepmenu" + num;
	
	// alert ("OFF: " + oldMenu + "\n\nON: " + newMenu) ;
	
	if (oldMenu != ("stepmenu" + curnum)) changeStyle(oldMenu,"off");	
	changeStyle(newMenu,"step_on");
		
	window.lastStep = num;

}



function toggleQ(num) {
	qid = "q" + num;
	theStyle = getStyle(qid);
	
	if (theStyle == "qclosed")  changeStyle(qid, 'qopen');
	else if (theStyle == "qopen")  changeStyle(qid, 'qclosed');
}

function toggle(theID) {
	theStyle = getStyle(theID);
	
	if (theStyle == "show_me")  changeStyle(theID, 'hide_me');
	else if (theStyle == "hide_me")  changeStyle(theID, 'show_me');
}

function openAll(num) {
	for (x=1;x<=num;x=x+1) 
	{
		qid = 'q' + x;
		changeStyle(qid, 'qopen');
	}
}

function closeAll(num) {
	for (x=1;x<=num;x=x+1) 
	{
		qid = 'q' + x;
		changeStyle(qid, 'qclosed');
	}
}




// STYLE CHANGING
function changeStyle(id, newClass) {
	identity=document.getElementById(id);	
	if (identity) identity.className=newClass;	
}	

function getStyle(id) {
	identity=document.getElementById(id);	
	return identity.className;	
}


// IMAGE ROLLOVER FUNCTION 

function flash(img1, img2) {
	alert(img1 + " to " + img2);
	alert(document.images[img1].src);
	if (document.images) eval('document.images[img1].src = '+img2+'.src');
	
}


// PRINT PAGE
function printpage() {
	window.print();  
}



// CSS COMPLIANT EXTERNAL LINK FUNCTION (OPEN NEW POP-UP) 

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   anchor.hideFocus = true;
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
 }
}




// POP UP WINDOW
function popIt(url,name,height,width,resize,scrolling) {
	// alert("Pop Recipe: " + url);
	
	features = "menubar=0, tollbar=0, scrollbars=" + scrolling + ", resizable=" + resize + ", width=" + width + ", height=" + height + ",dependent=yes";
	
	if (window.thePopper && !window.thePopper.closed) {
		
		thePopper.resizeTo(width,height);
		thePopper.innerwidth=width;
		thePopper.height=height;
		thePopper.location.href = url;
		thePopper.focus();
		
	} else {

		var winl = Math.floor((screen.width - width) / 2);
		var wint = Math.floor((screen.height - height) / 2);
					
		thePopper = window.open(url,name,'top='+wint+',left='+winl+','+features);
		thePopper.innerwidth=width;
		thePopper.height=height;
	
	}
	 
}


		
function SCinit() {
	externalLinks();
	// changeStyle('conash3D0','GDhide');
	// startList;
}



window.onload=SCinit;

//$(document).ready(function(){
//$('li#liSECc ul').css({'background-color':'blue'});
//});


