// Popup wizard
/****************************************************
	AUTHOR: WWW.CGISCRIPT.NET, LLC
	URL: http://www.cgiscript.net
	Use the code for FREE but leave this message intact.
	Download your FREE CGI/Perl Scripts today!
	( http://www.cgiscript.net/scripts.htm )
****************************************************/
var win=null;
function showEventPopup(){
NewWindow("eventpopup/default.aspx", "eventpopup", 400, 350, "center", "front");
}
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=0}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";win=window.open(mypage,myname,settings);
win.focus();}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		header_contact_over = newImage("images/ter_contactus-over.gif");
		header_login_over = newImage("images/ter_customerlogin-over.gif");
		demo_button_over = newImage("images/demo_button-over.gif");
		footer_calcroi_over = newImage("images/footer_calcroi-over.gif");
		footer_viewdemo_over = newImage("images/footer_viewdemo-over.gif");
		footer_getinfo_over = newImage("images/footer_getinfo-over.gif");
		footer_searchbutton_over = newImage("images/footer_searchbutton-over.gif");
		preloadFlag = true;
	}
}



// Print functions

var dir;
var printHtml;
var otherHtml;
var normalHtml;

function setupvars()
{
	printHtml = '<p><br><br><a href="javascript:normalView();">Go back to Normal View<\/a></p>';
	//<a href="" class="small"><img src="' + dir + 'images/global/email.gif">Email To Friend</a>
	otherHtml = ' <a href="javascript:window.external.AddFavorite(location.href,document.title)"><img src="' + dir + 'images/global/favorite.gif">Add to Favorites</a>';
	normalHtml = '<p><br><br><br><a href="javascript:printerFriendlyView();"><img src="' + dir + 'images/global/print.gif">Print View<\/a>' + otherHtml + '<br></p>';
}

function setdir(newdir)
{
	dir = newdir;
}

function printerFriendlyView()
{
     defaultSheet = document.getElementById('default'); 
     defaultSheet.disabled = true; 

     newSheet = document.getElementById('print'); 
     newSheet.disabled = false;

	display("printpagespan", printHtml);
}

function normalView()
{
     defaultSheet = document.getElementById('default'); 
     defaultSheet.disabled = false; 

     newSheet = document.getElementById('print'); 
     newSheet.disabled = true; 

	display("printpagespan", normalHtml);
}

function printerButtons(indir)
{
	setdir(indir);
	setupvars();
	normalView();
}

function display(id, str) {
	document.getElementById(id).innerhtml = str;
}

