// JavaScript Function for FB Displays & Designs, Inc. Website //
// Version 1.1 08/10/04 //



// Optimize Window Function
	function optimizeWin() {
		window.open('includes/optimize.htm','optWin','scrollbars=no,statusbar=no,location=no,directories=no,menubar=no,resizable=no,width=355,height=135,dependent=yes,left=0,top=0')
	}

// B2B Wrap Up Function 
	function b2bWin() {
			window.open('includes/B2BWrapUp.asp','b2bWin','scrollbars=yes,statusbar=no,location=no,directories=no,menubar=no,resizable=no,width=405,height=605,dependent=yes,left=0,top=0')
	}

// Random Tip Generator 
	function tipWin() {
			window.open('includes/tips.asp','tipWin','scrollbars=yes,statusbar=no,location=no,directories=no,menubar=no,resizable=no,width=615,height=250,dependent=yes,left=100,top=100')
	}
	
// Nomadic Library 
	function libWin() {
			window.open('http://fbdisplays.ndlibraries.com','libWin','scrollbars=yes,statusbar=no,location=no,directories=no,menubar=no,resizable=no,width=805,height=600,dependent=yes,left=100,top=100')
	}

// Home Page Image Swap FUnctions
	function imgswap(name, option, type) {
		eval("document." + name + ".src = 'img/home/link" + option + "_" + type + ".jpg'");
	}
	
// Status Bar Text
	function message() {
		window.status = "FB Displays & Designs, Inc.: The Leader in Portable & Modular Trade Show Exhibits & Custom Displays" }
	
// Toggle Menu Functions
	function toggleMenu(currMenu) {
		if (document.all) {
			thisMenu = eval("document.all." + currMenu + ".style")
		if (thisMenu.display == "block") {
			thisMenu.display = "none" }
		else {
			thisMenu.display = "block" }
		return false }
		else {
			return true } 	}


// Reload Page for Special.ASP
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
	MM_reloadPage(true);

//  Find the New Object on Special.ASP
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;
}

// Show/Hide Layers on Special.ASP
function MM_showHideLayers() { //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
		for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	    obj.visibility=v; }
}

// Jump Menu
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
}

// Recently Completed Pop Up
	PositionX = 100;
	PositionY = 100;

	defaultWidth  = 550;
	defaultHeight = 510;

	var AutoClose = true;

	// ================================
	if (parseInt(navigator.appVersion.charAt(0))>=4){
		var isNN=(navigator.appName=="Netscape")?1:0;
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
		var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
		var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
				function popImage(imageURL,imageTitle){
					if (isNN){imgWin=window.open('about:blank','',optNN);}
					if (isIE){imgWin=window.open('about:blank','',optIE);}
						with (imgWin.document){
							writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
							writeln('var isNN,isIE;');
							writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
							writeln('isNN=(navigator.appName=="Netscape")?1:0;');
							writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
							writeln('function reSizeToImage(){');
							writeln('if (isIE){');
							writeln('window.resizeTo(100,100);');
							writeln('width=350-(document.body.clientWidth-document.images[0].width);');
							writeln('height=250-(document.body.clientHeight-document.images[0].height);');
							writeln('window.resizeTo(width,height);}');
							writeln('if (isNN){');       
							writeln('window.innerWidth=document.images["George"].width;');
							writeln('window.innerHeight=document.images["George"].height;}}');
							writeln('function doTitle(){document.title="'+imageTitle+'";}');
							writeln('</sc'+'ript>');
					if (!AutoClose) writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
						else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
							writeln('<center><img name="George" src='+imageURL+' style="display:block"></center></body></html>');
			close();
	}}