//=====================================================================
//  USE THIS FILE FOR YOUR MAIN JS FUNTIONS. 
//
//  This could include pop up windows, any google javascript, etc. 
//=====================================================================

function confirmDelete(cat) {
	return window.confirm("Are you sure you want to delete '" + cat + "'?");
}

function popUp(url, width, height, scrollbars, resizable, querystring, windowname) {
	if((typeof(width) == "undefined") || (width == null))	var width	= 500;
	if((typeof(height) == "undefined") || (height == null))	var height	= 400;
	
	if((typeof(scrollbars) == "undefined") || (scrollbars == null))		var scrollbars	= 0;
	if((typeof(resizable) == "undefined") || (resizable == null))		var resizable	= 0;
	if((typeof(querystring) == "undefined") || (querystring == null))	var querystring	= '';
	if((typeof(windowname) == "windowname") || (windowname == null))	var windowname	= 'MarketEASE';
	
	var full_url = url + querystring;

	var w;
	w = window.open(full_url, 'MarketEASE', "width="+width+",height="+height+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+scrollbars+",resizable="+resizable);
	w.focus();
}

if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN	= (navigator.appName=="Netscape") ? 1 : 0;
	var isIE	= (navigator.appName.indexOf("Microsoft")!=-1) ? 1 : 0;
}

var optNN		= 'scrollbars=no,width=500,height=500,left=100,top=100';
var optIE		= 'scrollbars=no,width=150,height=100,left=100,top=100';

function popImage(imageURL,imageTitle) {
	if (isNN)
		imgWin=window.open('about:blank','',optNN);

	if (isIE)
		imgWin=window.open('about:blank','',optIE);

	with (imgWin.document) {
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
		writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');
		writeln('if (isIE){');
		writeln('window.resizeTo(300,300);');
		writeln('width=300-(document.body.clientWidth-document.images[0].width);');
		writeln('height=300-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');
		writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["George"].width;');
		writeln('window.innerHeight=document.images["George"].height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
		writeln('</sc'+'ript>');
		writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
		close();		
	}
}