function sc_setStyle(which) {
    var i, s, main;
    for(i=0; (s = document.getElementsByTagName("link")[i]); i++) {
        if(s.getAttribute("rel").indexOf("style") != -1 && s.getAttribute("title")) {
            s.disabled = true;
            if(s.getAttribute("title") == which){
              s.disabled = false;
            }
        }
    }
    /*  EQUAL HEIGHTS */

//    if (jQuery.browser.msie && jQuery.browser.version.substring(0,1) === '6') {
//     return;
//    }
//
//    jQuery("div#main > div.inside > div").each(function(index){
//        var divid = jQuery(this).attr('id');
//        if(divid.indexOf('3') != -1){
//            var pos = divid.indexOf('3');
//            var divdrei = divid.substring('0', pos +1);
//            if(divdrei == "content-group-3"){
//                divid = "#"+divid;
//                 jQuery(divid).height("auto");
//            }
//        }
//    });
//
//    //  jQuery("#content-group-3").height("auto");
//    jQuery(".inside").height("auto");
//    jQuery(".inside").equalHeights();

    /* changeHeight */
//    difSite();
}

function getStyle() {
  var s;
  for(var i=0; (s = document.getElementsByTagName("link")[i]); i++) {
	if(s.getAttribute("rel").indexOf("style") != -1 && s.getAttribute("title") && !s.disabled)
		 return s.getAttribute("title");
  }
  return null;
}

function getPreferredStyle() {
  var i, s;
  for(i=0; (s = document.getElementsByTagName("link")[i]); i++) {
    if(s.getAttribute("rel").indexOf("style") != -1 &&
	   s.getAttribute("rel").indexOf("alt") == -1 &&
	   s.getAttribute("title"))
		 return s.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 : getPreferredStyle();
  sc_setStyle(title);
}

window.onunload = function(e) {
  var title = getStyle();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyle();
sc_setStyle(title);


