function filterLst(filterType , value){
			
			if( filterType == "loc" )param = "?country="+value;
			if( filterType == "type" )param = "?pjType="+value;
			if( filterType == "prod" )param = "?products="+value;

			obj2 = new AJAX();
			obj2.xmlHttp.onreadystatechange=function()
			  {
					if (obj2.xmlHttp.readyState==1)document.getElementById("listProj").innerHTML = "<p style=' font-family:Verdana; font-size:9px; color:#333333' align='center'><img src='imgs/loading.gif' />&nbsp;&nbsp;<strong>Please Wait...</strong></p>"; 
					if (obj2.xmlHttp.readyState==4){
							document.getElementById("listProj").innerHTML = obj2.xmlHttp.responseText; 
							$(function()
										{
											// this initialises the demo scollpanes on the page.
											$('#pane1').jScrollPane({showArrows:true, scrollbarWidth: 17});
											$('#pane2').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 9});
											$('#pane3').jScrollPane({showArrows:true, scrollbarWidth: 10, arrowSize: 9});
											$('#pane5').jScrollPane({showArrows:true, scrollbarWidth: 10, arrowSize: 9});
											$('#pane4').jScrollPane({scrollbarOnLeft:true});
										});
														}
							}
			url="projects/belowLst.php"+param+"&time="+obj2.time.getTime();
			obj2.xmlHttp.open("GET",url,true);
			obj2.xmlHttp.send(null);
			
			 
			
			}
function filterByCountry(){
	
						    Country = document.getElementById("country").value ;
							filterLst("loc" , Country);
							obj = new AJAX();
							obj.xmlHttp.onreadystatechange=function()
							  {
									if (obj.xmlHttp.readyState==1)document.getElementById("projCell").innerHTML = "<p style=' font-family:Verdana; font-size:9px; color:#333333' align='center'><img src='imgs/loading.gif' />&nbsp;&nbsp;<strong>Please Wait...</strong></p>"; 
									if (obj.xmlHttp.readyState==4)document.getElementById("projCell").innerHTML = obj.xmlHttp.responseText; 
								}
							url="projects/projAjax.php?op=filterPJ&country="+Country+"&time="+obj.time.getTime();
							obj.xmlHttp.open("GET",url,true);
							obj.xmlHttp.send(null);

			}
function filterByProducts(){
		
			str = "";
			prods = document.getElementById("products[]");
		 	for( i=0 ; i < prods.options.length ; i++ ){
				if( prods.options[i].selected == true)str = str + prods.options[i].value + ",";
						}

			filterLst("prod" , str);
			obj = new AJAX();
			obj.xmlHttp.onreadystatechange=function()
			  {
						if (obj.xmlHttp.readyState==1)document.getElementById("projCell").innerHTML = "<p style=' font-family:Verdana; font-size:9px; color:#333333' align='center'><img src='imgs/loading.gif' />&nbsp;&nbsp;<strong>Please Wait...</strong></p>"; 
					if (obj.xmlHttp.readyState==4)document.getElementById("projCell").innerHTML = obj.xmlHttp.responseText; 
				}
			url="projects/projAjax.php?op=filterPJ&products="+str+"&time="+obj.time.getTime();
			obj.xmlHttp.open("GET",url,true);
			obj.xmlHttp.send(null);

			
			}			
function filterByType(){
			
						    type = document.getElementById("projectType").value ;
							filterLst("type" , type);
							obj = new AJAX();
							obj.xmlHttp.onreadystatechange=function()
							  {
								if (obj.xmlHttp.readyState==1)document.getElementById("projCell").innerHTML = "<p style=' font-family:Verdana; font-size:9px; color:#333333' align='center'><img src='imgs/loading.gif' />&nbsp;&nbsp;<strong>Please Wait...</strong></p>";  
									if (obj.xmlHttp.readyState==4){
											document.getElementById("projCell").innerHTML = obj.xmlHttp.responseText; 
											
										}
								}
							url="projects/projAjax.php?op=filterPJ&pjType="+type+"&time="+obj.time.getTime();
							obj.xmlHttp.open("GET",url,true);
							obj.xmlHttp.send(null);

			
			}
			
			
