// JavaScript Document
	
	scrWid = window.screen.width;
	
	function isPercent( number ){
		return number.charAt( number.length - 1 ) == "%";
	}
	
	function normalize( number ){
		if ( isPercent(number) ) return Math.floor( scrWid * parseFloat(number) / 100 );
		return Math.floor( parseFloat(number) );
	}
	
	SPACER = "images/spacer.gif";
	
	function putImage( url, srcOver, srcOut, aWid, aHei, leftSpace, rightSpace, topSpace, bottomSpace, alignType ){
		
                if ( url == "none" ) return;
		
                var wid = normalize( aWid );
		if ( isPercent(aHei) ){
			var hei = Math.floor( wid * parseFloat(aHei) / 100 );
		} 
		else hei = Math.floor( parseFloat(aHei) );
		
		var left = normalize( leftSpace );
		var right = normalize( rightSpace );
		var top = normalize( topSpace );
		var bottom = normalize( bottomSpace );		
			
		if ( alignType == "none" ) alignType = "center";
		
		var tag = " <table align=" + alignType + " border='0'>";
		tag = tag + " <tr><td colSpan='3'><img src=" + SPACER + " height=" + top + " /></td></tr>";
		
		tag = tag + " <tr>";
		tag = tag + " <td width=" + left + " ></td>";
		tag = tag + " <td ><img src= " + url;
		if ( srcOver != "none" ) tag = tag + " onMouseOver='this.src=" + srcOver + "'";
		if ( srcOut  != "none" ) tag = tag + " onMouseOut='this.src=" +  srcOut + "'";
		
		tag = tag + " height=" + hei;
		tag = tag + " width="  + wid;
		tag = tag + " /></td>";
		tag = tag + " <td width=" + right + " ></td></tr>";
		
		tag = tag + " <tr><td colSpan='3'><img src=" + SPACER + " height=" + bottom + " /></td></tr></table>";     

                document.write(tag);
	}

	imgFolder = "images";
	fileType = "jpg";
	abc="fedcba";
	origin=0;
	roll=1;
	
  	var bgr = new Array();
	bgr[origin] = new Array();
	bgr[roll] = new Array();
	
        for(var i=0; i<6; i++){
           bgr[origin][i]     = new Image();
           bgr[roll][i]       = new Image();		
  	   bgr[origin][i].src = imgFolder + "/"  + "bgr_" + abc.charAt(i) + "." + fileType;
  	   bgr[roll][i].src   = imgFolder + "/"  + "bgr_" + abc.charAt(i) + "_Roll" + "." + fileType;		
	}
	
	var page = new Array();
	page[0] = "index.htm";
	page[1] = "literary.htm";
	page[2] = "scientific.htm";
	page[3] = "pictures.htm";
	page[4] = "music.htm";
	page[5] = "contact.htm";	
	
	var text = new Array();
	text[0] = "home.gif";		
	text[1] = "literary.gif";		
	text[2] = "scientific.gif";				
	text[3] = "pictures.gif";		
	text[4] = "music.gif";		
	text[5] = "contact.gif";	
	BUTTON_NUM = 6;	

	function createButtons(){
		var content = "<table width='100%' border='1'>";
		for(var i = 0; i < BUTTON_NUM; i ++ ){
			content = content + " <tr>";
			content = content + " <td background=" + imgFolder + "/" + "bgr_" + abc.charAt(i) + "." + fileType;
			content = content + " onMouseOver='this.background=bgr[roll][" + i + "].src; '" ;
			content = content + " onMouseOut='this.background=bgr[origin][" + i + "].src'";
			content = content + " align = 'center' width='100%'>";
			content = content + " <a href = " + page[i] + ">";
			content = content + " <img src = " + imgFolder + "/" + text[i] + " border='0' />"; 
			content = content + " </a></td></tr>";
		}
		content = content + "</table>";
		document.write(content);
	}
	
	function turnRed(obj){
		obj.style.color = "#FF0000";
		obj.style.backgroundColor = "#FFEBEB";
	}
	
	function turnBlue(obj){
		obj.style.color = "#0000FF";
		obj.style.backgroundColor = "transparent"
	}
	
	function turnDark(obj){
		obj.style.color = "#336600";
		obj.style.backgroundColor = "#99ff33";
	}
	
	function turnLight(obj){
		obj.style.color = "#00AA00";
		obj.style.backgroundColor = "transparent"
	}
	
	
	color1="#FFFFFF";
	color2= "#0000FF";
	color3= "#0000c6";	
	function overLink(obj){
		obj.style.color=color1;
		obj.style.backgroundColor = color2;
        }
	
	function outOfLink(obj){
		obj.style.color=color3;
		obj.style.backgroundColor = "transparent";
        }
	
	color01="#FFFFFF";
	color02= "#0b9403";
	color03= "#156f17";	
	function overInnerLink(obj){
		obj.style.color=color01;
		obj.style.backgroundColor = color02;
        }
	
	function outOfInnerLink(obj){
		obj.style.color=color03;
		obj.style.backgroundColor = "transparent";
        }
	
	function createLinks(){
		var content =  '<a href = "index.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Home </a>&nbsp;|&nbsp; ' + 
                     '<a href = "literary.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Literary Writings </a>&nbsp;|&nbsp; ' + 
                     '<a href = "scientific.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Scientific Writings </a>&nbsp;|&nbsp; ' + 
                     '<a href = "pictures.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Pictures </a> &nbsp;|&nbsp; ' + 
                     '<a href = "music.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Music </a> &nbsp;|&nbsp; ' + 
                     '<a href = "contact.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Contact Us </a> ';
	   document.write(content);
	}
	
	function createLinksForPapers(){
		var content =  '<a href = "../index.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Home </a>&nbsp;|&nbsp; ' + 
                     '<a href = "../literary.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Literary Writings </a>&nbsp;|&nbsp; ' + 
                     '<a href = "../scientific.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Scientific Writings </a>&nbsp;|&nbsp; ' + 
                     '<a href = "../pictures.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Pictures </a> &nbsp;|&nbsp; ' + 
                     '<a href = "../music.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Music </a> &nbsp;|&nbsp; ' + 
                     '<a href = "../contact.htm" class="link" onmouseover="overLink(this); " onmouseout="outOfLink(this)" > &nbsp;Contact Us </a> ';
	   document.write(content);
	}