// in progress

var showing = "";
var contact_us_flag = false;

var text_size_small_page_size;
var text_size_medium_page_size;
var text_size_large_page_size;

var	pre_size;
var current_size;
function showDiv(menuID) {

if(menuID == 'contact_us')
{
     
	  var page_height_table = document.getElementById("content_height").clientHeight;
	 //alert(page_height_table);
	 var req_height = parseInt(page_height_table) + 185;
	  //alert(req_height);
	  document.getElementById(menuID).style.top = req_height;
} 
	 
	 
	 
	 /*if (window.innerHeight && window.scrollMaxY) 
	 {// Firefox         
		yWithScroll = window.innerHeight + window.scrollMaxY;  
        //xWithScroll = window.innerWidth + window.scrollMaxX; 
	 }
	 else if (document.body.scrollHeight > document.body.offsetHeight)
	 { // all but Explorer Mac   
        yWithScroll = document.body.scrollHeight;   
        //xWithScroll = document.body.scrollWidth;     
	 }
	else 
	{ // works in Explorer 6 Strict, Mozilla (not FF) and Safari  
	    yWithScroll = document.body.offsetHeight;  
	    //xWithScroll = document.body.offsetWidth;      
	}    
	//arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);    
	//alert( 'The height is ' + yWithScroll );//+ ' and the width is ' + xWithScroll 
    //return arrayPageSizeWithScroll; 
	//alert(document.getElementById(menuID).style.top);
	 var page_height_table = document.getElementById("content_height").clientHeight;
	 //alert(page_height_table);
	 var req_height = parseInt(page_height_table) + 220;
	  alert(req_height);
	  document.getElementById(menuID).style.top = req_height;
	 //alert( document.getElementById("content_height").clientHeight); 
	if(yWithScroll > 680)
	{
		
		if(contact_us_flag == false)
		{
			contact_us_flag = true;
			//var tot_page_height = document.getElementById(menuID).style.top;
			var req_height = parseInt(yWithScroll) - 70;
			document.getElementById(menuID).style.top = req_height;
		}
	}
}
*/
  if (document.getElementById) {
    document.getElementById(menuID).style.visibility = "visible";
	} 
/*
if(menuID == 'contact_us')
{
	alert(document.getElementById(menuID).top);
}*/
  showing = menuID;
}

function hideDiv() {
  if (document.getElementById) {
    document.getElementById(showing).style.visibility = "hidden";
	}
}

Cookie = function(name, expiration, path, domain, secure) {
    this.$name = name;
    this.$expiration = (expiration) ? new Date(expiration) : null;
    this.$path = (path) ? path : null;
    this.$domain = (domain) ? domain : null;
    this.$secure = (secure) ? secure : false;
}

Cookie.prototype.store = function() {
    var cookieval = "";
    for(var prop in this) {
        // ignore props with names that begin with '$' and also methods.
        // Colons and ampersands are used for individual state variables
        // we store within a single cookie value.
        if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function'))
            continue;
        if (cookieval != "")
            cookieval += '&';
        cookieval += prop + ':' + escape(this[prop]);
    }

    var cookie = this.$name + '=' + cookieval;
    if (this.$expiration) cookie += '; expires=' + this.$expiration.toGMTString();
    if (this.$path) cookie += '; path=' + this.$path;
    if (this.$domain) cookie += '; domain=' + this.$domain;
    if (this.$secure) cookie += '; secure';
    // now store the cookie
    document.cookie = cookie;
}

Cookie.prototype.load = function() {
    var allcookies = document.cookie;
    if (allcookies != "" && allcookies.indexOf(this.$name) != -1) {
        var start = allcookies.indexOf(this.$name) + (this.$name.length + 1);
        var end = (allcookies.indexOf(";", start) != -1) ? allcookies.indexOf(";", start) : allcookies.length;
        var cookieval = allcookies.substring(start, end);

        var a = cookieval.split('&');
        for(var i=0; i < a.length; i++) {
            a[i] = a[i].split(':');
        }
        for(var i=0; i < a.length; i++) {
            this[a[i][0]] = unescape(a[i][1]);
        }
        return true;
    } else {
        return false;
    }
}


function sizeFont(size) {

    var i, fontLink;
    for (i=0; (fontLink = document.getElementsByTagName("link")[i]); i++) {   
        if(fontLink.getAttribute("rel").indexOf("style") > -1 && fontLink.getAttribute("title")) {
            fontLink.disabled = true;
            if (fontLink.getAttribute("title") == size) {
                fontLink.disabled = false;
            }
        }  
    }
    oldfontimg = document.getElementById('fontimg_' + fontsize);
    oldfontimg.src = oldfontimg.src.substring(0, (oldfontimg.src.length-11)) + ".gif";
    fontsize = size;
    fontimg = document.getElementById('fontimg_' + size);
    fontimg.src = fontimg.src.substring(0, (fontimg.src.length-4)) + "_active.gif";
    var fontCookie = new Cookie('fontsize', '01/01/2020', '/', '.jerseycitydanceacademy.com'); 
    fontCookie.fsize = size;
    fontCookie.store();

}


var fontCookie = new Cookie('fontsize');
fontCookie.load(); 
var fontsize = (fontCookie.fsize != null) ? fontCookie.fsize : "small";
medium_font = "alternate ";
large_font = "alternate ";
if (fontsize == "medium") {
  medium_font = "";
} else if (fontsize == "large") {
  large_font = "";
}
document.write('<link rel="'+medium_font+'stylesheet" type="text/css" href="css/font_medium.css" title="medium" media="screen" />'); 
document.write('<link rel="'+large_font+'stylesheet" type="text/css" href="css/font_large.css" title="large" media="screen" />'); 


function fontswitcher() {
  // don't show fontswitcher if running Mac IE 5 because of horrific display problems
  if (!((navigator.appName.indexOf("Microsoft") != -1) && (navigator.userAgent.indexOf("Mac") != -1))){
    document.getElementById("fontswitcher").className = "fontswitcher";
    fontimg = document.getElementById("fontimg_" + fontsize);
    fontimg.src = fontimg.src.substring(0, (fontimg.src.length-4)) + "_active.gif";
  }
}