var msg1= "home page";
var msg2= "font list";
var msg3= "info and faqs";
var msg4= "more about this font";
var msg5= "next font";
var msg6= "previous font";
var msg7= "purchase font";
var msg8= "download font";
var msg9= "home page";
var msg10= "font list";
var msg11= "font info";
var msg12= "font faqs";
var msg13= "font usage tips";
var msg14="order from kagi.com";
var msg15="purchase with paypal";
var msg16="the latest releases"

var bl="";
var sw = screen.width;
var sh = screen.height;

var max=3;


function MakeImageArray(n) 
            {
                if (document.images)
                    {
                    this.length = n
                    for (var i=1; i<=n; i++) 
                      	{
                      	this[i] = new Image()
                     	}
                    	return this
                	}
            }
            
            
function PreLoadImages()
            {
            if(document.images)
                    {
                    off = new MakeImageArray(17);
                    over = new MakeImageArray(17);
                    on = new MakeImageArray(17);
                    
                    for (var i=1;i<=16;i++)
                            {
                            on[i].src = "images/nav"+i+"a.gif";
                            over[i].src = "images/nav"+i+"b.gif";
                            off[i].src = "images/nav"+i+"c.gif";
                            }
                    } 
                    newoff=new Image();
                    newover=new Image();
                    newoff.src="images/ntmoff8.gif";
                    newover.src="images/ntmover8.gif";       
                     
             }      


function mover(num) 
            {
                if (document.images) 
                   		{
                   		document.images['navb'+num].src = over[num].src;
                   		}
            }
            

function mout(num) 
            {
                if (document.images)  
                    {
                  	document.images['navb'+num].src = on[num].src;
                    }                
               }
               
               
function hpover() 
            {
                if (document.images) 
                   		{
                   		document.images['ntm'].src = newover.src;
                   		}
            }
            

function hpout() 
            {
                if (document.images)  
                    {
                  	document.images['ntm'].src = newoff.src;
                    }                
               }
	        
	        
         


	

function openWindow(f)
				{
				var w = window.open(f,"","toolbar=no,width=400,height=500,screenX=100,screenY=50,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,history=no");
				w.window.focus();
				} 
				
				
		var sw = screen.width;
		var sh = screen.height;

	if (sw >= 800)
			{
			var x = ((sw-420)/2)-5;
			var y = ((sh-400)/2)-25;
			}
	else
			{
			var x = 0;
			var y = 0;
			}
			
			
			
function download(f)
		{
		
		var w = window.open("http://www.minifonts.com/cgi-bin/nenterdetails.pl?FONT="+f,"","toolbar=no,width=420,height=410,screenX="+x+",screenY="+y+",directories=no,status=no,scrollbars=no,resize=no,menubar=no,history=no");
		w.moveTo(x,y);
		w.window.focus();
		
		} 
		

	

function docheck(form)
	{
	
	username=document.theform["THENAME"].value;
	passwd=document.theform["PASSWORD"].value;
	email=document.theform["FROM"].value;
	pwlen=document.theform["FONTSIZE"].value;
	
	err=null;
	
	if(passwd.length!=pwlen)
		{
		err="registration code";
		}
		
if(passwd.charCodeAt(4)!=3+pwlen*3)
		{
		err="registration code";
		}
if(passwd.charCodeAt(9)!=(4*pwlen)-11)
		{
		err="registration code";
		}
		
	if(email.indexOf("@")<1)
		{
		err="email address";
		}
		
	if(email.indexOf(".")<1)
		{
		err="email address";
		}
	
	if(username.length<2)
		{
		err="name";
		}
		
		
	if(err==null)
		{
		//form.FONT.value=fontNum;
		return true;
		}
	else
		{
		alert("Sorry, your "+err+" is invalid! Please make sure it is typed EXACTLY as sent to you."); 
		return false;
		}
	}
	
				

	
	
	
function change(form, menuNum)
	{
	var font = "0";
	var myindex=form['f'+menuNum].selectedIndex;
	var optionVals = form['f'+menuNum].options[myindex].value.split(",");
	var font =  optionVals[0];
	var fontstp = font.replace(/%20/g," ");
	var license = optionVals[1];
	var licensestp = license.replace(/%20/g," ");
	var price = optionVals[2];
	var itemNum = optionVals[3];
	if(font != "0")
		{
		if(window.confirm("Add "+fontstp+" "+licensestp+" to cart?\n[$"+price+"]"))
			{
			submitIt(font,price,itemNum);
			}
		}
	}
	
	
function submitIt(n,p,i)
		{
		window.open('https://www.paypal.com/cart/add=1&business=paypal%40minifonts.com&item_name='+n+'&item_number='+i+'&amount='+p,'cartwin','width=600,height=400,scrollbars,location,resizable,status');
		}
		


function ssdownload(f)
			{
		
		var w = window.open("validatess.html",f,"toolbar=no,width=450,height=450,screenX="+x+",screenY="+y+",directories=no,status=no,scrollbars=no,resize=no,menubar=no,history=no");
w.moveTo(x,y);
w.window.focus();
			} 
			

function basedownload(f)
			{
		
		var w = window.open("validatebase.html",f,"toolbar=no,width=450,height=450,screenX="+x+",screenY="+y+",directories=no,status=no,scrollbars=no,resize=no,menubar=no,history=no");
w.moveTo(x,y);
w.window.focus();
			} 
			
			
function printStatus()
	{
	//nothing
	}   


function convert(f)
				{
				var w = window.open("http://www.minifonts.com/cgi-bin/curex.pl?amt="+f,"","toolbar=no,width=550,height=420,screenX="+x+",screenY="+y+",directories=no,status=no,scrollbars=yes,resize=no,menubar=no,history=no");
				w.moveTo(x,y);
				w.window.focus();
				} 
				
				
function playFlash(f)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="468" height="60"><param name="movie" value="flash/'+f+'"><param name="quality" value="high"><embed src="flash/'+f+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"></embed></object>');
}			