function enlargeImg(itmId){
	
			
			blackPage();
			obj = new AJAX();
			obj.xmlHttp.onreadystatechange=function()
			  {
					if (obj.xmlHttp.readyState==1)document.getElementById("handle").innerHTML = "<div style='background-color:#FFFFFF; font-family:Verdana; font-size:9px; color:#333333' align='left'><img src='imgs/waitImg.gif' />&nbsp;&nbsp;<strong>Please Wait...</strong></div>"; 
					
					if (obj.xmlHttp.readyState==4){
						
						tbl = document.getElementById("imgDivBig");
						width = document.body.scrollWidth;
						Height = document.body.scrollHeight;

						tbl.style.left  = ((width/2) - 450 )  + "px";
						tbl.style.top   = (150) + "px";
						document.body.scrollTop = ((Height/2) - 280);
						document.getElementById("handle").innerHTML = obj.xmlHttp.responseText; 
						
						}
				}
			url="projects/projAjax.php?op=shwPJDt&itmi="+itmId+"&time="+obj.time.getTime();
			obj.xmlHttp.open("GET",url,true);
			obj.xmlHttp.send(null);
			
			
			
			}			
	function blackPage(){
	
			width = document.body.scrollWidth;
			Height = document.body.scrollHeight ;

			document.getElementById("boxy-wrapper").style.width = width+"px";
			document.getElementById("boxy-wrapper").style.height = Height+"px";
			document.getElementById("boxy-wrapper").style.display = "block";
			tbl = document.getElementById("imgDivBig");
			//alert(tbl)
			tbl.style.display = "block";
			tbl.style.zIndex = "1338";
			
			tbl.style.left  = ((width/2) )  + "px";
			tbl.style.top   = ((Height/2)) + "px";
	}			
 function viewImg(imgId , itmId){
	 
			obj = new AJAX();
			obj.xmlHttp.onreadystatechange=function()
			  {
					if (obj.xmlHttp.readyState==1)document.getElementById("imgCell").innerHTML = "<div style='background-color:#FFFFFF; font-family:Verdana; font-size:9px; color:#333333' align='left'><img src='imgs/waitImg.gif' />&nbsp;&nbsp;<strong>Please Wait...</strong></div>"; 
					if (obj.xmlHttp.readyState==4)document.getElementById("imgCell").innerHTML = obj.xmlHttp.responseText; 
				}
			url="projects/projAjax.php?op=shwBig&itmi="+itmId+"&imgi="+imgId+"&time="+obj.time.getTime();
			obj.xmlHttp.open("GET",url,true);
			obj.xmlHttp.send(null);
		}	

	function closeImg(){
	
			document.getElementById("boxy-wrapper").style.display = "none";		
			tbl = document.getElementById("imgDivBig");
			tbl.style.display = "none";
			document.getElementById("handle").innerHTML = "<div style='background-color:#FFFFFF; font-family:Verdana; font-size:9px; color:#333333' align='left'><img src='imgs/waitImg.gif' />&nbsp;&nbsp;<strong>Please Wait...</strong></div>"; 
		}
		//-------------------------------------------
function enlargeImg2(e){
	
		//alert(obj.getAttribute("title"));
		//titleId = obj.getAttribute("title");

		if(!e)e = window.event;
		if(document.all){
				titleId = event.srcElement.parentNode.getAttribute("title");
				if( titleId == "" && event.srcElement.id == "ajaxLink" )titleId = event.srcElement.getAttribute("title");
		}
		else{
				// alert( e );
				titleId =  e.target.parentNode.getAttribute("title");
 				if( titleId == "" && e.target.id == "ajaxLink" )titleId = e.target.getAttribute("title");
			 }

		// alert(" "+titleId);
		docLinks = document.getElementsByTagName("a");

		firstEl = -1;
		 for( i =0 ; i < docLinks.length ; i++  ){
				if(docLinks[i].getAttribute("title") != null ){	  
			
			       if( docLinks[i].getAttribute("title") == titleId ){

					  if(firstEl == -1){firstEl = i;}
					 //if(docLinks[i].id != "") alert(docLinks[i].id)
					  docLinks[i].onclick =  function(){  return hs.expand(this, { captionOverlay: { position: 'rightpanel', width: '220px'} }); }
					}else{
						if(docLinks[i].getAttribute("title").indexOf("link_") > -1 ){
								//alert(docLinks[i].getAttribute("title"));
								if(document.all){
									docLinks[i].onclick =  function(){ return enlargeImg2(e); }
								}else{
							 	docLinks[i].onclick =  function(){ }
								docLinks[i].addEventListener('click',function (e) {
													  return enlargeImg2(e);
													},true);
									}
								}
						}
					}
				}
		    
		if(document.all)docLinks[firstEl].click();
		else return hs.expand(docLinks[firstEl], { captionOverlay: { position: 'rightpanel', width: '220px'} });
			return false;
		}
		

//-------------
function enlargeImg22(e){
	
		//alert(obj.getAttribute("title"));
		//titleId = obj.getAttribute("title");
	 
		if(!e)e = window.event;
		if(document.all){
				titleId = event.srcElement.parentNode.getAttribute("title");
				if( titleId == "" && event.srcElement.id == "ajaxLink" )titleId = event.srcElement.getAttribute("title");
		}
		else{
				 
				titleId = document.getElementById("photoDisplay").childNodes[1].getAttribute("title");
 			//	if( titleId == "" && e.target.id == "ajaxLink" )titleId = e.target.getAttribute("title");
			 }

		 
		docLinks = document.getElementsByTagName("a");

		firstEl = -1;
		 for( i =0 ; i < docLinks.length ; i++  ){
				if(docLinks[i].getAttribute("title") != null ){	  
			
			       if( docLinks[i].getAttribute("title") == titleId ){

					  if(firstEl == -1){firstEl = i;}
					 
					  docLinks[i].onclick =  function(){  return hs.expand(this, { captionOverlay: { position: 'rightpanel', width: '220px'} }); }
					}else{
						if(docLinks[i].getAttribute("title").indexOf("link_") > -1 ){
								//alert(docLinks[i].getAttribute("title"));
								if(document.all){
									docLinks[i].onclick =  function(){ return enlargeImg2(e); }
								}else{
							 	docLinks[i].onclick =  function(){ }
								docLinks[i].addEventListener('click',function (e) {
													  return enlargeImg2(e);
													},true);
									}
								}
						}
					}
				}
		    
		if(document.all)docLinks[firstEl].click();
		else return hs.expand(docLinks[firstEl], { captionOverlay: { position: 'rightpanel', width: '220px'} });
			return false;
		}


//----------------


		function enlargeImg3(linkId){
		
				docLinks = document.getElementsByTagName("a");
			    obj = "";
				 for( i =0 ; i < docLinks.length ; i++  ){
						if(docLinks[i].getAttribute("title") == linkId ){obj = docLinks[i];break;}
				 }
		// obj.click();
		 alert(obj.innerHTML);
		   return hs.expand(obj, { captionOverlay: { position: 'rightpanel', width: '220px'} });
		 }	
