function DisplayEmailLink1 () {
    document.write("<a href='mailto:");
    document.write("dave@");
    document.write("madcat.com.au");
    document.write("'>");
    document.write("dave@");
    document.write("madcat.com.au");
    document.write("</a>");
}

function DisplayEmailLink2 () {
    document.write("<a href='mailto:");
    document.write("maggie@");
    document.write("madcat.com.au");
    document.write("'>");
    document.write("maggie@");
    document.write("madcat.com.au");
    document.write("</a>");
}

function DisplayEmailLink_Generic (name, domain) {
    document.write("<a href='mailto:");
    document.write(name + "@");
    document.write(domain);
    document.write("'>");
    document.write(name + "@");
    document.write(domain);
    document.write("</a>");
}

function DisplayEmailLink_Generic1 (name, domain) {
    document.write("<a href='mailto:");
    document.write(name + "@");
    document.write(domain);
    document.write("'>");
}

function DisplayEmailLink_Generic2 (text) {
    document.write(text);
    document.write("</a>");
}

function checkClientSize()
{

    //Check for window size below 768px high
    if ((getClientHeight() <= 600) || (getClientWidth() <= 1024))
    {
//  alert (getClientWidth());
//  alert (getClientHeight());
        document.getElementById("header-container").style.position = "relative";
        if (document.getElementById("content-container") != undefined)
        {
            document.getElementById("content-container").style.paddingTop = "0px";
            HeaderScrollStatus = "NP_SH";
        }
        else
        {
            document.getElementById("content-container-gallery").style.paddingTop = "0px";
            HeaderScrollStatus = "GP_SH";
        }
//      document.getElementById("headerlogo-container").style.position = "relative";
//      document.getElementById("headerlogo-container").style.textAlign = "relative";
//      document.getElementById("headerlogo-container").style.paddingLeft = 206;
    }
    else
    {
        if (document.getElementById("content-container") != undefined)
        {
            // Check for IE6
            if (navigator.appVersion.match("MSIE 6.0") == "MSIE 6.0")
            {
                HeaderScrollStatus = "NP_SH";
            }
            else
            {
                HeaderScrollStatus = "NP_FH";
            }
        }
        else
        {
            // Check for IE6
            if (navigator.appVersion.match("MSIE 6.0") == "MSIE 6.0")
            {
                HeaderScrollStatus = "GP_SH";
            }
            else
            {
                HeaderScrollStatus = "GP_FH";
            }
        }
    }

}

function getClientWidth()
{
    
    var w;

    if(document.innerWidth)
    {
        w=document.innerWidth;
    } 
    else if(document.documentElement.clientWidth)
    {
        w=document.documentElement.clientWidth;
    } 
    else if(document.body)
    {
        w=document.body.clientWidth; 
    }
    
    return w;
    
}

function getClientHeight()
{

    var h;
    
    if(document.innerHeight)
    {
        h=document.innerHeight;
    } 
    else if(document.documentElement.clientHeight)
    {
        h=document.documentElement.clientHeight;
    } 
    else if(document.body)
    {
        h=document.body.clientHeight; 
    }
    
    return h;
    
}

function checkEmail()
{
   if (document.getElementById("txtSubscribeName").value == "")
   {
      alert("You must enter your name");
      return false;
   }
   if (document.getElementById("txtSubscribeEmail").value == "")
   {
      alert("You must enter your email address");
      return false;
   }
   return true;
}

function checkContact()
{
   if (document.getElementById("txtContactName").value == "")
   {
      alert("You must enter your name");
      return false;
   }
   if (document.getElementById("txtContactEmail").value == "")
   {
      alert("You must enter your email address");
      return false;
   }
   return true;
}

function getQueryVariable(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}

function showNovelPanel()
{
	var no_novels = document.getElementById("no_novels").value;
	
	document.getElementById("optionPanel-1").style.display = "none";
	for (i=0; i<no_novels; i++)
	{
		document.getElementById("optionPanel" + i).style.display = "none";
	}
	document.getElementById("optionPanel" + document.getElementById("novel_selected").value).style.display = "block";
}

function showBannerImagePanel()
{
	var no_banners = document.getElementById("no_banners").value;
	
	document.getElementById("optionPanel-1").style.display = "none";
	for (i=0; i<no_banners; i++)
	{
		document.getElementById("optionPanel" + i).style.display = "none";
	}
	document.getElementById("optionPanel" + document.getElementById("banner_selected").value).style.display = "block";
	
}

function showSearch()
{
	document.getElementById("header-search-panel").style.display = "block";
}
function closeSearch()
{
	document.getElementById("header-search-panel").style.display = "none";
	
}

