//Background and Font Size Change Code...... DO NOT CHANGE

function fnCheckCookie()
{
	var strText = '';
	var strArray;
	var strTemp = '';
	var strColour = '';
	var strFont = '';
	var date = new Date();
	
	if (document.cookie == ''){
		/*date.setTime(date.getTime()+(90*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();	
		document.cookie = 'color=1' + expires + '; path=/';
		document.cookie = 'font=2' + expires + '; ; path=/';*/
	}
	else{
		strArray = document.cookie.split(';');
		//if (strArray.length == 2){
			strTemp = strArray[0];
				
			while(strTemp.charAt(0)==' '){
				strTemp = strTemp.substring(1, strTemp.length);
			}
			
			if (strTemp.substring(0, 4) == 'font'){
				strFont = strTemp.substring(5, strTemp.length);
			}
			else{
				strColour = strTemp.substring(6, strTemp.length);
			}
			
			if (strArray.length > 1){
				strTemp = strArray[1];
			
				while (strTemp.charAt(0)==' '){
					strTemp = strTemp.substring(1, strTemp.length);
				}
				//alert(strTemp);
				if (strTemp.substring(0, 4) == 'font'){
					strFont = strTemp.substring(5, strTemp.length);
				}
				else{
					
					if (strTemp.substring(0, 5) == 'color'){
						strColour = strTemp.substring(6, strTemp.length);
					}
					
				}
			
			}
			
		//}
		
		fnGetId(strColour, strFont);
		
	}
}

function fnChangeColour(intColourID)
{
	//alert(document.cookie);
	var date = new Date();
	date.setTime(date.getTime()+(90*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();	
	document.cookie = 'color=' + intColourID + expires + '; path=/';
	fnCheckCookie();
}

function fnChangeText(intColourID)
{
	//alert(document.cookie);
	var date = new Date();
	date.setTime(date.getTime()+(90*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();	
	document.cookie = 'font=' + intColourID + expires + '; path=/';
	fnCheckCookie();
}

function fnGetId(intChoice, intChoiceB){
   // Returns the first DIV element in the collection.
   var strText = '';
 
	if (intChoice != '5'){
		document.getElementById('stylesheet').href = '/css/DialHouseStyle.css';
	}
	else {
		document.getElementById('stylesheet').href = '/css/DialHouseStyleBlack.css';
		document.getElementById('Image19').src = 'images/FontSize_02Black.png';
		document.getElementById('Image20').src = 'images/FontSize_03Black.png';
		document.getElementById('Image21').src = 'images/FontSize_04Black.png';
	}

     switch (intChoice)
     {
       case '1':
	     strText = '#FFFFFF';
		 break
       case '2':
	     strText = '#DAEFF6';
		 break
       case '3':
	     strText = '#FFFAC2';
		 break
       case '4':
	     strText = '#F3EC1A';
		 break
	   case '5':
	     strText = '#000000';
		 break
     }
     document.getElementById('divContainer').style.background=strText;
	 
     switch (intChoiceB)
     {
       case '1':
	     strText = '14px';
		 break
       case '2':
	     strText = '18px';
		 break
       case '3':
	     strText = '22px';
		 break	 		 		 
     }

     document.getElementById('Fontsize').style.fontSize=strText;
}