//______ADD A MENU ITEM_______________________________
//Add a new link to the menu here by adding a new line of the form 	['filename.file ext','css class name','display name'],
//Insert it where you would like to see it displayed.
var menu_item = new Array();
menu_item= [
			['http://www.freecardirectory.com/index.html','Home', 'topmenu'],
			['http://www.freecardirectory.com/order.html','&nbsp;', 'topmenu2'],
			['http://www.freecardirectory.net/index.php','FAQ', 'topmenu'], 
			['http://www.freecardirectory.net/member_login.php','Member Login', 'topmenu']
			];

      
      
//______ADD A WHATS NEW ITEM_______________________________
var new_item = new Array();

new_item=	[
			['image-files/moneyrain.jpg','210','150', 'link-list2','','For a limited time !!','Check out this great deal for the month of February']
			];

var image_name = new Array();
var preloadedimages = new Array();

image_name[0]="image-files/join_now_buttonr.jpg";
image_name[1]="image-files/joinnowactive.gif";

preloadedimages[0]=new Image();
preloadedimages[0].src=image_name[0];
preloadedimages[1]=new Image();
preloadedimages[1].src=image_name[1];

      
      
      
      
      
if (document.getElementById){ 
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); 
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}


//______LEFT CONTENT MANAGER__________________________
//Use this script to edit and generate content for the left sidebar

var start_printer_hide = '<div class="printer-hide">';//This prevents the menu from being shown during printing
var end_printer_hide= '</div>';
var menu_header = '<div class="nav-header">Menu</div>';
var start_menu = '<div id="menu">';
var end_menu= '</div>';

var whats_new_header= '<div class="nav-header">Partners</div>';

function mailpage()
{
		mail_str = "mailto:?subject=Check out the " + document.title;
		mail_str += "&body=I thought you might be interested in " + document.title;
		mail_str += ". You can view it at, " + location.href; 
		location.href = mail_str;
}

function addBookmark() 
{ 
			var msg = "Don't forget to bookmark us!";
			if(navigator.appName == "Netscape") {
			msg += "  (CTRL-D)";
			alert(msg);
			}

			if( window.sidebar && window.sidebar.addPanel ) {
					window.sidebar.addPanel( this.title, this.href, '' );
			} else if( window.external && ( navigator.platform == 'Win32' ||
				  ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) ) {
					window.external.AddFavorite( location.href, document.title );
			} else if( window.opera && window.print ) {
				return true;
			} else if( document.layers ) {
				window.alert( 'Please click OK then press Ctrl+D to create a bookmark' );
			} else {
				window.alert( 'Please use your browser\'s bookmarking facility to create a bookmark' );
			}
			return false;
}




function write_menu(activeLink)
{
  var content = "";
  var i=0;
  var snum = 1;
  
  content += '<table summary="" cellspacing="0" cellpadding="0" ><tr>';
  do
  {
    if (activeLink == menu_item[i][1])
    {
        content += '<td width="96"><a class="no_underline" href="'+ menu_item[i][0]+'" ><div style="width:96px; height:20px"><div class="'+menu_item[i][2]+'active" >'+menu_item[i][1]+'</div></div></a></td><td width="5"><img src="image-files/pixel_trans.gif" width="5" alt=""></td>';
    }
    else
    {
        content += '<td width="96"><a class="no_underline" href="'+ menu_item[i][0]+'" ><div style="width:96px; height:20px"><div class="'+menu_item[i][2]+'" onmouseover="this.className=\''+menu_item[i][2]+'active\';" onmouseout="this.className=\''+menu_item[i][2]+'\';">'+menu_item[i][1]+'</div></div></a></td><td width="5"><img src="image-files/pixel_trans.gif" width="5" alt=""></td>';
    }
    
  } while (++i < menu_item.length);
  
  content += '</tr></table>';
  document.write( content ) ;
}


function write_specials()
{
  var content = start_printer_hide ;
  var i=0;
  do{
        content +='<div class="right-deals" >';  
  			content+='<a target="blank"  class="';
  			content+=new_item[i][3];//add css class
  			content+='" href="';
  			content+=new_item[i][4];//add file name
  			content+='">';
  			content+='<img style="border:1px solid #cccccc; padding:0px; margin:0px;" hspace="0" vspace="0" src="';
  			content+=new_item[i][0];//add image
  			content+='" height="';
  			content+=new_item[i][1];//add image height
  			content+='" width="';
  			content+=new_item[i][2];//add image width
  			content+='"><br>';
  			content+=new_item[i][5];//add display name (title of page)
  			content+='</a><br>';
  			content+=new_item[i][6];//add excerpt
  			content+=' ...<a target="blank" href="';
  			content+=new_item[i][4];//add file name
  			content+='"><i>more</i></a></div>';
  }while (++i < new_item.length);
  
  
  content += end_menu;
  content += '<br><br>' + end_printer_hide;
  document.write( content ) ;
}

function write_console()
{
  var content = start_printer_hide ;

    content += '<div id="console"><div style="border:1px solid #666666; padding: 10px 5px;">';
    content += '<a href="" class="tool" onclick="window.print();"><img src="image-files/print.gif" height=16 width=16 alt="Printer Friendly Version"  style="margin:2px" align="middle">&nbsp&nbsp;Print Page</a></br>';
    content += '<a href="javascript:mailpage();" class="tool"><img height=16 width=16 src="image-files/mail.gif" alt="Tell A Friend" style="margin:2px" align="middle">&nbsp&nbsp;Tell A Friend</a></br>';
    content += '<a href="http://www.freecardirectory.com/index.html" class="tool" title="www.freecardirectory.com" rel="sidebar" onclick="addBookmark();"><img height=16 width=16 src="image-files/favs.gif" alt="Add to Favorites" style="margin:2px" align="middle">&nbsp&nbsp;Add to Favorites</a>';
    content += '</div></div>';		
  
  
  content += '' + end_printer_hide;
  document.write( content ) ;
}



function rnd() {
  today=new Date();
  seed=today.getTime();
  seed = (seed*9301+49297) % 233280;
  return seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};


  
function write_header_image()
{
  var nm = rand(header_image.length);
  content = '<img src="'+header_image[nm-1]+'" alt="">';
  document.write(content);
  
}



