﻿// JScript File
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function NoDataSelect()
{
    var frm = document.forms[0];
    var idVal="chkContactID";
    var flag =0;
    for (i=0; i<frm.length; i++) 
    {
        if(frm.elements[i].checked == true)
        {
	        return true;
	        flag = 1;
        }
    }
    if (flag == 0)
	{
		alert('None of the record is selected');
		return false;
	}
}
 function openpopupwindow(url,width,height)
{
var x
nsw = (screen.width)/2;
nsh = (screen.height)/2+150;
myLeft = (screen.width-nsw)/2;
myTop = (screen.height-nsh)/2;
var popup = window.open(url,'DetailedView','width='+width+',height='+height+',left='+myLeft+',top='+myTop+',resizable=0,scrollbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,copyhistory=0');
//var popup = window.open('http://localhost:1093/bizforview_newVer2/sendemail.aspx?type=2&Friend='+friend+'&x='+x+'&BLID='+id+'','DetailedView','width='+nsw+',height='+nsh+',left='+myLeft+',top='+myTop+',resizable=0,scrollbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,copyhistory=0');
if (popup == null)
        {
            window.alert('It is Recommended to  Turn OFF your Pop Up Blocker in order to Use this feature');
        }
return false;
}
function trapKeywordEnter(e)
    {
         var unicode=e.keyCode? e.keyCode : e.charCode;
        //alert(unicode);
        //var text=document.getElementById("TxtCompanyName").value;
        var frm=document.forms[0];
        for (var i=0; i<frm.length; i++)
        {
            if (frm.elements[i].id.indexOf("fldKeywordEnter") != -1)
            {
                var fld=document.getElementById(frm.elements[i].id);
                if (unicode==13 ) //checking for Enter Key
                {
                    //alert(text);
                    //CallServer(text,'')
                    //location.replace("Wait.aspx?redirectPage=CompanyNameSearchResults.aspx");
                    //document.getElementById("UcLinePageRightMenu1_UcRightMenuLogin1_btnLogin121").focus();
                    //__doPostBack('btnLogin121','');
                    //return false;
                    fld.value="EnterKeyPressed";
                    //alert(fld.value);
                }
                else
                {
                   fld.value="";
                }
        }
    }
}
function CheckAll()
        {
            if (document.form1.txtKeyword.value =="" && document.form1.txtBusinessID.value=="" && document.form1.txtBusinessName.value=="" && document.form1.txtSellerNumber.value=="" && document.form1.txtSellerName.value=="")
            {
                alert("Please enter the Search Criteria...");
                return false;
            }
            else
            {
                return true;
            }
            
        }
        function validateChkList()
    {    
     var check=document.getElementById("CheckBox1");
     if(check.checked)
     {
      document.getElementById("lblalert").innerHTML = ""; 
     }
     else
     {
      document.getElementById("lblalert").innerHTML = "Please Agree the Terms and Conditons.";
      return false;
     }
     
     var chk=document.getElementById("ChbAle");
      
     if(chk.checked)
     {
      var val=document.getElementById("txtkeyword").value;
    if(val)
    return true;
    var chkList1= document.getElementById("CkbCategory");
    var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
    for(var i=0; i<arrayOfCheckBoxes.length; i++)
    {
        if(arrayOfCheckBoxes[i].checked)
            return true;
    }
        alert('Select an option!');
        return false;
   }
   else
   return true;
   }
  function loadVideo()
  {
    
    var tdVideo = document.getElementById("tdVideo");
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    tdVideo.innerHTML = '<div align="center">\n';
    tdVideo.innerHTML += '<object  id="Player" width="300" height="270"  classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">\r\n';
    tdVideo.innerHTML += '<param  name="Volume"  value="50" />';
    tdVideo.innerHTML +='<param name = "AutoStart"  value="False" />';
    //<param name="URL" value="d:\BizForView\FreeResPlayList.asx" />
    tdVideo.innerHTML +='<param name="URL", value="http://www.bizforview.com/PlayList.asx" />';
    tdVideo.innerHTML +='<param name = "uiMode"  value="full" />';
    tdVideo.innerHTML +='<param name = "enableContextMenu"  value = "false" />';
    tdVideo.innerHTML +='<param name = "windowlessVideo"  value = "false" />';
    }
    else
    {
    tdVideo.innerHTML +='<embed type="application/x-mplayer2" pluginspage = "http://microsoft.com/windows/mediaplayer/en/download/" width="300" height="270" src="http://www.bizforview.com/PlayList.asx" SHOWCONTROLS = "1" SHOWSTATUSBAR = "1"></embed>';
    tdVideo.innerHTML +='</object></div>';
    //alert(navigator.appName);
    }
  }
  function validateChkListOption()
    {    
     var val=document.getElementById("txtkeyword").value;
    if(val)
    return true;
    
    var chkList1= document.getElementById("CkbCategory");
    var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
    for(var i=0; i<arrayOfCheckBoxes.length; i++)
    {
        if(arrayOfCheckBoxes[i].checked)
            return true;
    }
        alert('Select an option!');
        return false;
    }
    function PrintResults(textid)
    {
    alert("asd");
    var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,";
    sOption+="scrollbars=yes,width=750,height=600,left =100,top=25";

    var sWinHTML = document.getElementById(textid).innerHTML;

    var winprint=window.open("","",sOption);
    winprint.document.open();
    winprint.document.write("<html><head><link href=css/cssBizForView.css type=text/css rel=stylesheet /></head><body onload=window.print();>");
    //winprint.document.write("<a href='javascript:;'onclick='window.print();return false'>Print This Page.</a><br />");
    winprint.document.write(sWinHTML);
    winprint.document.write("</body></html>");
    winprint.document.close();
    return false;
    //winprint.focus();
    //winprint.close();
    }