var bln_growAb 	= false;
var bln_growCo 	= false;
var bln_growTr 	= false;
var bln_growSh 	= false;
var bln_growSb 	= false;
var bln_growAt 	= false;
var bln_onAb 	= false;
var bln_onCo 	= false;
var bln_onTr 	= false;
var bln_onSh 	= false;
var bln_onSb 	= false;
var bln_onAt 	= false;
var heightAbon 	= 85;
//var heightCoon 	= 298;
//var heightTron 	= 162;
//var heightShon 	= 245;
var heightSbon 	= 85;
//var heightAton 	= 190;
var height		= 27;
var heightClose	= 27;

//**************************************** grow ********************************************
function growAb(){
    //set new height to old height
    if(!bln_growAb){
        $('abon').style.height = height + 'px';
        $('abon').style.display    = 'block';
        $('ab').style.display = 'none';
        bln_growAb = true;
    }
    if(height < heightAbon){
        height = height + 4;
        $('abon').style.height = height +'px';
        setTimeout("growAb();",10);
    }
	else{
		height = 27;
		bln_growAb = true;
	}
}

function growCo(){
    //set new height to old height
    if(!bln_growCo){
        $('coon').style.height = height + 'px';
        $('coon').style.display    = 'block';
        $('co').style.display = 'none';
        bln_growCo = true;
    }
    if(height < heightCoon){
        height = height + 4;
        $('coon').style.height = height +'px';
        setTimeout("growCo();",10);
    }
	else{
		height = 27;
		bln_growCo = true;
	}
}

function growTr(){
    //set new height to old height
    if(!bln_growTr){
        $('tron').style.height = height + 'px';
        $('tron').style.display    = 'block';
        $('tr').style.display = 'none';
        bln_growTr = true;
    }
    if(height < heightTron){
        height = height + 4;
        $('tron').style.height = height +'px';
        setTimeout("growTr();",10);
    }
	else{
		height = 27;
		bln_growTr = true;
	}
}

function growSh(){
    //set new height to old height
    if(!bln_growSh){
        $('shon').style.height = height + 'px';
        $('shon').style.display    = 'block';
        $('sh').style.display = 'none';
        bln_growSh = true;
    }
    if(height < heightShon){
        height = height + 4;
        $('shon').style.height = height +'px';
        setTimeout("growSh();",10);
    }
	else{
		height = 27;
		bln_growSh = true;
	}
}

function growSb(){
    //set new height to old height
    if(!bln_growSb){
        $('sbon').style.height = height + 'px';
        $('sbon').style.display    = 'block';
        $('sb').style.display = 'none';
        bln_growSb = true;
    }
    if(height < heightSbon){
        height = height + 4;
        $('sbon').style.height = height +'px';
        setTimeout("growSb();",10);
    }
	else{
		height = 27;
		bln_growSb = true;
	}
}
function growAt(){
    //set new height to old height
    if(!bln_growAt){
        $('aton').style.height = height + 'px';
        $('aton').style.display    = 'block';
        $('at').style.display = 'none';
        bln_growAt = true;
    }
    if(height < heightAton){
        height = height + 4;
        $('aton').style.height = height +'px';
        setTimeout("growAt();",10);
    }
	else{
		height = 27;
		bln_growAt = true;
	}
}
//**************************************** shrink ********************************************
function shrinkAb(){
    if(heightClose < heightAbon){
        heightAbon = heightAbon - 4;
        $('abon').style.height = heightAbon +'px';
        setTimeout("shrinkAb();",10);
    }
	else{
		$('abon').style.display    = 'none';
        $('ab').style.display = 'block';
		heightAbon = 85;
		bln_growAb = false;
	}
}
function shrinkCo(){
    if(heightClose < heightCoon){
        heightCoon = heightCoon - 4;
        $('coon').style.height = heightCoon +'px';
        setTimeout("shrinkCo();",10);
    }
	else{
		$('coon').style.display    = 'none';
        $('co').style.display = 'block';
		heightCoon = 298;
		bln_growCo = false;
	}
}
function shrinkTr(){
    if(heightClose < heightTron){
        heightTron = heightTron - 4;
        $('tron').style.height = heightTron +'px';
        setTimeout("shrinkTr();",10);
    }
	else{
		$('tron').style.display    = 'none';
        $('tr').style.display = 'block';
		heightTron = 162;
		bln_growTr = false;
	}
}
function shrinkSh(){
    if(heightClose < heightShon){
        heightShon = heightShon - 4;
        $('shon').style.height = heightShon +'px';
        setTimeout("shrinkSh();",10);
    }
	else{
		$('shon').style.display    = 'none';
        $('sh').style.display = 'block';
		heightShon = 135;
		bln_growSh = false;
	}
}
function shrinkSb(){
    if(heightClose < heightSbon){
        heightSbon = heightSbon - 4;
        $('sbon').style.height = heightSbon +'px';
        setTimeout("shrinkSb();",10);
    }
	else{
		$('sbon').style.display    = 'none';
        $('sb').style.display = 'block';
		heightSbon = 135;
		bln_growSb = false;
	}
}
function shrinkAt(){
    if(heightClose < heightAton){
        heightAton = heightAton - 4;
        $('aton').style.height = heightAton +'px';
        setTimeout("shrinkAt();",10);
    }
	else{
		$('aton').style.display    = 'none';
        $('at').style.display = 'block';
		heightAton = 190;
		bln_growAt = false;
	}
}

