var select="";

function mail(addr,dom,txt)
{
  var tmpAddr=addr+'\@'+dom;
  var tmp=txt;
  if (txt == "")
  {
  	tmp=tmpAddr;
  }
  document.write("<a style='text-decoration:none' href=mailto:"+tmpAddr+">"+tmp+"</a>");
}


function intro()
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400" id="jdc_intro" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/pgs/partytime.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="bgcolor" value="#fcc0fe" />');
	document.write('<embed src="/pgs/partytime.swf" quality="high" wmode="transparent" bgcolor="#fcc0fe" width="550" height="400" name="jdc_intro" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function flashPicture()
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	document.write(' WIDTH="425" HEIGHT="350" id="jdcMovie" ALIGN="">');
	document.write(' <PARAM NAME=movie VALUE="../pictures/jdc_slideshow2.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="../pictures/jdc_slideshow2.swf" quality=high bgcolor=#FFFFFF  WIDTH="425" HEIGHT="350" NAME="jdcMovie" ALIGN=""');
 	document.write('TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</object>');
}

function gotoSite()
{
  
  if (document.domain.toUpperCase() == "JDCPARTYTIME")
    window.parent.location = "http://jdc";
  else  
    window.parent.location = "http://www.janetsdancecentre.com";
  
}

function LoadPopups()
{
  //ShowAd('pgs/openplay.htm',"craftplay");
  //ShowAd('pgs/recital_pictures.html',"Janet_Add1");
  //ShowAd('pgs/Registration.html',"Janet_Add");
  //ShowAd('pgs/snowclosing.html',"Janet_Add1");
  //ShowAd('pgs/ShowAd2.html',"Janet_Add2");
}

function InitSite()
{
     var tmp1="HOME";
          var oqs = document.location.search;
          var params = oqs.split("&");
          for(var i=0; i < params.length; i++){
                  if(params[i].indexOf("pg") > -1 ){
                          var o = params[i].split("=");
                          select = o[1];
                  }
          }
  
  
   if (select != "") 
   {
     if (select == "home_1.htm")
       tmp1="HOME";
     if (select == "about_1.htm")
       tmp1="ABOUT";
     if (select == "directions_1.htm")
       tmp1="DIR";
     if (select == "pictures.htm")
       tmp1="PICT";

     frames[1].window.location.replace('/src/nav.htm?menu='+tmp1);
     frames[2].window.location.replace('/pgs/'+select);
   }
   else
     LoadPopups();

}

function ShowAd(x, n)
{
   if (n=="")
     n="Janet_add";

   if (x!='') 
    window.open(x, n ,"width=300; height=400; center=1;");
}

function ShowPDF(x, n)
{
   if (n=="")
     n="Janet_add";

   if (x!='') 
    window.open(x, n ,"width=600; height=500; center=1;");
}

function CheckLocation()
{
   tStr = self.location.pathname.split("/");
   
   if (top.location == self.location)
   {
     self.location.replace("/index2.html?pg="+tStr[tStr.length-1]);
   }  
}

function MM_IndexSwapImg(g,b)
{
	var x=g.src;
	var y=x.substring(0,x.length-5);
	var bl=x.substring(x.length-9,x.length);

  if (bl.toUpperCase()!="BLANK.JPG")
  {
	if(b)
		x=y+"1.jpg";
	else
		x=y+"2.jpg";
  }
  g.src=x;
}


function GoToPageGeneric(p)
{
  	  document.location.replace(p);
}

function LoadPageInFrames(p1,p2)
{
	var x=false;
    
	if ((p1=="") && (p2==""))
	  return;
	  
	 parent.frames[1].document.location.replace(p1);
     

     if(p2!="")
       parent.frames[2].document.location.replace("../pgs/"+p2);
	 else
       parent.frames[2].document.location.replace("../src/blank.htm");

}


function Caps(x)
{
	x.value=x.value.toUpperCase();
}

function IsNetscape()
{
	return (navigator.appName.substring(0, 8) == "Netscape");
}


function WarnIfUsingOldBrowser()
{
	if (parseInt(navigator.appVersion) < 4)
	{
		if (IsNetscape())
			alert("Editing your Web site requires a newer version of Netscape Communicator. Visit Netscape's Web site at www.netscape.com to obtain the newest version. Failure to do so may result in unreliable behavior.");
		else
			alert("Editing your Web site requires a newer version of Internet Explorer. Visit Microsoft's Web site at www.microsoft.com to obtain the newest version. Failure to do so may result in unreliable behavior.");
	}
} 



function ReplaceString(org, match, replace)
{
    var     dst = "";
    var     starti = 0;
    var     endi = 0;

    while ((endi = org.indexOf(match, starti)) >= 0)
    {
        dst += org.substring(starti, endi) + replace;
        starti = endi + match.length;
    }

    dst += org.substring(starti, org.length);

    return dst;
}


function IsTrue(value)
{
	upperCaseValue = value.toUpperCase();
	return (upperCaseValue    != ""
			&& upperCaseValue != "NO" 
			&& upperCaseValue != "FALSE"
			&& upperCaseValue != "OFF"
			&& upperCaseValue != "0");
}



function setStatusBar(msg)
{
	window.status = msg;
	return true;
}


var v = parseInt(2);
var y = parseInt(0);

function moveNews() {
            if (performScrolling) {
                        var newsScroller = document.getElementById("newsScroller");
                        y -= v;
                        var h = parseInt(newsScroller.offsetHeight) / 2;
                        var _y = y + h;
                        if (_y < 0) {
                                    y = _y;
                        }
                        newsScroller.style.top = y + "px";
            }
            setTimeout("moveNews()", 100);
}

 

function initNewsScroller() {

            var  newsScroller = document.getElementById("newsScroller");

            newsScroller.style.position = "absolute";
            newsScroller.style.top = "0px";
            newsScroller.style.left = "5px";
            newsScroller.style.width = "250px";
            var newsView = document.getElementById("newsView");
            newsView.style.overflow = "hidden";
            if (newsScroller.offsetHeight < newsView.offsetHeight) return;
            newsScroller.innerHTML += String(newsScroller.innerHTML);
            setTimeout("moveNews()", 1000);
}

 

var performScrolling = true;

 

function pauseScrolling() {
            performScrolling = false;
}

 

function resumeScrolling() {
            performScrolling = true;
}

