// JScript File
function $(ElementId){
return document.getElementById(ElementId);}

//Overrides for overlib.js file
var ol_closeclickEventOverride = "CloseClickReEnableSelect();";
var ol_closeclick=1; // 1=enable close click 0=mouse over close
var ol_bgcolor = "#6699CC"
var ol_fgcolor = "#EEEEEE"
var ol_textcolor = "#4C7A9E";
var ol_closecolor = "#FFFFFF";
var ol_captionsize = "11px";
var ol_closesize = "11px";
var ol_width = "200px";
var ol_close = 'Close';
var ol_closetitle = 'Close';
var ol_fixy = 245;
var ol_fixx = 220;

function resizeItem(controlID, boxwidth, boxheight)
{
var obj = $(controlID);

try
{
 if (obj.style.height) {
 obj.style.height = boxheight;
 obj.style.width = boxwidth;
 }
}
catch(ex)
{
 alert(ex);
}
}

function doFocus()
{
try
{
 document.frmLogin.txtUserName.focus();
 //hideSelect("_ctl0__ctl1_bhcr_t___TitleBarSearchDropDownList");
} catch (e){
 //unhideSelect("_ctl0__ctl1_bhcr_t___TitleBarSearchDropDownList");
}
return true;
}

function CloseClickReEnableSelect()
{
unhideSelect("");
return cClick();
}

function hideSelect(ControlId)
{
var obj = $(ControlId);
if (obj)
 obj.style.visibility="hidden";
}

function unhideSelect(ControlId)
{
var obj = $(ControlId);
if (obj)
 obj.style.visibility="visible";
}


function vote(docid,score) {
window.open("/ISNRatingWeb/ThankYou.aspx?did="+docid+"&rt="+score+"&ppu="+document.location,"ISNRate","width=325,height=250,resizable=0,scrollbars=0");
return false;
}


function readCookie(name)
{
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++)
{
 var c = ca[i];
 while (c.charAt(0)==' ') c = c.substring(1,c.length);
 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function ScrubStringForQuesystring(str)
{
var newString = str;
for(var i = 0;i < str.length;i++)
{
 newString = newString.replace("<", "&lt;");
 newString = newString.replace(">", "&gt;");
 newString = newString.replace("eval\\((.*)\\)", "");
 newString = newString.replace("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\"");
 newString = newString.replace("script", "");
}
newString = escape(newString);
return newString;
}
function tag(ref)
{
var title = ScrubStringForQuesystring(document.title);
window.open(ref+"?turl="+location.protocol+"//"+location.host+location.pathname+"&tdec="+title+"&taID=4","ISNTag","width=700,height=400,resizable=0,scrollbars=1");
}


function eaf(ref, height, width, scrollbar) {
if (scrollbar=="true")
 scrollbar = "yes";
else
 scrollbar = "no";
var leftPos = (screen.availWidth-width)/2, topPos = (screen.availHeight-height)/2;
var title = ScrubStringForQuesystring(document.title);
window.open(ref+"?page="+location.href+"&title="+title,"TellObj","width="+width+",height="+height+", top="+topPos+", left=" + leftPos+", resizable=no,scrollbars="+ scrollbar+",toolbar=no,location=no,status=no,menubar=no");
}



function w(ref, height, width, scrollbar) {
if (scrollbar == "true") { scrollbar = "yes"; } else { scrollbar = "no"; }
window.open(ref+"?page="+location.protocol+"//"+location.host+location.pathname+"&title="+document.title,"TellObj","width="+width+",height="+height+",resizable=no,scrollbars="+ scrollbar+",toolbar=no,location=no,status=no,menubar=no");
}

function InViteFriendToViewEntry(ref, height, width, scrollbar, href) {
if (scrollbar == "true") { scrollbar = "yes"; } else { scrollbar = "no"; }
window.open(ref+"?page="+href+"&title="+document.title,"TellObj","width="+width+",height="+height+",resizable=no,scrollbars="+ scrollbar+",toolbar=no,location=no,status=no,menubar=no");
}

function ShowLargeImage(entryID) {

window.open("LargeView.aspx?entryID="+entryID,"LargeView","width=325,height=325,resizable=0,scrollbars=0");
//return false;
}

function ShowPopUp(imageURL,width,height)
{
window.open("PopUp.aspx?ImageURL="+imageURL + "&width=" + width + "&height=" + height,"ShowPopUp","width=" + width + ",height=" + height + ",resizable=0,scrollbars=0");
}

function searchTags()
{
var url = "/ISNTagWeb/TagSearchList.aspx?stn=" + escape(document.forms[1].stn.value);
window.location.href=url;
}

function w(ref, height, width, scrollbar) {
if (scrollbar == "true") { scrollbar = "yes"; } else { scrollbar = "no"; }
window.open(ref+"?page="+escape(location.protocol+"//"+location.host+location.pathname)+"&title="+escape(document.title),"TellObj","width="+width+",height="+height+",resizable=no,scrollbars="+ scrollbar+",toolbar=no,location=no,status=no,menubar=no");
}

function search()
{
var kw = document.getElementById('kw');
var kb = document.getElementById('ddlKnowledgeBases');
document.frmSearch.Keywords.value = kw.value;
document.frmSearch.KB.value = kb.value;
document.frmSearch.submit();
}