﻿var dontShowError=true;window.onerror=function(msg, url, linenumber){return dontShowError;}
if(top.location!=location)top.location=location;
moveTo(0,0);
resizeTo(screen.availWidth,screen.availHeight);
//MSFPhover=(((navigator.appName == "Netscape")&& 
//    (parseInt(navigator.appVersion)>= 3))|| 
//    ((navigator.appName=="Microsoft Internet Explorer")&& 
//    (parseInt(navigator.appVersion)>=4))); 
window.onload=DoPpreload;
function $(s){return document.getElementById(s)}
//function MSFPpreload(img){var a=new Image();a.src=img;return a;}
function DoPpreload(){
//	 	$("M_Cx1_imgMailGifRight").src="images/email.gif";
//	 	$("M_Cx1_imgMailGifLeft").src="images/email.gif";
//	 	$("M_Cx3_imgMailGif3").src="images/email.gif";
//	 	$("M_Cx1_imgPhoneGifLeft").src="images/phone.gif";
//	 	$("M_Cx1_imgPhoneGifRight").src="images/phone.gif";
//	 	$("M_Cx3_imgPhonegGifButtom").src="images/phone.gif";
	 	AppendInputTypeClasses();
	 	firdom();
	 	OnLineUsers();
}
replaceImages = new Array('טאבו ישראל|images/logo_tabo_israel.gif|imgLogo'
    ,'נסח טאבו באינטרנט התקשר 039229876|images/phone.gif|imgPhone'
    ,'נסח טאבו באמייל|images/email.gif|imgEmail'
    ,'שלח הערה לשיפור השירות טאבו ישראל|images/email.gif|imgEmail3');
function firdom(){
	if(document.getElementsByTagName && document.createElement){
		for (l=1;l<=6;l++){
			h1s=document.getElementsByTagName('h'+l);
			ScanAndReplace(h1s,'h'+l);
		}
	}
}
function ScanAndReplace(h1s,tag){
	for(i=0;i<h1s.length;i++){
		for(f=0;f<replaceImages.length;f++){
			chunks=replaceImages[f].split('|');
			thish1=document.getElementsByTagName(tag)[i];
			if(thish1.firstChild.nodeValue==chunks[0]){
				newImg=document.createElement('img');			
				newImg.setAttribute('alt',chunks[0]);
				newImg.setAttribute('src',chunks[1]);
				newImg.setAttribute('class',chunks[2]);
				// or newImg.src=chunks[1];
				thish1.replaceChild(newImg,thish1.firstChild);
			}
		}
	}
}
function isNumberKey(e){
    var chrCode=(e.which)?e.which:event.keyCode;
    if(getsrcElement(e).id=="M_PH_FVOrder_itnHelka"){
        switch(chrCode){
            case 92: case 47:
                $("M_PH_FVOrder_itnTatHelka").focus();
                return false;
        }
    }
    if(chrCode>31&&(chrCode<48||chrCode>57))
        return false;
        //if(getsrcElement(e).id=="M_PH_FVOrder_itnGush")
    return true;
}
function getsrcElement(e){
	var t;
	if(!e)var e=window.event;
	if(e.target) targ=e.target;
	else if(e.srcElement)t=e.srcElement;
	if(t.nodeType == 3)// defeat Safari bug
		t=t.parentNode;
	return t;
}
function AppendInputTypeClasses(){
    if(!document.getElementsByTagName)return;
    var inputs=document.getElementsByTagName('input');
    for(i=0;i<inputs.length;i++){
        var t=inputs[i];
        if(t.getAttribute('type')){
            t.className=t.getAttribute('type');
            switch(t.getAttribute('type')){
                case 'text': case 'password':
                    t.onfocus=function onfocus(event){this.className='i_Focus';}
                    t.onblur=function onblur(event){this.className='i_Blur';}
                    if(t.id.indexOf("_itn")>0){
                        if(document.all){
                            t.onkeypress=function anonymous(){return isNumberKey(event);}
                        }else{
                            t.onkeypress=function onkeypress(event){return isNumberKey(event);}
                        }
                    }
            }
        }
    }
    inputs=document.getElementsByTagName('textarea');
    for(i=0;i<inputs.length;i++){
        t=inputs[i];
        t.onfocus=function onfocus(event){this.className='i_Focus';}
        t.onblur=function onblur(event){this.className='i_Blur';}
    }
    inputs=document.getElementsByTagName('select');
    for(i=0;i<inputs.length;i++){
        t=inputs[i];
        if(t.onchange==null){
            t.onchange=(document.all)?function anonymous(){document.body.focus();}:function onchange(event){document.body.focus();}
        }
    }
}