for( var i = 0; i < AllPhotoPreview.length; i++){
AllPhotoPreview[i].onclick = function(){
if(this.classList){
this.classList.add('active')
}
else{
this.active += ' ' + active;
}
}
}
for( var i = 0; i < AllPhotoPreview.length; i++){
AllPhotoPreview[i].onclick = function(){
if(this.classList) {
for (var j = 0; j < AllPhotoPreview.length; j++) {
AllPhotoPreview[j].classList.remove('active');
}
this.classList.add('active');
} else {
this.active += ' ' + active;
}
}
}