/* <![CDATA[ */
function myObj(obj) {
	if (document.all) return document.all(obj);
	if (document.getElementById) return document.getElementById(obj);
	return document.layers[obj];
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImg() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImg.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showHideBACKUP() { //v6.0
  var i,p,v,obj,args=showHide.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')?'block':(v=='hide')?'none':v;
		}
		obj.display=v;
	}
  }
  //hide other menus
	if (args[2]=='show') {
	  for (i=1;i<=5;i++) {
		lname = "Layer"+i;
		if ((obj=MM_findObj(lname))!=null && args[0]!=lname) { 
			obj.display='none';
		}
	  }
	}
}
function showHide() { //v6.0
  var i,p,v,obj,args=showHide.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; }
}

function isHome(theObject)
{
        theObject.setHomePage('http://www.goldline.com');
}
function LoadUp() {
         //document.domain = "goldline.com";
         CookieValue = getCookie('mycookie');
         if(!CookieValue) { // cookie isn't set
           // calculating expiration date
           expiryDate = new Date();
           expiryDate.setTime(expiryDate.getTime() + (1000*60*60*24*30*6));
           document.cookie = "mycookie=set; expires=" + expiryDate.toGMTString() + "; path=/";
           window.open("bookmark2.html","bookmark","menubar,resizable,width=500,height=500");
         }
}
function getCookie(Name) {
           var search = Name + "=";
           //document.domain = "www.goldline.com";
           if (document.cookie.length > 0) { // if there are any cookies
               offset = document.cookie.indexOf(search);
               if (offset != -1) { // if cookie exists
                   offset += search.length;
                   // set index of beginning of value
                   end = document.cookie.indexOf(";", offset);
                  // set index of end of cookie value
                  if (end == -1) {
                      end = document.cookie.length
                  }
                  return unescape(document.cookie.substring(offset, end))
              }
          }
}
function Rcertify()
{
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=10111071715920074', 'Participant','location=yes,scrollbars=yes,width=450,height=300');
window.name = 'opener';
}

function popUpWindow(pagename)
{
	var popUp_Window = window.open(pagename,"Pop_up1","toolbar=no,directories=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=300,height=300,innerWidth=300,innerHeight=300");
    perseus=popUp_Window
    setTimeout('perseus.focus()',150)
}

function popUpWindow2(pagename)
{
	var popUp_Window = window.open(pagename,"Pop_up2","toolbar=no,directories=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=350,height=300,innerWidth=340,innerHeight=290");
    perseus=popUp_Window
    setTimeout('perseus.focus()',150)
}

function popUpWindow3(pagename)
{
	var popUp_Window = window.open(pagename,"Pop_up3","toolbar=no,directories=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=550,height=330,innerWidth=550,innerHeight=330");
    perseus=popUp_Window
    setTimeout('perseus.focus()',150)
}

function popUpWindow4(pagename)
{
	var popUp_Window = window.open(pagename,"Pop_up4","toolbar=no,directories=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=650,height=600,innerWidth=650,innerHeight=600");
    perseus=popUp_Window
    setTimeout('perseus.focus()',150)
}

function popUpWindow5(pagename)
{
	var popUp_Window = window.open(pagename,"Pop_up5","toolbar=no,directories=no,location=no,screenX=400,top=400,left=400',screenY=400,status=no,menubar=no,scrollbars=no,resizable=yes,width=350,height=360,innerWidth=350,innerHeight=360");
    perseus=popUp_Window
    setTimeout('perseus.focus()',150)
}

function popUpWindowVid(pagename)   
{
	var popUp_Window = window.open(pagename,"Pop_Vid","toolbar=no,directories=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=470,height=420,innerWidth=470,innerHeight=420");
	perseus=popUp_Window
	setTimeout('perseus.focus()',150)
}

function popUpWindowVid2(pagename)
{ 
	var popUp_Window = window.open(pagename,"Pop_Vid2","toolbar=no,directories=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=450,innerWidth=600,innerHeight=450");
	perseus=popUp_Window
	setTimeout('perseus.focus()',150)
} 


isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isActive=false;

function MoveInit(e){
  topOne=isIE ? "BODY" : "HTML";
  whichOne=isIE ? document.all.FloatingLayer : document.getElementById("FloatingLayer");  
  ActiveOne=isIE ? event.srcElement : e.target;  
  while (ActiveOne.id!="titleBar"&&ActiveOne.tagName!=topOne){
    ActiveOne=isIE ? ActiveOne.parentElement : ActiveOne.parentNode;
  }  
  if (ActiveOne.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichOne.style.left);
    nowY=parseInt(whichOne.style.top);
    MoveEnabled=true;
    document.onmousemove=Move;
  }
}

