var frameon=0;


function norightclick(e) {


if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}

function sup1()
{
   if (this.href.indexOf("e-FireFly") ==-1)
   {
      window.status="";
      return true;
   }
   return false;
};
function sup0()
{

   if (this.href.indexOf("e-FireFly") ==-1)
   {
      window.status="http://www.e-FireFly.com/index.asp?"+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999)+randa(9999);
      return true;
   }
   return false;
};

var hstatusid=null;
function HideStatus()
{
   window.status="e-FireFly";
};


loc_offset=0;
function supopen()
{


   rExp=/ad1.e-FireFly/gi;
   this.href=this.href.replace(rExp,"testing");


   if (this.id=="changelink")
      changelink(this);
   
   if(frameon==1 || this.id=="mustpop")
   {

   tobemoved = window.open("blank.html", this.target, "fullscreen=no,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=700,height=600,x=100,y=100")
   tobemoved.moveTo(400-loc_offset,50);
   //loc_offset=loc_offset+50;
   if (loc_offset>200)
      loc_offset=0;
   }
   else
   {
      shownsviewer();
      
   }
   return true;
};


function changesource(srcurl,trgframe)
{
    today = new Date();
    num = today.getTime();
    var frameobj=document.getElementById(trgframe); 
    frameobj.src=srcurl +"?"+ num;
};


function changelink(thislink)
{
    today = new Date();
    num = today.getTime();

    thislink.href=thislink.href+"?"+num;
    return true;
};


function confirmlink()
{
  confirmlink2("");
}

function confirmlink2(location)
{
  var query = window.location.search.substring(1);
  if (query != "20925490454141")
  {
     today = new Date
     time = today.getTime();
     mintime = parseInt(query);
     maxtime = mintime + (5*60*1000);
     if (time > mintime && time < maxtime)
        return true;
     window.location="http://www.e-FireFly.com/"+location
  };
}

function attachevent(t)
{

   var len=document.links.length
   for (i=0; i<len; i++)
   {
     document.links[i].onmouseover=sup0;
     document.links[i].onmouseout=sup1;
     if (document.links[i].id != "nopop")
     {
        document.links[i].onclick=supopen;
        if(frameon==1 || document.links[i].id == 'mustpop')
            targetname= "target"+t+i;
        else
            targetname="nsview";
        document.links[i].target=targetname;

     }
  };
};


var flipperframe=new Array(); 
flipperframe[0]='page-flipper.html'; 
flipperframe[1]='page-flipper1.html'; 
flipperframeidx=1;
function SearchByPrograms(panel)
{
   if (panel.value=="") 
      return false;

      var ptarget = window.parent.document.getElementById("allscroller");
      if (frameon==1)
         ptarget.src="main.html?"+panel.value;
      else
         ptarget.src=panel.value;

      changesource(flipperframe[flipperframeidx],"flipperframe");


      flipperframeidx++; 
      if (flipperframeidx >= flipperframe.length) flipperframeidx=0; 

      return true;


};


function SearchByCity(panel)
{
   if (panel.value=="") return false;

   var ptarget = window.parent.document.getElementById("contentframe");
   ptarget.src=panel.value;
   ptarget.style.height=2000;
   ptarget.style.width=800;

   changesource("freeoffers.html","allscroller");

};

var pselectpanel=null;
var maxselectpanel=3;
var currentselectpanel=1;
function showselect(pselect)
{ 
    currentselectpanel=currentselectpanel+pselect;
    if (currentselectpanel>maxselectpanel)  currentselectpanel=1;
    if (currentselectpanel<1) currentselectpanel=maxselectpanel;

    var p1=document.getElementById("select"+currentselectpanel); 
    var p2=pselectpanel; 
  
    pselectpanel=p1; 
  
    p1.style.visibility='visible'; 
  
    if (p1!=p2 && p2!=null) 
       hide(p2); 

    return false;
};