function shrink(){
	if($('coon').style.display == 'block' && $('co').style.display == 'none'){
		shrinkCo();
	}
	else if($('tron').style.display == 'block' && $('tr').style.display == 'none'){
		shrinkTr();
	}
	else if($('shon').style.display == 'block' && $('sh').style.display == 'none'){
		shrinkSh();
	}
	else if($('sbon').style.display == 'block' && $('sb').style.display == 'none'){
		shrinkSb();
	}
	else if($('aton').style.display == 'block' && $('at').style.display == 'none'){
		shrinkAt();
	}
}
//**************************************** show hide *****************************************
function showMenu(menuid){
	$(menuid+'on').style.display	= 'block';
    $(menuid).style.display 	= 'none';
}
//********************************************************************************************
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
} 
//*************************************** validation ********************************************
function validate_contact(form){
	var ecount = true;
	if(form.name.value == ""){
		document.getElementById('ename').className = "error"
		document.getElementById('ename').innerHTML = "Please enter your name";
		ecount = false;
	}
	else { document.getElementById('ename').innerHTML = "";}
	if(form.email.value == ""){
		document.getElementById('eemail').className = "error"
		document.getElementById('eemail').innerHTML = "Please enter your email";
		ecount = false;
	}
	else { document.getElementById('eemail').innerHTML = "";}
	if(form.comments.value == ""){
		document.getElementById('ecomments').className = "error"
		document.getElementById('ecomments').innerHTML = "Please enter your questions/comments";
		ecount = false;
	}
	else { document.getElementById('ecomments').innerHTML = "";}
	if(document.getElementById('hearaboutus').selectedIndex == 0){
		document.getElementById('ehearaboutus').className = "error"
		document.getElementById('ehearaboutus').innerHTML = "Please select how you heard about us";
		ecount = false;
	}
	else { document.getElementById('ehearaboutus').innerHTML = "";}
	if(document.getElementById('hearaboutus').selectedIndex == 6 && form.pleasespecify.value == ""){
		document.getElementById('epleasespecify').className = "error"
		document.getElementById('epleasespecify').innerHTML = "Please specify how you heard about us";
		ecount = false;
	}
	else { document.getElementById('epleasespecify').innerHTML = "";}
	return(ecount);
}
function pleasesupply(){
//alert(document.getElementById('hearaboutus').selectedIndex);
	if(document.getElementById('hearaboutus').selectedIndex == 6){
		document.getElementById('pleasespecify').style.display = "block";
	}
	else{
		document.getElementById('pleasespecify').style.display = "none";
	}
}
//***********************************************************************************************************************************
function hide(){
		for (var i = 0; i < arguments.length; i++) {
			var el = $(arguments[i]);
			el.style.display = 'none';
		}
	}
	
function show(){
	for (var i = 0; i < arguments.length; i++) {
		var el = $(arguments[i]);
		el.style.display = '';
	}
}

function toggle() {
	for (var i = 0; i < arguments.length; i++) {
		var el = $(arguments[i]);
		if ( el.style.display != 'none' ) {
			el.style.display = 'none';
		}
		else {
			el.style.display = '';
		}
	}
}
function hidevideo(){
	for (i=1;i<=50;i++){
		//alert('video'+i);
		if($('video'+i)){
			hide('video'+i);
		}
	}
}

function tabs(tabId){
		for(i=1;i<4;i++){
			if(i == tabId){
				$('tab'+i).className = 'on';
				show('tab'+i+'large');
				//alert('show tab'+i+'large');
			}else{
				$('tab'+i).className = '';
				hide('tab'+i+'large');
				//alert('hide tab'+i+'large');
			}
		}
		//setTimeout("tabs("+nextTab+")",5000);
}
