// JavaScript Document

function ID(id){
	if (typeof(document.getElementById(id)) != 'null' && typeof(document.getElementById(id)) != 'undefined'){
		return document.getElementById(id);
	}
	return false;
}

function change(parent, elements){
	childs = ID(parent).childNodes;
	for(i=0;i<childs.length;i++){
		if(childs[i].id){
			childs[i].style.display = 'none';
		}
	}	
	
	for(i=0;i<elements.length;i++){
		if(ID(elements[i])){
			ID(elements[i]).style.display = 'block';
		}
	}	
}

function CreateBookmarkLink(Title, URL) {
	if (window.sidebar) {
		window.sidebar.addPanel(Title, URL, "");
	} else if( window.external ) {
		window.external.AddFavorite(URL, Title);
	}
	return true; 
}

function popUp(){
	if(document.getElementById  && document.getElementsByTagName){
		popup = new PopUp();
		popup.addType({
			name: "send",
			width: 395,
			height: 360,
			location:true
		});
		popup.apply();
	}
}

function openSlideshow(id, file, width, height) {
	height = parseInt(height);
	width = parseInt(width);
	height = height +50;
	width = width+10;
	//alert(height+'-'+width);
	window.open(basePath+'includes/inc-slideshow.php?id='+id+'&file='+file, '', 'height='+height+', width='+width+', scrollbars=no');	
	return true;
}