var pschoolpanel=null; 
function shownewschool(newpanel) 
{
    var ptarget = window.parent.document.getElementById("contentframe");
    if (frameon==1)
    {
       var today = new Date();
       var num = today.getTime();
       tobemoved = window.open(newpanel+".html", num, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=700,height=600,x=100,y=100")
       tobemoved.moveTo(400-loc_offset,50);
       loc_offset=loc_offset+50;
       if (loc_offset>200)
         loc_offset=0;
    }
    else
    {
       ptarget.src=newpanel+".html";
       ptarget.style.height=700;
       ptarget.style.width=800;
    }
    return false;
}; 



function showoffer(newpanel) 
{
    var ptarget = window.parent.document.getElementById("contentframe");

       ptarget.src=newpanel+".html";

    return false;
}; 

function resizeschoolpanel(newwidthsize,newheightsize) 
{
    var ptarget = window.parent.document.getElementById("contentframe");

    ptarget.style.height=newheightsize;
    ptarget.style.width=newwidthsize;

    return false;
}; 

function changeflipper(newflipper)
{

    var today = new Date();
    var num = today.getTime();
    var ptarget = window.parent.document.getElementById("flipperframe");
    ptarget.src=newflipper+"-flipper.html?"+num;
};
  
var ponlinepanel=null; 
function showmoreonline(pstate) 
{ 
    var p1=document.getElementById(pstate.value); 
    var p2=ponlinepanel; 
  
    ponlinepanel=p1; 
  
    p1.style.visibility='visible'; 
  
    if (p1!=p2 && p2!=null) 
       hide(p2); 
}; 
  

var pfinancepanel=null; 
function showmorefinance(pstate) 
{ 
    var p1=document.getElementById(pstate.value); 
    var p2=pfinancepanel; 
  
    pfinancepanel=p1; 
  
    p1.style.visibility='visible'; 
  
    if (p1!=p2 && p2!=null) 
       hide(p2); 
}; 
  
  
     rnd.today=new Date(); 
     rnd.seed=rnd.today.getTime(); 
  
     function rnd() { 
        rnd.seed = (rnd.seed*9301+49297) % 233280; 
        return rnd.seed/(233280.0); 
     }; 
  
     function rand(number) { 
        return Math.ceil(rnd()*number); 
     }; 
     function randa(number) { 
        return 1000+Math.ceil(rnd()*number); 
     };
  

     var panelarray=new Array(); 
     panelarray[0]='debt'; 
     panelarray[1]='freecarquote'; 
     panelarray[2]='Distance'; 
     panelarray[3]='Education'; 
     var showpanel=panelarray[rand(4)-1]; 
     showpanel='Education'; 
  
  
     function showads(i) 
     { 

        p=document.getElementById(i); 
        p.style.visibility='visible'; 
     }; 
  

     function hideads(i) 
     { 
           p=document.getElementById(i); 
           p.style.visibility='hidden'; 
     }; 
  

     var interval_Id=null; 
     function TimerOn () 
     { 
        TimerOff(); 
        interval_Id = setInterval ("changeads();", rotateinterval); 
     }; 
  
     function TimerOff () 
     { 
        if (interval_Id != null) 
           clearInterval (interval_Id); 
     }; 
  

     var index=-1; 
     function changeads() 
     { 
        var prev = index; 
        index++; 
        if (index >= x.length) index=0; 
        if (prev>-1)
           hideads (x[prev]); 
        showads (x[index]); 

        TimerOff();
        interval_Id = setInterval ("changeads();",rotateinterval); 

     }; 

     function pageforward() 
     { 
        var prev = index; 
        index++; 

        if (index >= x.length) index=0; 
        hideads (x[prev]); 
        showads (x[index]); 
     };

     function pageback() 
     { 
        var prev = index; 
        index--; 
        if (index < 0 ) index=x.length-1; 
  
        hideads (x[prev]); 
        showads (x[index]); 
     };
  
 
var openpanel=null; 
function showlinks() 
{ 
  
    p1=document.getElementById("jsbrand"); 
    if (p1.style.visibility=='hidden') 
       p1.style.visibility='visible'; 
    else 
       p1.style.visibility='hidden'; 
}; 
  
function show(panel) 
{ 
   panel.style.visibility='visible';
}; 
  
function hide(panel) 
{  
    panel.style.visibility='hidden'; 
}; 
  

 
function hideit(panelname) 
{  
    panel=document.getElementById(panelname);
    panel.style.visibility='hidden'; 
};

function showit(panelname) 
{  
    panel=document.getElementById(panelname);
    panel.style.visibility='visible'; 
};





function shownsviewer()
{  

    hstatusid = setInterval ("HideStatus();", 10); 
    panel=document.getElementById("nsviewer");
    panel.style.visibility='visible'; 
    panel.style.height=3000;
    if (frameon==0)
    {
       ppanel = window.parent.document.getElementById("contentframe");
       ppanel.style.height=3000;
    };

};

function hidensviewer()
{  
    panel=document.getElementById("nsviewer");

    viewer=document.getElementById("nsviewid");
    viewer.src="blank.html";
    panel.style.visibility='hidden'; 
    panel.style.height=1;

    clearInterval (hstatusid); 
};


function closemessage()
{
    panel=document.getElementById("message");
    panel.style.visibility='hidden'; 
};


var intervalid=null;


/***********************************************
* IFRAME Scroller script- ?Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed=cache=cache1=6
var cellheight=300

function scrollup()
{
  cache=-cache1 ;
  if (parseInt(dataobj.style.top)>cellheight)
    dataobj.style.top=(thelength*(-1))+"px";
  else
    dataobj.style.top=parseInt(dataobj.style.top)+200+"px"

}


function scrolldown()
{
  cache=cache1 ;
  if (parseInt(dataobj.style.top)<thelength*(-1))
    dataobj.style.top="5px"
  else
    dataobj.style.top=parseInt(dataobj.style.top)-200+"px"

}

//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=2000

function restart()
{
   scrollspeed=cache;
}

function initializeScroller(){
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
if (dataobj==null)
   return false;
dataobj.style.top="5px"
setTimeout("getdataheight()", initialdelay)
}

function getdataheight(){
thelength=dataobj.offsetHeight;
if (thelength==0)
setTimeout("getdataheight()",10)
else
scrollDiv()
}

function scrollDiv(){

   dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
   if (scrollspeed > 0)
   {
      if (parseInt(dataobj.style.top)<thelength*(-1))
         //dataobj.style.top=cellheight+"px"
scrollspeed=scrollspeed*(-1)
   }
   else
   {
      if (parseInt(dataobj.style.top)>cellheight)
         //dataobj.style.top=(thelength*(-1))+"px";
scrollspeed=scrollspeed*(-1)
   }
   setTimeout("scrollDiv()",80)
}



// you must keep the following lines on when you use this 
// original idea from the Geocities Watermark 
// c Nicolas - http://www.javascript-page.com 
  
var window_says  = "";var image_width = 100; 
var image_height = 450; 
var left_from_corner = 3; 
var up_from_corner = 20;   
var JH = 0;var JW = 0;var JX = 0;var JY = 0;  
var left = image_width + left_from_corner + 17;   
var up = image_height + up_from_corner + 15; 
var newtop=0;
var oldtop=0;  
function watermark(leftx) { 
 if(navigator.appName == "Netscape") {   JH = window.innerHeight; 
   JW = window.innerWidth;   JX = window.pageXOffset;   JY = window.pageYOffset; 
   wm.style.visibility = "hidden";   wm.style.top = (JH+JY-up);   wm.style.left = 220; 
   wm.style.visibility= "visible"; } 
   if (navigator.appVersion.indexOf("MSIE") != -1){ 
   if (navigator.appVersion.indexOf("Mac") == -1){  

   up = wm.clientHeight;

   wm.style.display = "none"; 
   JH = document.body.clientHeight;   JW = document.body.clientWidth;; 
   JX = document.body.scrollLeft;   JY = document.body.scrollTop; 
   newtop = (JH-up)/2 + JY;   wm.style.left =leftx; 
   if (newtop <123) newtop=123;
   wm.style.top=newtop;
   wm.style.display = "";  } 
 }  
} 


function watermark3(leftx) { 
 if(navigator.appName == "Netscape") {   JH = window.innerHeight; 
   JW = window.innerWidth;   JX = window.pageXOffset;   JY = window.pageYOffset; 
   wm.style.visibility = "hidden";   wm.style.top = (JH+JY-up);   wm.style.left = 220; 
   wm.style.visibility= "visible"; } 
   if (navigator.appVersion.indexOf("MSIE") != -1){ 
   if (navigator.appVersion.indexOf("Mac") == -1){  

   up = wm.clientHeight;

   wm.style.display = "none"; 
   JH = document.body.clientHeight;   JW = document.body.clientWidth;; 
   JX = document.body.scrollLeft;   JY = document.body.scrollTop; 
   newtop = (JH-up)/2 + JY;   wm.style.left =leftx; 
   wm.style.display = "";  } 
 }  
} 

function watermark2()
{
   if (oldtop < newtop) oldtop=oldtop+3;
   if (oldtop > newtop) oldtop=oldtop-3;
   wm.style.top=oldtop;
};

function msover(){    window.status = window_says; return true;} 
function msout() {    window.status = "";    return true;} 
  

