﻿var goodToGo = false;


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);	
	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 GCinit() {
	externalLinks();
	// changeStyle('conash3D0','GDhide');
	// startList;
}



window.onload=GCinit;

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



