function popupImage(theImage) {
     //var myWindow=window.open('viewer.php?image=' + theImage,'windowRef','width=500','height=500','resizable=true');
     //if (!myWindow.opener) myWindow.opener = self;
     popUp("../viewer.php?image="+theImage);
}

function redirect(direction){
     window.location=direction;
}


function popupOpinion(){
     day = new Date();
     id = day.getTime();
     eval("page"+id+" = window.open('opinion.php' , '"+ id +"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=728,height=190,left=200,top=150');");
}

function popupRefer(){
     day = new Date();
     id = day.getTime();
     eval("page"+id+" = window.open('refer.php' , '"+ id +"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=728,height=190,left=200,top=150');");
}

function popUp(URL) {
	day = new Date();
	id = day.getTime() + "asd";
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,status=0,width=680,height=550');");
}

function popUp(URL, width, height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,left=400,top=50,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+"');");
}

function popUp2(URL, width, height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,left=300,top=0,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+"');");
}

function getElement(id) {
     return document.getElementById ? document.getElementById(id) :
     document.all ? document.all(id) : null;
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}

}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

function addBookmark(title,url) {
     if (window.sidebar) {
          window.sidebar.addPanel(title, url,"");
     } else if( document.all ) {
          window.external.AddFavorite( url, title);
     } else if( window.opera && window.print ) {
          return true;
     }
}




