var newwindow;
function popitup(url, title, iwidth, iheight) {
	if ( !newwindow || newwindow.closed ) {
		newwindow=window.open('','htmlname','width=' + iwidth +',height=' +iheight + ',resizable=1,top=10,left=10');
	}	
	newwindow.document.clear();
	newwindow.focus();
	newwindow.document.writeln('<!DOCTYPE html PUBLIC "-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN" "http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd">');
	newwindow.document.writeln('<html xmlns="http:\/\/www.w3.org\/1999\/xhtml">');
	newwindow.document.writeln('<head>\n<title>' + title + '<\/title>\n<link rel="stylesheet" type="text\/css" href="..\/css\/popup.css" \/>\n<\/head>\n<body>');
	newwindow.document.writeln('<img src="' + url + '" alt="IMG"\/>');
	newwindow.document.writeln('<\/body> <\/html>');
	newwindow.document.close();
	newwindow.focus();
}

function tidy() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}

function menu(str) {
        searchWin = window.open(str,'menu','scrollbars=no,resizable=no,width=344,height=296,status=no,location=no,toolbar=no');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function video(str) {
        searchWin = window.open(str,'video','scrollbars=no,resizable=no,width=360,height=270,status=no,location=no,toolbar=no');
}

function gallery(str) {
        searchWin = window.open(str,'calc','scrollbars=no,resizable=no,width=660,height=660,status=no,location=no,toolbar=no');
}
function mappa(str) {
        searchWin = window.open(str,'mappa','scrollbars=no,resizable=no,width=600,height=600,status=no,location=no,toolbar=no');
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function FlashSolver()
	{
	n=navigator;
	nav=n.appVersion;
	if ((nav.indexOf('Win')!=-1) || (nav.indexOf('NT')!=-1)) 
		{
		if (navigator.appName == "Microsoft Internet Explorer")
			{
			var tmpObject = document.getElementsByTagName('object');
			if (tmpObject && tmpObject.length) 
				{
				for (var i = 0; i < tmpObject.length; i++) 
					{
					if (tmpObject[i].getAttribute('classid').toLowerCase() == 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000') 
						{
						var ps = tmpObject[i].getElementsByTagName('param');
						if (ps && ps != null)
							{
							for (var j = 0; j < ps.length; j++) 
								{
								if (ps[j].getAttribute('name').toLowerCase() == 'flashvars') 
									{
									var variables = ps[j].getAttribute('value');
									break;
									}
								}
							}
						var obj = tmpObject[i].outerHTML + "\n";
						obj = obj.replace(/FLASHVARS" VALUE=""/i,'FLASHVARS" value="'+variables+'"');
						tmpObject[i].outerHTML = obj;
						}
					}
				tmpObject = null;
				}
			}
		}
	}
window.onunload = function()
	{
	n=navigator;
	nav=n.appVersion;
	if ((nav.indexOf('Win')!=-1) || (nav.indexOf('NT')!=-1)) 
		{
		if (navigator.appName == "Microsoft Internet Explorer")
			{
			if (document.getElementsByTagName) 
				{
				var tmpObject = document.getElementsByTagName("object"); 
				for (i=0; i<tmpObject.length; i++)
					{
					tmpObject[i].outerHTML = ""; 
					}
				}
			}
		}
	}

