﻿
function SetStyle(strName)
{
	//var intCount;

//	for(intCount = 0;intCount < document.styleSheets.length; intCount++) {
//		if(document.styleSheets[intCount].title == strName)
//			document.styleSheets[intCount].disabled = false;
//		else
//			document.styleSheets[intCount].disabled = true;
//	}
    if(strName == "Normal"){
        EnableStyle(true,strName)
        EnableStyle(false,"Small")
        EnableStyle(false,"Large")
    }
    if(strName == "Small"){
        EnableStyle(true,strName)
        EnableStyle(false,"Normal")
        EnableStyle(false,"Large")
    }
    
    if(strName == "Large"){
        EnableStyle(true,strName)
        EnableStyle(false,"Small")
        EnableStyle(false,"Normal")
    }

	setCookie("css", strName, 30, "/", null);
}


function SetStyleIE(strName)
{
	//var intCount;

    if(strName == "Normal"){
        if(EnableStyleIE(true,strName)){
            document.getElementById("QHStyleNormal").disabled = false;
            document.getElementById("QHStyleLarge").disabled = true;
            document.getElementById("QHStyleSmall").disabled = true;
        }else{
            EnableStyle(false,"Small")
            EnableStyle(false,"Large")
        }
    }
    if(strName == "Small"){
        if(EnableStyleIE(true,strName)){
            document.getElementById("QHStyleNormal").disabled = true;
            document.getElementById("QHStyleLarge").disabled = true;
            document.getElementById("QHStyleSmall").disabled = false;
        }else{
           EnableStyle(false,"Normal")
           EnableStyle(false,"Large")
        }
    }
    
    if(strName == "Large"){
        if(EnableStyleIE(true,strName)){
            document.getElementById("QHStyleNormal").disabled = true;
            document.getElementById("QHStyleLarge").disabled = false;
            document.getElementById("QHStyleSmall").disabled = true;
        }else{
           EnableStyle(false,"Small")
           EnableStyle(false,"Normal")
        }
    }

	setCookie("css", strName, 30, "/", null);
}

 function EnableStyle(flag,strName){
    var intCount;
    for(intCount = 0;intCount < document.styleSheets.length; intCount++) {
        if(document.styleSheets[intCount].title == strName){
            document.styleSheets[intCount].disabled = !flag;
        }
    }
}

 function EnableStyleIE(flag,strName){
    var intCount;
    var index = 0;
    for(intCount = 0;intCount < document.styleSheets.length; intCount++) {
        if(document.styleSheets[intCount].title == strName){
            document.styleSheets[intCount].disabled = !flag;
            index++;
        }
    }
    
    if(index == 0)
        return true;
    else
        return false;
}

function UpdateStyle()
{
	var strName;

	strName = getCookie("css")

	if((typeof(strName) != "undefined")&&(strName != null))
		setCookie("css", strName, 30, "/", null);
}


