/**
 * @author kati
 */
		    var lastTab = "persBrev";        
			
			/*
			 * this function executes the file on the server with val parameters and shows the results 
			 *  in the changeElement DOM object
			 */   
            function ajaxFunction(file, val, changeElement){
                
				var xmlhttp;
				if (window.XMLHttpRequest) {
                    // code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp = new XMLHttpRequest();
                }
                else 
                    if (window.ActiveXObject) {
                        // code for IE6, IE5
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    else {
                        alert("Your browser does not support XMLHTTP!");
                    }
                
                xmlhttp.onreadystatechange = function(){
                    if (xmlhttp.readyState == 4) {
                        document.getElementById(changeElement).innerHTML = xmlhttp.responseText;
                    }
                }
                
                xmlhttp.open("GET", file + val, true);
                xmlhttp.send(null);
				
            }
            
			/*
			 * this function changes the choosed tab to that the user clicked on 
			 * and changes the description using ajaxFunction
			 */
            function showDescription(val){   
				//alert("showDescription");
				ajaxFunction("src/showDescription.php?site=", val, 'li-persBrev');
            }
			
			/*
			 * this is called when the page loads
			 * and it set up the persData, interesse and persBrev datas  
			 */
			function loadPage()
			{
				ajaxFunction("src/showDescription.php?site=", 'persData', 'persData');
				//ajaxFunction("src/showDescription.php?site=", 'interesse', 'interesse');
				showDescription('persBrev');				
			}
			
			//window.onload=loadPage('javascriptbol');
			
			/*
			 * this functions shows the popup window with project description
			 */
			function showWindow(projectId)
			{
				if (document.getElementById) { // DOM3 = IE5, NS6
			
					document.getElementById('overlay').style.visibility = 'visible';
					document.getElementById('styled_popup').style.visibility = 'visible';
					
			
				}
				else {
			
					if (document.layers) { // Netscape 4
			
						document.hideShow.visibility = 'visible';
			
					}
			
					else { // IE 4
			
						document.all.hideShow.style.visibility = 'visible';
			
					}
			
				}
			
				ajaxFunction("src/showProjectDescription.php", '?id='+projectId, 'styled_popup');
			
			}

			/*
			 * this function hides the popup window with project descriptions
			 */
			function hideWindow(popup){
			
			    if (document.getElementById) { // DOM3 = IE5, NS6
        	
					document.getElementById('overlay').style.visibility = 'hidden';
					document.getElementById('showHide').style.visibility = 'hidden';
					document.getElementById(popup).style.visibility = 'hidden';
						
    			}
    			else {
        	
					if (document.layers) { // Netscape 4
            
						document.hideShow.visibility = 'hidden';
        	
					}
        			else { // IE 4
            
						document.all.hideShow.style.visibility = 'hidden';
        	
					}
    			}
			}
			
			
			/*
			 * this function will change the src of the name = showSourceLayout iframe object to the
			 *  dir project
			 */
			function visaSource(server, dir, con){
				document.getElementById('styled_popup').style.visibility = 'hidden';
				document.getElementsByName('showSourceLayout')[0].src=server + "/cv/src/showSource.php?dirName="+dir;
				document.getElementById('showSourceLayoutDiv').style.visibility = 'visible';
			}


