function $(domId){return document.getElementById(domId);}
function $A(domName){return document.getElementsByName(domName);}
function $a(domName){return document.getElementsByName(domName)[0];}
function $T(tagName){return document.getElementsBytagName(tagName);}

String.prototype.trim=function(){return String.replace(/^\s*|\s*$/g,'');};

function tag1Over(objid1,objid2,id){
	var tagbuttons=[$("tagButton1"),$("tagButton2"),$("tagButton3"),$("tagButton4")];
	var tagBox=[$("tagBox1"),$("tagBox2"),$("tagBox3"),$("tagBox4")];
	for(var i=0;i<tagbuttons.length;i++){
		tagbuttons[i].className="tagButton";
		tagBox[i].style.display="none";
	}
	$(objid1).className="tagButtonOver";
	$(objid2).style.display="";
}

function tag2Over(objid1,objid2,id){
	var tagbuttons=[$("tag2Button1"),$("tag2Button2"),$("tag2Button3"),$("tag2Button4")];
	var tagBox=[$("tag2Box1"),$("tag2Box2"),$("tag2Box3"),$("tag2Box4")];
	for(var i=0;i<tagbuttons.length;i++){
		tagbuttons[i].className="tagButton";
		tagBox[i].style.display="none";
	}
	$(objid1).className="tagButtonOver";
	$(objid2).style.display="";
}

function imageOver(objid1,objid2,id){
	var tagbuttons=[$("image1"),$("image2"),$("image3")];
	var tagBox=[$("imageBox1"),$("imageBox2"),$("imageBox3")];
	for(var i=0;i<tagbuttons.length;i++){
		tagbuttons[i].className="titleItemDiv";
		tagBox[i].style.display="none";
	}
	$(objid1).className="selectItemDiv";
	$(objid2).style.display="";
} 

function tag31ver(objid1,objid2,id){
	var tagbuttons=[$("houseTitle1"),$("houseTitle2"),$("houseTitle3")];
	var tagBox=[$("houseContent1"),$("houseContent2"),$("houseContent3")];
	for(var i=0;i<tagbuttons.length;i++){
		tagbuttons[i].className="noselect" ;
		tagBox[i].style.display="none";
	}
	$(objid1).className="selected";
	$(objid2).style.display="";
}

function tag51ver(objid1,objid2){
	var tagbuttons=[$("user3"),$("user4")];
	var tagBox=[$("userContent3"),$("userContent4")];
	for(var i=0;i<tagbuttons.length;i++){
		tagbuttons[i].className="" ;
		tagBox[i].style.display="none";
	}
	$(objid1).className="selected";
	$(objid2).style.display="";
}

function tag4Over(objid1,objid2){
	var tagbuttons=[$("other1"),$("other2")];
	var tagBox=[$("otherContent1"),$("otherContent2")];
	for(var i=0;i<tagbuttons.length;i++){
		tagbuttons[i].className="" ;
	}
	$(objid1).className="selected";
}
function tag5Over(objid1,objid2){
	var tagbuttons=[$("other3"),$("other4")];
	var tagBox=[$("otherContent3"),$("otherContent4")];
	for(var i=0;i<tagbuttons.length;i++){
		tagbuttons[i].className="" ;
	}
	$(objid1).className="selected";
}
function tag6Over(objid1,objid2){
	var tagbuttons=[$("other5"),$("other6")];
	var tagBox=[$("otherContent5"),$("otherContent6")];
	for(var i=0;i<tagbuttons.length;i++){
		tagbuttons[i].className="" ;
	}
	$(objid1).className="selected";
}
