

function OpenJPG( url, width, height )
{
    var newWindow = window.open( "", "JPGViewer", "location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, scrollbars=no, width=" + width + ", height=" + height + ", resizable=no" );
    
    newWindow.document.writeln
    ( 
        "<html>\n" + 
        "<head>\n" + 
        "<script type=\"text/javascript\">\n" +
        //"function resize()\n{\n" + 
        //"window.resizeTo( " + width + ", " + height + " );\n" +
        "moveTo( screen.width/2-" + width + "/2, screen.height/2-" + height + "/2 );\n" +
        //"}\n" + 
        "</script>\n" +
        "</head>\n" + 
        "<body style=\"margin: 0px; text-align: center;\" onclick=\"window.close();\" >\n" +
        "<img id=\"i1\" src=\"" + url + "\" style=\"border: 0px;\" alt=\"Click to close\">\n" + 
        "</body>\n" + 
        "</html>\n"
    );
    newWindow.document.close();
}

function OpenPDF( url )
{
	window.open( url, "PDFViewer", "location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, scrollbars=no, width=900, height=600, resizable=yes" );
}

function toggleVis( plus, menu, body )
{
	var plusObject = document.getElementById(plus);
	var menuObject = document.getElementById(menu);
	var bodyObject = document.getElementById(body);
		
	if( bodyObject != null )
	{
		if( bodyObject.style.display == 'none' )
		{
			if( menuObject != null ) menuObject.style.display = '';
			if( bodyObject != null ) bodyObject.style.display = '';
			if( plusObject != null ) plusObject.innerHTML = '-';
		}
		else
		{
			if( menuObject != null ) menuObject.style.display = 'none';
			if( bodyObject != null ) bodyObject.style.display = 'none';
			if( plusObject != null ) plusObject.innerHTML = '+';
		}
	}
}


                                        
function OpenImage(URL) 
{ 
    var newWindow = window.open("","JPGViewer","width=320,height=320,resizable,scrollbars=no,status=no");
    
        
    newWindow.document.writeln
    (
        "<html>\n" + 
        "<head>\n" + 
        "<script language=\"javascript\" src=\"/default.js\">\n" +
        "</script>\n " +
        "<BODY style=\"margin: 0px; text-align: center;\" onload=resizeImage(); onclick=window.close();>\n" +
        "<img id=\"i1\" src=\"" + URL + "\" style=\"border: 0px;\" alt=\"Click to close\";>\n" + 
        "</body>\n" + 
        "</html>\n"
    );
    newWindow.document.close();
}
        


 function resizeImage() 
 {
   
                if (window.innerWidth){
                    imageWidth = window.innerWidth;
                    imageHeight = window.innerHeight;
                }else{
                    imageWidth = document.body.clientWidth;
                    imageHeight =document.body.clientHeight;
                }
                moveTo( screen.width/2 - document.images[0].width/2, screen.height/2 - document.images[0].height/2 );
                imageWidth = document.images[0].width - imageWidth;
                imageHeight = document.images[0].height - imageHeight;
                window.resizeBy(imageWidth, imageHeight);
                           
};

function OpenFLV( url, width, height )
{
    var newWindow = window.open( "",null, "location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, scrollbars=no, width=" + width + ", height=" + height + ", resizable=yes" );
    
    newWindow.document.writeln
    ( 
			"<html><head><script type=\"text/javascript\" src=\"http://www.maraizon.com/anarchy_media/anarchy2.js\"></script>\n" + 
			"<body style=\"margin: 0px; text-align: center;\"><a href=\"" + url + "\">" + url + "</a></body></html>\n"
    );
    newWindow.document.close();
};


function OpenFLV2( url, width, height )
{
    var newWindow = window.open( url,"", "location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, scrollbars=no, width=" + width + ", height=" + height + ", resizable=yes" );
    
};


