<!--

// ----------------------------------------------
// StyleSwitcher functions written by Paul Sowden
// http://www.idontsmoke.co.uk/ss/
// - - - - - - - - - - - - - - - - - - - - - - -
// For the details, visit ALA:
// http://www.alistapart.com/stories/alternate/


function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}



window.onload = function() {
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
if (title)
	setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}





function PopupWindow(url,width,height,resize,params, name)
{	
	if (name == null) name = "EditWin";
	
	screenx = screen.availWidth;
	screeny = screen.availHeight;
	x = null;
	y = null;
	if (width != null)
	{
	    if (width < 1) width = screenx * width;
	    x = (screenx / 2) - (width / 2);
	}
	if (height != null)
	{
	    if (height < 1) height = screeny * height;
	    y = (screeny / 2) - (height / 2);
	}
	
	if (width != null) width = ",width=" + Math.round(width);
	if (height != null) height = ",height=" + Math.round(height);
	if (resize == null) resize = "yes";
	
	if (x != null) x = ",screenX=" +  Math.round(x) + ",Left=" + Math.round(x);
	if (y != null) y = ",screenY=" + Math.round(y) + ",Top=" + Math.round(y);

//Set parameters
    lparams = new Object();
	if (params != null)
	{
    	aparams = params.split(";");
	    for (i = 0; i < aparams.length; i++)
    	{
	        sparams = aparams[i].split("=");
	        lparams[sparams[0]] = sparams[1];
    	}
    }
    
    //alert("scrollbars=yes,dependant=yes" + width + height + x + y + ",centerscreen=yes,resizable=" + resize);

//Create window
	editWin = window.open(url,name,"scrollbars=yes,dependant=yes" + width + height + x + y + ",centerscreen=yes,resizable=" + resize);
	if (!editWin)
	{
	    alert("Your browser has blocked a popup. Please configure your browser to allow popups on this Website.");
	    return;
	}
	try {
	    editWin.params = lparams	
	} catch (e) {}

	return editWin;
}






















 function CreateBookmarkLink() {

 title = document.title; 
  // Blogger - Replace with <$BlogItemTitle$> 
  // MovableType - Replace with <$MTEntryTitle$>

 url = document.location.href + "";
  // Blogger - Replace with <$BlogItemPermalinkURL$> 
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }









//-->






















