function AddBookmark() { 
  window.external.addFavorite(location.href, document.title);
}
function AddStartpage(s) { 
  s.style.behavior ='url(#default#homepage)';
  s.SetHomepage(location.href);
}
function ShowAdd(addToFavorites,addToFavoritesCD,makeStartPage) { 
  if (navigator.appName.indexOf('Microsoft')>=0 && navigator.appVersion.indexOf(4.0)>=0) {
     document.write('<a href=# onClick="AddBookmark();return false"><img src="images/btnfavor.gif" width="19" height="19" border="0" align="absmiddle" hspace="2" alt="'+addToFavorites+'"></a>');
     document.write('<a href=# onClick="AddStartpage(this);return false"><img src="images/btnhome.gif" width="19" height="19" border="0" align="absmiddle" hspace="2" alt="'+makeStartPage+'"></a>');
  } else {
     document.write('<img src="images/btnfavor.gif" width="19" height="19" border="0" align="absmiddle" hspace="2" alt="'+addToFavorites+'" - "'+addToFavoritesCD+'">');
  }
}
function OpenImage(img_f,img_w,img_h,img_d) {
	var leftpos = Math.round(screen.width/2 - img_w/2);
	var toppos = Math.round(screen.height/2 - img_h/2);
	var wwidth = 10 + parseInt(img_w);
	var wheight = 25 + parseInt(img_h);
	var sContent = '<html><head><title>'+img_d+'</title></head><body bgcolor=#FFFFFF text=#000000 marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>';
	sContent += '<table align=center border=0 cellspacing=5 cellpadding=0 width==100% height=100%><tr><td align=center><img src='+img_f+' border=0 align=center width='+img_w+' height='+img_h+' alt=\"\"><br><font size=0>'+img_d+'</font></td></tr></table>';
	sContent += '</body></html>';
	var tWindow=window.open('','image'+img_w+'x'+img_h, 'menubar=0,status=0,toolbar=0,resizable=1,scrollbars=0,width='+wwidth+',height='+wheight+',left='+leftpos+',top='+toppos);
	tWindow.document.open();
	tWindow.document.write(sContent);
	tWindow.document.close();
	tWindow.focus();
}
function OpenImageExt(img_path,str_loading,img_w,img_h) {
	var leftpos = Math.round(screen.width/2 - img_w/2);
	var toppos = Math.round(screen.height/2 - img_h/2);
	var windowwidth = 10 + parseInt(img_w);
	var windowheight = 25 + parseInt(img_h);
	tempWindow = window.open('','image'+img_w+'x'+img_h, 'menubar=0,status=0,toolbar=0,resizable=1,scrollbars=0,width='+windowwidth+',height='+windowheight+',left='+leftpos+',top='+toppos);
	tempWindow.document.write('<HTML><HEAD><TITLE>'+ str_loading +'</TITLE>');
	tempWindow.document.write('<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#336699 ALINK=#003366 VLINK=#003366 MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 LEFTMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 onLoad="window.focus()">');
	tempWindow.document.write('<TABLE BORDER=0 CELLSPACING=5 CELLPADDING=0 WIDTH=100% HEIGHT=100%><TR><TH><FONT SIZE=1>'+ str_loading +'</FONT></TH></TR></TABLE>');
	tempWindow.document.write('</BODY></HTML>');
	tempWindow.document.close();
	tempWindow.location.replace(img_path);
	if (tempWindow) tempWindow.focus();
}
function printContent(id,title) {
	var sContent = '<html><head><title>'+title+'</title><link href="site.css" rel="stylesheet" type="text/css"></head><body>'+document.getElementById(id).innerHTML+'</body></html>';
	var printwindow=window.open("","","toolbar=yes,location=no,directories=yes,menubar=yes,scrollbars=yes,resizable=yes,width=640,height=480,screenX=200,screenY=50");
	printwindow.document.open();
	printwindow.document.write(sContent);
	printwindow.document.close();
	printwindow.focus();
}
function conf(text) {
	return confirm(text+"?");
} 
