var bMNP2 = true;
var strEmailString = "_r=1";
function GetContentWnd(){ return parent; }

function OnEmail(){
var oWnd = 	GetContentWnd();
var oDoc = oWnd.document;
var oDescription = oDoc.getElementById("Description");
var strDescription = ( (oDescription == null) ||
(oDescription.content == "") ) ? oDoc.title : oDescription.content;
if( oDoc.title == "" )
oWnd.location.href =
"mailto:?body="+BuildEmailDescription(strDescription,
AddParamToURL(oWnd.location.href, strEmailString));
else
oWnd.location.href =
"mailto:?subject="+escape(oDoc.title)+"&body="+BuildEmailDescription(strDescription,
AddParamToURL(oWnd.location.href, strEmailString));
return true;
}
function BuildEmailDescription(strDescription,hRef){
return escape("Here's a great article you might be interested in:" +
String.fromCharCode(13)+ String.fromCharCode(13) +
strDescription + String.fromCharCode(13) + "URL: " + hRef);
}
function AddParamToURL(strLoc,strParam){
var i = strLoc.lastIndexOf("?");
if(strLoc.indexOf(strParam, i) >= 0)
return strLoc;

strLoc += ((i >= 0) && (i > strLoc.lastIndexOf("/"))) ? "&" : "?";
return strLoc + strParam;
}
function OnSave(){
window.external.addFavorite(location.href, document.title);
}
//-->


var gAutoPrint = false; // Flag for whether or not to automatically call the print function 

function printSpecial() 
{ 
if (document.getElementById != null) 
{ 
var html = '<HTML>\n<HEAD>\n'; 

if (document.getElementsByTagName != null) 
{ 
var headTags = document.getElementsByTagName("head"); 
if (headTags.length > 0) 
html += headTags[0].innerHTML; 
} 
html += '\n</HE' + 'AD>\n<BODY bgcolor="#ffffff">\n'; 

html +='\n<div align=center style="BACKGROUND-COLOR: #ffffff">\n'; 
html +='\n<img src="/images/printButton.png">&nbsp;<a href="#" onclick="javascript:window.print();">Print Story</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" onclick="javascript:window.close();">Close Window</a>'; 
html +='\n</div>';     
html += '\n<div align=center style="BACKGROUND-COLOR: #ffffff">\n'; 
var printReadyElem = document.getElementById("printTitle");
var printReadyElem2 = document.getElementById("printAuthor"); 
var printReadyElem3 = document.getElementById("printText");

if (printReadyElem != null) 
{ 
html += '<div style="text-align:left;BACKGROUND-COLOR: #ffffff">'+printReadyElem.innerHTML+printReadyElem2.innerHTML+printReadyElem3.innerHTML+'</div>'; 
} 
else 
{ 
alert("Could not find the printReady section in the HTML"); 
return; 
} 

html += '\n</div></BO' + 'DY>\n</HT' + 'ML><table>'; 

var printWin = window.open("","printSpecial","directories=no,location=no,resizable=no,toobar=no,scrollbars=yes,menubar=no,status=no,copyhistory=no,width=575,height=575"); 
printWin.document.open(); 
printWin.document.write(html); 
printWin.document.close(); 
if (gAutoPrint) 
printWin.print(); 
} 
else 
{ 
alert("Sorry, the print ready feature is only available in modern browsers."); 
} 
} 


function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}


function NewWindow(url, w, h) 
{

url = "./Author/Uploads/Photos/" + url + ".jpg"
if (w > screen.width || h > screen.width)
{
if (w > screen.width && h <= screen.height)
{
var nw = screen.width - 70;
var nh = parseInt(h) + 36
}
if (h > screen.height && w <= screen.width)
{
var nh = screen.height - 70;
var nw = parseInt(w) + 36
}
if (w > screen.width && h > screen.height)
{
var nh = screen.height - 70;
var nw = screen.width - 70;
}

window.open(url,"_blank","width=" + nw + ",height=" + nh + ",left=0,top=0,scrollbars=yes,resizable=yes");

}
else
{
var nh = parseInt(h) + 25;
var nw = parseInt(w) + 25;
window.open(url,"_blank","width=" + nw + ",height=" + nh + ",scrollbars=no,resizable=no");
}
}
