/***********************************************************************************************
 * fcFunctions - 8/2005 - Functions for the flaggercentral website - FlaggerBoy
 ***********************************************************************************************/
 
//var currentpage=1;


function fcLoadPage(head,nav,bod,htext,hback) {
	parent.thumbs.location=nav;
	parent.pics.location=bod;
	
	var flashFile = eval("parent.head.document.all.header");
	flashFile.SetVariable("headertext", htext);
	flashFile.SetVariable("headerbk", hback);
	flashFile.GotoFrame (head+4);
}

function fcLoad(head,nav,bod)
{
	parent.thumbs.location=nav;
	parent.pics.location=bod;
	if (head>0) {
		var flashFile = eval("parent.head.document.all.header");
		flashFile.GotoFrame (head+4);
	}
	//parent.head.thisMovie(movieName).GotoFrame (head+4);
}

function fcLoadHead(head,htext,hback) {
	var flashFile = eval("parent.head.document.all.header");
	flashFile.SetVariable("headertext", htext);
	flashFile.SetVariable("headerbk", hback);
	flashFile.GotoFrame (head+4);
}

var movieName = "header";

// IE and Netscape refer to the movie object differently.
// This function returns the appropriate syntax depending on the browser.
function thisMovie(movieName) {
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName];
  } else {
    return document[movieName];
  }
}
// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
  // First make sure the movie's defined.
  if (typeof(theMovie) != "undefined") {
    // If it is, check how much of it is loaded.
    return theMovie.PercentLoaded() == 100;
  } else {
    // If the movie isn't defined, it's not loaded.
    return false;
  }
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

// Display the rating popup window
// Allows item rating, item commenting, and adding items to my favorites
function rateit(posttype,itemid,itemtext) {
   window.open('popup_rating.php?i1='+posttype+'&i2='+itemid+'&i3='+itemtext, '', 'width=345,height=350,top=50,left=50,scrollbars=NO,resizable=YES')
}

// -----------------------
// Copy text from a <div> tag into the clipboard. 
// -----------------------
var fromFieldOriginalColor;
var fromFieldOriginalField;

function CopyToClipboard(fromField) {
	
    Copied = fromField.createTextRange();
    Copied.execCommand("RemoveFormat");
    Copied.execCommand("Copy");
	
	fromFieldOriginalColor = fromField.style.color;
	fromFieldOriginalField = fromField;
	
	fromField.style.color = '#df0000';
	//fromField.style.fontWeight  = 'bold';
	fromFieldOriginalField = fromField;
	setTimeout('CopyToResetFieldColor()', 100);
}
// -----------------------
// Return the copied text field to its original color 
// -----------------------
function CopyToResetFieldColor() {
	if (fromFieldOriginalField.style.color == '#df0000') {
		fromFieldOriginalField.style.color = '#FFFF00';
		setTimeout('CopyToResetFieldColor()', 100);
	} else {
		fromFieldOriginalField.style.color = fromFieldOriginalColor;
		//fromFieldOriginalField.style.fontWeight  = 'normal';
	}
}