﻿// JScript File
//Detect Browser Type.
var agt=navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);
var iePos  = appVer.indexOf('msie');
if (iePos !=-1) {
  is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
  is_major = parseInt(is_minor);
}
var isMinNS4 = ((navigator.appName.indexOf("Netscape") >= 0 || agt.indexOf("gecko") >= 0) && is_major >= 4) ? true : false;
var isMinNS6 = (agt.indexOf("gecko") >=0 && is_major >= 5) ? true : false;
var isMinIE4 = (document.all) ? true : false;
var isMinIE5 = (isMinIE4==1 && is_major >= 5) ? true : false;
var isMinIE6 = (isMinIE4 && is_major >= 6) ? true : false;
var isDOM = (document.getElementById) ? true : false;
var isSafari = (agt.indexOf("safari") != -1) ? true : false
var isOpera = (agt.indexOf("opera") != -1) ? true : false
var isIE = (isMinIE4 || isMinIE5 ||  isMinIE6);
var isNN = (isMinNS4 || isMinNS6 );

function get(elementName) {
  var ret = null;
  if (isDOM == 1) {
    if(document.getElementById(elementName)) {
      ret = document.getElementById(elementName);
    }
  }  else if (isMinIE4 == 1) {
    if(document.all(elementName)[0]) {
      ret = document.all(elementName)[0];
    }  else {
      ret = document.all(elementName);
    }
  }
  return ret;
}

function openClubMember() {
    window.open('http://visitors.fishingclub.com/SEM_magazine.asp?siteid=100&promotion=9F5COOL4','BecomeaClubMember','width=500,height=540,toolbar=no,scrollbars=yes');
}
function FlagContent(ContentId,ContentType) {
    window.open('../Main/FlagContent.aspx?id=' + ContentId + '&Type=' + ContentType,'FlagContent','width=200,height=200,toolbar=no,scrollbars=no');
}

var styleToSelect;
function onOk() {
// There is no code here. The Modal Popup Extender needs a java script method to call.
}

function ManageBrowser(strOp,objSender)
{
 switch (strOp)
 {
    case "ho":
            objSender.style.behavior = 'url(#default#homepage)';
            objSender.setHomePage (self.location.href);
            break;
    case "af":
            window.external.AddFavorite(self.location.href,document.title);
            break;
 }
}

//function SetUsernameFocus()
//{
//    var ControlToFocus = get("ctl00_Login1_txtUsername");
//    ControlToFocus.focus();
//}

function WatermarkFocus(txtElem, strWatermark) {
 if (txtElem.value == strWatermark) txtElem.value = '';
}
function WatermarkBlur(txtElem, strWatermark) {
 if (txtElem.value == '') txtElem.value = strWatermark;
}
function OpenPopup(url)
{
window.open(url,'popup','width=695,height=775,left=270,top=180,scrollbars=yes')        
}


