
/* ----------------------------------Show Hide Elements---------------------------------- */

function ShowHideDiv(obj){
	document.getElementById(obj).style.display=document.getElementById(obj).style.display=="block"?"none":"block";
}


function openframe(obj){
	document.getElementById("frame_"+obj).style.display=document.getElementById("frame_"+obj).style.display=="block"?"none":"block";	
}






/* ------------------------------rel=external and preload images------------------------------ */

onload = function() {
	// set external links
	var allLinks = document.getElementsByTagName("a");
	for (var ext = 0; ext < allLinks.length; ext++) {
		if (allLinks[ext].rel.length) {
			allLinks[ext].onclick = function() {
				window.open(this.href);
				return false;
			}
		}
	}

}








/* ----------------------------------------Time and Date------------------------------------ */

var dayarray=new Array("יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום שישי","שבת")
var montharray=new Array("ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=24)
dn="PM"
if (hours>24){
hours=hours-24
}
if (hours==0)
hours=24
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var cdate="<span>"+dayarray[day]+", "+daym+" ב"+montharray[month]+", "+year+" &nbsp;|&nbsp; "+hours+":"+minutes+":"+seconds
+"</span>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}




/* ---------------------------------------Popup opener----------------------------------- */

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=800,height=600,left = 100,top = 60');");
}

var browser = navigator.userAgent.toLowerCase();
function fixUglyIE()
{
for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}
if (document.all)
{
document.onmousedown = fixUglyIE;
}

// יצירת עוגייה
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 theCookie=""+document.cookie;
    var ind=theCookie.indexOf(name);
    if (ind==-1 || name=="") return ""; 
    var ind1=theCookie.indexOf(';',ind);
    if (ind1==-1) ind1=theCookie.length; 
    return unescape(theCookie.substring(ind+name.length+1,ind1));
}

// מחיקת עוגייה
function eraseCookie(name){
	createCookie(name,"",-1);
}


/* מסתיר באנר צף */
function hidebnr(){
	CreateCookie('floatbnrclose',true,'')
	document.getElementById('floatbnr').style.display = "none";
}


function bookme(pathe,titl){
if (document.all)
window.external.AddFavorite(pathe,titl)
else if (window.sidebar)
window.sidebar.addPanel(titl, pathe, "")
}


// יצירת מחרוזת אקראית
function GetRandomString(leng){
    var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var s = '';
    for (var i = 0; i < leng; i++) {
        var rnum = Math.floor(Math.random() * chars.length);
        s += chars.substring(rnum, rnum + 1);
    }
    return s;
}


// **** search-results.asp **** //
	function opnmapa(){if (((country3.innerHTML).indexOf('iframe',0)) < 0){tcontent3.innerHTML='\<iframe name=\'mainsiuriframe\' src=\'../demomap.asp?width=563&height=400&id=<%=pageID%>\' width=\'563\' height=\'400\' frameborder=\'0\' marginwidth=\'0\' marginheight=\'0\' \>\<\/iframe\>';}}

	function fncprint(obj) {
	    var total = "";
        var chk = document.getElementById(obj).nn;
        for (var i = 0; i < chk.length; i++) {
	                if (chk[i].checked == true)
	                    total = total + chk[i].value + ",";
        }
        window.open("printestate.asp?idarray=" + total, "", "");
    }
			
			
// **** show.asp **** //
