﻿// JavaScript Document
          function showTweet() { 
                document.getElementById('tweet').style.display="block";
                }
        
         function showBlog() { 
                document.getElementById('blog').style.display="block";
                }

          function hide() { 
                document.getElementById('tweet').style.display="none";
                //document.getElementById('blog').style.display="none";
                }
                
		  // AJAX section: call to objects to populate main div
		  
		  function getHTTPObject() {
	        if(typeof XMLHttpRequest != 'undefined') {return new XMLHttpRequest();}
		        try {return new ActiveXObject("Msxml2.XMLHTTP");}
		        catch (e) {
		           try {return new ActiveXObject("Microsoft.XMLHTTP");}
		           catch (e) {}
		           }
		        return false;
		       }
			   
		   var http = getHTTPObject();
		   
		   function useHttpResponse(){
			   if (http.readyState == 4) {
				   document.getElementById('main').innerHTML=http.responseText; 
				   }
			   eval (document.getElementById('main').innerHTML);   
			   }

		  function updateData(value) {
		       //alert('ok');
			   var url = value; 
		       //alert (url);
  		       http.open("GET",url,true);
   		       http.onreadystatechange = useHttpResponse;
		       http.send(null);
		       }
			   


		// change appearance
		 function hlight(value) {
			var item = value;
			//alert(item);
			document.getElementById(item).style.display="block";
			document.getElementById('m_' + item).style.fontWeight="bold"; 
			document.getElementById('m_' + item).style.borderBottom="solid 1px #f79900";
			//document.getElementById('m_' + item).style.borderTop="solid 1px #f79900";
		 }
		 

		 
		 function dlight(value) {
			var item = value;
			//alert(item);
			document.getElementById(item).style.display="none";
			document.getElementById('m_' + item).style.fontWeight="normal"; 
			document.getElementById('m_' + item).style.border="none";
		 } //cell.style.borderRight = "solid 1px #aaaaff"
		 
	 
		 

		//visibility of the sections	   
		
	     function menu(keep) {  // sub-menu items
   			   var key = keep;
			   var url = key +'.php';  //fontWeight= 'bold'
  			   //alert(key);
			   dlight('home');dlight('cv');dlight('gallery');dlight('exhibition');dlight('course_list');
			   dlight('blog'); dlight('news');
			   hlight(key);
 	 		   //alert (url);
			   updateData(url);
   			   }
			   
			   
 		 function s_hlight(value) {
			var item = value;
			//alert(item);
			document.getElementById('m_' + item).style.fontWeight="bold"; 
			//document.getElementById('m_' + item).style.color="#f799ff";
			document.getElementById('m_' + item).style.borderBottom="solid 1px #f79900";
			document.getElementById('m_' + item).style.borderTop="solid 1px #f79900";
		 }
		 
		 function s_dlight(value) {
			var item = value;
			//alert(item);
			document.getElementById('m_' + item).style.fontWeight="normal"; 
			//document.getElementById('m_' + item).style.color="#ccc";
			document.getElementById('m_' + item).style.border="none";
		 }
		 
	     function submenu(keep,target) {  // sub-menu items
   			   var key = keep;
			   var url = target + '\?type=' + keep;  //fontWeight= 'bold'
			      
			   s_dlight('portrait');s_dlight('life');s_dlight('still');s_dlight('drawings');s_dlight('etchings');s_dlight('orchestra');s_dlight('portraitegypt');
			   s_dlight('current');s_dlight('past');
			   s_hlight(key);	
 	 		   //alert (url);
			   updateData(url);
   			   } 
   
   /*
			<a href="#" onClick="submenu('portrait');" id="m_portrait">Portraiture</a> - 
      		<a href="#" onClick="updateData('gallery.php?type=life');" id="m_life">Nudes/Naked portraits</a> - 
       		<a href="#" onClick="updateData('gallery.php?type=still');" id="m_still">Still Life</a> -                     
       		<a href="#" onClick="updateData('gallery.php?type=drawings');" id="m_drawings">Portrait drawings</a> -      
    		<a href="#" onClick="updateData('gallery.php?type=etchings');" id="m_etchings">Etchings</a> - 
       		<a href="#" onClick="updateData('gallery.php?type=orchestra');" id="m_orchestra">Musicians</a> - 
       		<a href="#" onClick="updateData('gallery.php?type=portraitegypt');" id="m_portraitegypt">A Portrait of Egypt</a></div>
    		<a href="#" onClick="updateData('exhibition.php?type=current');" id="m_current">Forthcoming</a> - 
       		<a href="#" onClick="updateData('exhibition.php?type=past');" id="m_past">Pre
	*/
