function showPic(x){
 if (document.getElementById) {
    var sz = document.getElementById('pic');
	sz.setAttribute('src',x);
 } else {
  return true;
 }
}

function shw1(x){
 if (document.getElementById) {
    var sw = document.getElementById('pic1');
	sw.setAttribute('src',x);
 } else {
  return true;
 }
}

function shw2(y){
 if (document.getElementById) {
    var sw2 = document.getElementById('pic2');
	sw2.setAttribute('src',y);
 } else {
  return true;
 }
}

function acdian(opn){		
		if(opn == "empl"){
 		 document.getElementById('empl').style.display = "block";

		}else{
		 document.getElementById('empl').style.display = "none"
		}
		
		if(opn == "location"){
 		 document.getElementById('location').style.display = "block";
		}else{
		 document.getElementById('location').style.display = "none";
		}

		if(opn == "culture"){
 		 document.getElementById('culture').style.display = "block";
		}else{
		 document.getElementById('culture').style.display = "none";
		}
}

if( init==null ){
	var init = true;
	var num = 0;
}

function RotateVars(){
	if( num >= imageArray.length ){
		num=0;
	}

	div = imageArray[num];
	num++;
	setDisplay(div,'brands');
}



//locate container div
// cycle for trigger id
// if match display 
// if not, show none
//	TAB ANYTHING!!!

function setDisplay(div, container, tid) { 
 if (!document.getElementById) return false;
 if(!document.getElementById(container)) return false;

//alert(div + " " + container + " " + tid)
// change color of menu tab according to tab id

function setbg (tid){
	if(tid != null) //
	 if(tid == 'mobi'){
		 document.getElementById('mobi').style.backgroundColor = '#ffffff';
	}
	if(tid == 'hom'){
		 document.getElementById('hom').style.backgroundColor = '#ffffff';
	}
	if(tid == 'com'){
		 document.getElementById('com').style.backgroundColor = '#ffffff';
	}
}

function unset (tid){
	if(tid != 'mobi'){
		 document.getElementById('mobi').style.backgroundColor = '#cccccc';
	}
	if(tid != 'hom'){
		 document.getElementById('hom').style.backgroundColor = '#cccccc';
	}
	if(tid != 'com'){
		 document.getElementById('com').style.backgroundColor = '#cccccc';
	}
}


 var v = document.getElementById(container).childNodes;
 for (i=0; i< v.length; i++){
	var p = v[i].id;
	if(v[i].nodeType != 1){
	v[i].nextSibling;		
	}else if(v[i].nodeType == 1 || v[i].nodeType ==2 || v[i].nodeType ==3){
		if(p == div){
		document.getElementById(p).style.display = "block";
		setbg(tid)
		} else{
		document.getElementById(p).style.display = "none";			
		unset(tid)
		}
  	 }
   }
}