var d=document;
if (parent.frames.length != 0) parent.location.href=location.href;
// ************************************* //
function isDef(obj)
{
	if( typeof(obj) == 'undefined' || obj == null) return false;
	else return true;
}
// ************************************* //
function getObjSt(name){
	this.style = d.getElementById?d.getElementById(name).style:d.all(name).style;
}
// ************************************* //
function getObj(name){
	return d.getElementById?d.getElementById(name):d.all(name)
}
// ************************************* //
function stat(sMsg){
	if(stat.arguments.length){
		window.status=sMsg;
		return true
	}
	else{
		window.status='';
		return true
	}
}
// ************************************* //
function preload(){
	img=new Array();
	a=preload.arguments;
	for(i=0; i<a.length; i++){
		img[(a[i])]=new Image;
		img[(a[i])].src=a[i];
	}
}
// ************************************* //
function swap(n,i){
	try{
		if(!swap.arguments.length){
			d[r_n].src=r_s;
		}
		else{
			r_s=d[n].src;
			r_n=n;
			d[n].src=img[i].src
		}
	}catch(e){}
}
// ************************************* //
function submit_search(){
	d.forms['search'].submit();
}
// ************************************* //
function hoverTd(i, a, s){
 if(a) {
 	getObj('td'+i).className = s + 'menu_td_cl';
	getObj('ln'+i).className = s + 'lnk_cl';
 }	
 else {
 	getObj('td'+i).className = s + 'menu_td';
	getObj('ln'+i).className = s + 'lnk'; 
 }
}
// ************************************* //
function openGallery(pg, id, gl){
	if(!isDef(gl)) gl = '';
	newWindow('photogallery.php?pg=' + pg + '&id=' + id + '&lg=' + lg + '&gl=' + gl, 10, 50, 500, 400);
	return false;
}
// ************************************* //
function openMap(pg, id){
  newWindow('preview.php?pg=' + pg + '&id=' + id + '&lg=' + lg , 1, 20, 950, 680);	
	
}
// ************************************* //
function newWindow(file,t,l,w,h){
	window.focus();
	if(typeof(msgWindow)=='object') msgWindow.close();
	msgWindow = open('','window1','scrollbars=0,resizable=0,status=1,left='+l+',top='+t+',width='+w+',height='+h);
	msgWindow.location.href = file;
	if(msgWindow.opener == null) msgWindow.opener = self;
} 	

