/**
 * Embed Functions that include the show/hide link for Main and Archive Pages
 * 
 */
function embedCf(objectEmbed, i) {
    document.write('<style>.boardhidden {display:none}; .boardshown {display:inline}</style>');
    document.write('<span class="boardshown" id="toggle' + i + '">' );
    document.write('<a href="javascript:showboards(\'' + i + '\')" title="Show ChessFlash Game Viewer">');
    document.write('<img src="http://chessflash.com/releases/latest/opensmall.gif" width="16" height="16">(show chess board)'  + '</a></span>');
    document.write('<span class="boardhidden" id="board' + i + '">');
    document.write('<a href="javascript:hideboards(\'' + i + '\')"  title="Hide ChessFlash Game Viewer">');
    document.write('<img src="http://chessflash.com/releases/latest/closesmall.gif" width="16" height="16">(hide chess board)'  + '</a><br>');
    document.write(objectEmbed + '</span>');
}
	
function embedCfShowHideCss(i, width, height, flashvars) {
    var objectEmbed = embedTextCfInlineCss(width, height, 'autoplay=true&' + flashvars);
    embedCf(objectEmbed, i);
}

function embedCfShowHideCssOver(i, width, height, flashvars, overdark, overbackground) {
    var objectEmbed = embedTextCfInlineCssOver(width, height, 'autoplay=true&' + flashvars, overdark, overbackground);
    embedCf(objectEmbed, i);
}

function embedCfBasic(i, width, height, flashvars, overdark, overbackground) {
    embedCfShowHideCssOver(i, width, height, flashvars, overdark, overbackground)
}

function embedCfAdvanced(i, width, height, flashvars, overdark, overbackground) {
    embedCfShowHideCssOver(i, width, height, flashvars, overdark, overbackground)
}
/**
function embedCfShowHide(i, width, height, flashvars) {
    var objectEmbed = embedTextCfInline(width, height, 'autoplay=true&' + flashvars);
    embedCf(objectEmbed, i);
}
**/
function showboards(postid) { 
  whichpost = document.getElementById('board' + postid); 
  whichpost.className="boardshown";
  whichpost = document.getElementById('toggle' + postid); 
  whichpost.className="boardhidden";
}
 
function hideboards(postid) { 
  whichpost = document.getElementById('toggle' + postid); 
  whichpost.className="boardshown";
  whichpost = document.getElementById('board' + postid); 
  whichpost.className="boardhidden";
}