function Move(e){
  if (!MoveEnabled) return;
  whichOne.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichOne.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function MoveN4(whatOne){
  if (!isN4) return;
  N4=eval(whatOne);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isActive){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function ToggleFloatingLayer(DivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[DivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(DivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[DivID].style.visibility = iState ? "visible" : "hidden";
    }
}

//document.onmousedown=MoveInit;
//document.onmouseup=Function("MoveEnabled=false");



function swapHTML(idx,nHtml) {
    if(document.layers)	   //NN4+
    {
       document.layers[idx].innerHTML = nHtml;
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        document.getElementById(idx).innerHTML = nHtml;
    }
    else if(document.all)	// IE 4
    {
        document.all[idx].innerHTML = nHtml;
    }
}
function openLayer(idx) {
	var targetElement;
	
	
	if (document.getElementById) { 
		targetElement = document.getElementById(idx);
	} 
	else if (document.layers) { 
		targetElement = document.layers[idx];
	} 
	else if (document.all) { 
		targetElement = document.all[idx];
	} 

	
	if (targetElement.style.display == "none") {
		targetElement.style.display = "";
	} else {
		targetElement.style.display = "none";
	}
	
}
var FlashObject = function(swf, id, w, h, ver, c) {
	this.swf = swf;
	this.id = id;
	this.width = w;
	this.height = h;
	this.version = ver;
	this.align = "middle";

	this.params = new Object();
	this.variables = new Object();

	this.redirect = "";
	this.sq = document.location.search.split("?")[1] || "";
	this.bypassTxt = "<p>Already have Macromedia Flash Player? <a href='?detectflash=false&"+ this.sq +"'>Click here if you have Flash Player "+ this.version +" installed</a>.</p>";
	
	if (c) this.color = this.addParam('bgcolor', c);
	this.addParam('quality', 'high'); // default to high
	this.doDetect = getQueryParamValue('detectflash');
}

var FOP = FlashObject.prototype;

FOP.addParam = function(name, value) { this.params[name] = value; }

FOP.getParams = function() { return this.params; }

FOP.getParam = function(name) { return this.params[name]; }

FOP.addVariable = function(name, value) { this.variables[name] = value; }

FOP.getVariable = function(name) { return this.variables[name]; }

FOP.getVariables = function() { return this.variables; }

FOP.getParamTags = function() {
    var paramTags = "";
    for (var param in this.getParams()) {
        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
    }
	paramTags += '<param name="wmode" value="transparent" />';
    return (paramTags == "") ? false:paramTags;
}

FOP.getHTML = function() {
    var flashHTML = "";
    if (navigator.plugins && navigator.mimeTypes.length) { // netscape plugin architecture
        flashHTML += '<embed type="application/x-shockwave-flash" wmode="transparent" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';
        for (var param in this.getParams()) {
            flashHTML += ' ' + param + '="' + this.getParam(param) + '"';
        }
        if (this.getVariablePairs()) {
            flashHTML += ' flashVars="' + this.getVariablePairs() + '"';
        }
        flashHTML += '></embed>';
    } else { // PC IE
        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">';
        flashHTML += '<param name="movie" value="' + this.swf + '" />';
        if (this.getParamTags()) {
            flashHTML += this.getParamTags();
        }
        if (this.getVariablePairs() != null) {
            flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';
        }
        flashHTML += '</object>';
    }
    return flashHTML;	
}

FOP.getVariablePairs = function() {
    var variablePairs = new Array();
    for (var name in this.getVariables()) { 
    	variablePairs.push(name + "=" + escape(this.getVariable(name))); 
    }
    return (variablePairs.length > 0) ? variablePairs.join("&"):false;
}

FOP.write = function(elementId) {
	if(detectFlash(this.version) || this.doDetect=='false') {
		if (elementId) {
			document.getElementById(elementId).innerHTML = this.getHTML();
		} else {
			document.write(this.getHTML());
		}
	} else {
		if (this.redirect != "") {
			document.location.replace(this.redirect);
		} else if (this.altTxt) {
			if (elementId) {
				document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;
			} else {
				document.write(this.altTxt +""+ this.bypassTxt);
			}
		}
	}		
}

/* ---- detection functions ---- */
function getFlashVersion() {
	var flashversion = 0;
	if (navigator.plugins && navigator.mimeTypes.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			var y = x.description;
   			flashversion = y.charAt(y.indexOf('.')-1);
		}
	} else {
		result = false;
	    for(var i = 15; i >= 3 && result != true; i--){
   			execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
   			flashversion = i;
   		}
	}
	return flashversion;
}

function detectFlash(ver) {	return (getFlashVersion() >= ver) ? true:false; }

// get value of query string param
function getQueryParamValue(param) {
	var q = document.location.search || document.location.href.split("#")[1];
	if (q) {
		var detectIndex = q.indexOf(param +"=");
		var endIndex = (q.indexOf("&", detectIndex) > -1) ? q.indexOf("&", detectIndex) : q.length;
		if (q.length > 1 && detectIndex > -1) {
			return q.substring(q.indexOf("=", detectIndex)+1, endIndex);
		} else {
			return "";
		}
	}
}

/* add Array.push if needed */
if(Array.prototype.push == null){
	Array.prototype.push = function(item) { this[this.length] = item; return this.length; }
}

/* ]]> */
