﻿function Len(strInput) {
	return strInput.length;
}

function NextBusgoTo(Kav,V) {


	var kAV = Kav;
	var eshkol = kAV.substring(6, 8); //'51';


	if (V == 0) 
	{
		if (kAV.indexOf('A') > -1) {
			kAV = kAV.substring(0, 4);
		}
		else {
			kAV = kAV.substring(0, 3);
		}
	}

	var url = 'http://213.8.94.157/nateev/?com=sham&eshkol=' + eshkol + '&shortRtNum=' + kAV;
	window.open(url, "_blank", "toolbar=yes, location=no,titlebar=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes");//.focus;

	return false;
} 

function createCookie(name, value, days) {
            if (days) {
                var date = new Date();
                date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
                var expires = "; expires=" + date.toGMTString();
            }
            else var expires = "";
            document.cookie = name + "=" + value + expires + "; path=/";
        }

        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 printTable(DivTable) 
{

    // var PrintTopBanner11 = document.getElementById("Level")style.display ='none';
    // PrintTopBanner11.style.display ='none';
    //var PrintTopBanner = document.getElementById("TopBanner");
	//var printContent = document.getElementById("LinesK");
	var printContent = document.getElementById(DivTable);
    var windowUrl = 'about:blank';

  
    var num;
    num = "Print.aspx";
    var uniqueName = new Date();

    var windowName = 'Print' + uniqueName.getTime();
    var printWindow = window.open(windowUrl, windowName, 'left=0,top=0,width=700,height=700');
  
    // var sScript="<script type='text/javascript' language='javascript'> document.getElementById('Level').style.display = 'none';</script>"

    var css;
    css = "<link type='text/css' href='css/UnbsStyle.css' rel='stylesheet' />";
    var PTop;
    PTop = "<div id='Header'><img src='images/TopBannerP.jpg' alt=''/> </div>";
      
    printWindow.document.write(css);
    printWindow.document.write(PTop);
    printWindow.document.write("<div style=\"text-align: center; width: 630px;\" id=\"MT\">");
    printWindow.document.write("<table width='700px'><tr><td align='center'>" + printContent.innerHTML + "</td></tr></table></div>" );
    printWindow.document.close(); printWindow.focus(); printWindow.print();printWindow.close(); 
    //PrintTopBanner11.style.display='inline';
 } 
 
 
 function print(DivTable) 
{

    var printContent = document.getElementById(DivTable);
    var windowUrl = 'about:blank';
 
    var num;
    num = "Print.aspx";
    var uniqueName = new Date();

    var windowName = 'Print' + uniqueName.getTime();
    var printWindow = window.open(windowUrl, windowName, 'left=600000,top=600000,width=0,height=0');
  
    var css;
    css = "<link type='text/css' href='css/UnbsStyle.css' rel='stylesheet' />";
    var PTop;
    PTop = "<div id='Div1'><img src='images/TopBannerP.jpg' alt=''/> </div>";
      
    printWindow.document.write(css);
    printWindow.document.write(PTop);
    printWindow.document.write("<div style='text-align: center; width: 630px;' id='MT'>");
    printWindow.document.write("<table width='700px'><tr><td align='center'>" + printContent.innerHTML + "</td></tr></table></div>" );
    printWindow.document.close(); printWindow.focus(); printWindow.print();printWindow.close(); 
    } 
