//*** Copyright (c) INDEZ International LTD 2006. All rights reserved. ********************
/*
function init(){	
	// must be before mooAccordion
	mooTogs.each(function(tog, i) {
		tog.ondblclick = tog.href; // Used for temp storage only
		tog.href = '#';
		//if(tog.alt=='Active Menu'){
		//	alert('here');
		//	tog.className = 'stretch_active';
		//}
		tog.onclick = function() {
			if (tog.className == 'stretch_active') {
			location.href = tog.ondblclick;
			return false;
			//mooAccordion.clearAndToggle(mooStretch[i], i);
			//tog.className = 'stretchtoggle';
			//return;
			}

			// reset them all then set clicked
			mooTogs.each(function(rtog, ri) {mooTogs[ri].className = 'stretchtoggle';});
			tog.className = 'stretch_active';
			return false;
		};
	});

  var mooAccordion = new fx.Accordion(mooTogs, mooStretch, {opacity:true, width:false, height:true, duration: 320});
}
function showMenu(menu_item){
	var mooAccordion = new fx.Accordion(mooTogs, mooStretch, {opacity:true, width:false, height:true, duration:200});
	if (menu_item > -1){ 			
		mooTogs.each(function(tog, i) {
			if (menu_item==i){
				mooAccordion.showThisHideOpen(mooStretch[i]);
			}
		});
	}
}*/
function init(){
	mooTogs    = document.getElementsByClassName('toggle');
	mooStretch = document.getElementsByClassName('stretcher');

	// must be before mooAccordion
	mooTogs.each(function(tog, i) {
		/*tog.onclick = function() {
		if (tog.className == 'stretch_active') {
			mooAccordion.clearAndToggle(mooStretch[i], i);
			tog.className = 'stretchtoggle';
			return;
		}*/
		tog.ondblclick = tog.href;
		tog.href = '#';
		tog.onclick = function() {
			if (tog.className == 'stretch_active') {
			location.href = tog.ondblclick;
			return false;
		}

		// reset them all then set clicked
		mooTogs.each(function(rtog, ri) {mooTogs[ri].className = 'stretchtoggle';});
		tog.className='stretch_active';
	};
	});
}

function showMenu(menu_item){
	var mooAccordion = new fx.Accordion(mooTogs, mooStretch, {opacity:true, width:false, height:true, duration:250});
	if (menu_item > -1){ 			
		mooTogs.each(function(tog, i) {
			if (menu_item==i){
				mooAccordion.showThisHideOpen(mooStretch[i]);
			}
		});
	}
}
function toggle(id) {
	if (document.getElementById(id).style.display!='none') {
		document.getElementById(id).style.display = 'none';
	}
	else {
		document.getElementById(id).style.display = 'block';
	}
}

function resize(value){
	createCookie('508',value,'30');
	setsize();
}

function setsize(){
	//size = readCookie('508');
	document.getElementById('container').style.fontSize = readCookie('508');
	//alert(size);
}

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 var 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 = setsize;