﻿function init()
{
	// onmouseover and onmouse out simulation
	if (document.getElementById)
		var x = document.getElementById('h_menu').getElementsByTagName('li');
	else if (document.all)
		var x = document.all['h_menu'].all.tags('li');
	else return;
	for (var i=0; i<x.length; i++) {
		x[i].onmouseover = function () {show(this.id,'des_' + this.id);}
		x[i].onmouseout = function () {reset();}
	}

	// target="_blank" simulation
	if (document.getElementsByTagName)
		var anchor = document.getElementsByTagName('a'); 
	else if (document.all)
		var anchor = document.all.tags('a');
	else return;
	for (var i=0; i<anchor.length; i++) { 
		if (anchor[i].getAttribute("href") && anchor[i].getAttribute("rel") == "external") 
			anchor[i].target = "_blank"; 
	} 
}

var linktext=new Array()
linktext[0]=" "
linktext['students']="Student's Works"
linktext['historic']="Iranian Historic site"
linktext['shop']="Palapalhome Shop"
linktext['forum']="Forum"
linktext['contact']="Contact Us"

linktext['students2']="آرشیو کارهای دانشجویی"
linktext['historic2']="بانک اطلاعات اماکن تاریخی ایران"
linktext['shop2']="فروشگاه"
linktext['forum2']="انجمن_تالاری برای گفتمان معماری"
linktext['contact2']="ارتباط با ما"

function show(thetext,theclass){
	document.getElementById('h_description').innerHTML = '<div style="float: left">' + linktext[thetext] + '</div><div style="float: right">' + linktext[thetext + '2'] + '</div>';
	document.getElementById('h_description').className = theclass;
}

function reset(){
	document.getElementById('h_description').innerHTML= linktext[0];
	document.getElementById('h_description').className = '';
}

window.onload = init;
