function Popup(URL, ID, Height, Width) 
{
	var winW = 800;
	var winH = 600;

	if (parseInt(navigator.appVersion)>3) 
	{
		if (navigator.appName=="Netscape") 
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) 
		{
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}

	window.open
	(
		URL + '?NewsID=' + ID, 
		'_blank', 
		'toolbar=0,' +
		'scrollbars=1,' +
		'location=0,' +
		'statusbar=0,' +
		'menubar=0,' +
		'resizable=1,' +
		'top=' + Math.floor((winH - Height) / 2) + ',' +
		'left=' + Math.floor((winW - Width) / 2) + ',' +
		'height=' + Height + ',' +
		'width=' + Width
	);
}


function HuiFuCommand(URL,Alt, ID, Height, Width) 
{
	var winW = 800;
	var winH = 600;

	if (parseInt(navigator.appVersion)>3) 
	{
		if (navigator.appName=="Netscape") 
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) 
		{
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}

	window.open
	(
		URL + '?Alt='+Alt+'&CommentID=' + ID, 
		'_blank', 
		'toolbar=0,' +
		'scrollbars=1,' +
		'location=0,' +
		'statusbar=0,' +
		'menubar=0,' +
		'resizable=1,' +
		'top=' + Math.floor((winH - Height) / 2) + ',' +
		'left=' + Math.floor((winW - Width) / 2) + ',' +
		'height=' + Height + ',' +
		'width=' + Width
	);
}


function Popdown(URL, ID, Height, Width) 
{
	var winW = 800;
	var winH = 600;

	if (parseInt(navigator.appVersion)>3) 
	{
		if (navigator.appName=="Netscape") 
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) 
		{
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}

	var win2 = window.open
	(
		URL + '?id=' + ID, 
		'_blank', 
		'toolbar=0,' +
		'scrollbars=1,' +
		'location=0,' +
		'statusbar=0,' +
		'menubar=0,' +
		'resizable=1,' +
		'top=' + Math.floor((winH - Height) / 2) + ',' +
		'left=' + Math.floor((winW - Width) / 2) + ',' +
		'height=' + Height + ',' +
		'width=' + Width
	);
	win2.blur();
	window.focus();
}

function OpenEmail()
{
    var url = "EmailPage.aspx?url=" + document.location + "&pagetitle=" + document.location;
    EmailPopup(url, 550, 550);
}

function EmailPopup(URL, Height, Width) 
{
	var winW = 800;
	var winH = 600;

	if (parseInt(navigator.appVersion)>3) 
	{
		if (navigator.appName=="Netscape") 
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) 
		{
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}

	window.open
	(
		URL, 
		'_blank', 
		'toolbar=0,' +
		'scrollbars=1,' +
		'location=0,' +
		'statusbar=0,' +
		'menubar=0,' +
		'resizable=1,' +
		'top=' + Math.floor((winH - Height) / 2) + ',' +
		'left=' + Math.floor((winW - Width) / 2) + ',' +
		'height=' + Height + ',' +
		'width=' + Width
	);
}


function PodCodes(URL, ID,ListingID, Height, Width) 
{
	var winW = 800;
	var winH = 600;

	if (parseInt(navigator.appVersion)>3) 
	{
		if (navigator.appName=="Netscape") 
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) 
		{
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}

	var win2 = window.open
	(
		URL + '?Code=' + ID +'&ListingID='+ ListingID, 
		'_blank', 
		'toolbar=0,' +
		'scrollbars=1,' +
		'location=0,' +
		'statusbar=0,' +
		'menubar=0,' +
		'resizable=1,' +
		'top=' + Math.floor((winH - Height) / 2) + ',' +
		'left=' + Math.floor((winW - Width) / 2) + ',' +
		'height=' + Height + ',' +
		'width=' + Width
	);
//	win2.blur();
//	window.focus();
}


function DrawImage(ImgD,FitWidth,FitHeight) 
{ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0) 
{ 
if(image.width/image.height>= FitWidth/FitHeight) 
{ 
if(image.width>FitWidth) 
{ 
ImgD.width=FitWidth; 
ImgD.height=(image.height*FitWidth)/image.width; 
} 
else 
{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
} 
else 
{ 
if(image.height>FitHeight) 
{ 
ImgD.height=FitHeight; 
ImgD.width=(image.width*FitHeight)/image.height; 
} 
else 
{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
} 
} 
} 
 