function BuildSlideShow()
{
/*
   var pObjects=document.getElementById('PortfolioProjects');
   if(pObjects!=null)
   {
		var list=document.getElementById('PortfolioProjects').getElementsByTagName('div');
		for(var i=0;i<list.length;i++)
		{
			if(list[i].id.indexOf('portfolio')>=0)
			{
				$('div[id='+list[i].id+'] a').lightBox();
			}
		}
	}
*/
	$("#PortfolioProjects").find("div.portfolio").each(function(index){
		$('#'+$(this).attr('id')+' .pic a').lightBox();
	});
}
/*------------------------------------------------------------------------------------*/
function show_submenu(cur_div_id) { 
   /*show backa s do 10 diva imenata im da sa div_pm1..div_pm10*/    
	var divname;
	for(var br=0;br<10;br++)
	{
		div_id='div_pm'+br; 
		if(parent.document.getElementById(div_id)){
			pm_obj=parent.document.getElementById(div_id);
			if (pm_obj.style.display=='block'){
				pm_obj.style.display='none';
			}
			else{
				if(div_id == cur_div_id) pm_obj.style.display='block';
			}
		}
	}  
	return false;	
}
/*------------------------------------------------------------------------------------*/
function hide_all_submenu(){
    /*hide backa s do 10 diva imenata im da sa div_pm1..div_pm10*/    
	for(var br=0;br<10;br++)
	{
		div_id='div_pm'+br; 
		if(parent.document.getElementById(div_id)){
			pm_obj=parent.document.getElementById(div_id);						 
			pm_obj.style.display='none';						
		}
	}
	return false;
}

function echeck(str) {
	/*check for valid e_mail------------------------------------------------------------------------------------*/
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){return false}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){return false}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){return false}
	if (str.indexOf(at,(lat+1))!=-1){return false}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){return false}
	if (str.indexOf(dot,(lat+2))==-1){return false}
	if (str.indexOf(" ")!=-1){return false}

return true
} 
/*------------------------------------------------------------------------------------*/
function s_e_mail(){
    /*pre check na  poletata na e_mail formata */	
  if (document.f_mail.firstname.value==0 ){		 
		 alert('Please fill field "First name"');
         document.f_mail.firstname.focus();	
		 return false
	}

  if (document.f_mail.lastname.value==0){		 
		 alert('Please fill field "Last name"');
         document.f_mail.lastname.focus();	
		 return false
	}
   
	if ((document.f_mail.email.value==null || document.f_mail.email.value=="") ){			
		 alert('Please fill field "E-mail"');
		 document.f_mail.email.focus();	
		 return false
	}
    if (echeck(document.f_mail.email.value)==false){
		alert('E-mail is incorect.');
		document.f_mail.email.value="";
		document.f_mail.email.focus();			
		return false
		}  
	if (document.f_mail.phone.value==0 ){		 
		 alert('Please fill field "Phone"');
		 document.f_mail.c_phphoneone.focus();			
		 return false
	}	
    /* post na  poletata na e_mail formata */	
	xajax_xa_send(document.f_mail.firstname.value,document.f_mail.lastname.value,document.f_mail.email.value,document.f_mail.phone.value,document.f_mail.subject.value,document.f_mail.comments.value,document.f_mail.title.value);
	return true;
}
/*------------------------------------------------------------------------------------*/

 
 
