
var i =1;
var ewew= 0;

function OpenDiv(openobj, openobj2) {

    document.getElementById(openobj).style.display = "block";
    document.getElementById(openobj2).style.display = "none";
    //document.getElementById(openobj3).style.display = "none";
    $('.scroll-pane').jScrollPane();
}
function CloseDiv(openobj) {
    document.getElementById(openobj).style.display = "none";
}
function CloseDiv(openobj) {
    document.getElementById(openobj).style.display = "none";
}


function writeFlash(flashID, flashMovie, width, height) {

    var t = "";
    t += '<object ';
    t += '	id="' + flashID + '"';
    t += '	classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
    t += '	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" ';
    t += '	width="' + width + '" ';
    t += '	height="' + height + '">';
    t += '		<param name="movie" value="' + flashMovie + '">';
    t += '		<param name="wmode" value="transparent">';
    t += '		<embed wmode="transparent" src="' + flashMovie + '" ';
    t += '			name="' + flashID + '"';
    t += '			quality="high" ';
    t += '			pluginspage="http://www.macromedia.com/go/getflashplayer" ';
    t += '			type="application/x-shockwave-flash" ';
    t += '			width="' + width + '" ';
    t += '			height="' + height + '">';
    t += '		</embed>';
    t += '</object>';

    document.write(t);
}

function checkcontact() {
    if (document.form.FullName.value == "" || document.form.FullName.value == "שם מלא") {
        window.alert("! נא להזין שם מלא");
        document.form.FullName.value = "";
        document.form.FullName.focus();
        return false;
    }




    if (document.form.Phone.value == "" || document.form.Phone.value == "טלפון") {
        window.alert("! נא להזין מספר טלפון חוקי");
        document.form.Phone.value = "";
        document.form.Phone.focus();
        return false;
    }

    var PhonePattern = /(^(\+?\-? *[0-9 \-]+)([,0-9 \-]*)([0-9 \-])*$)|(^ *$)/;

    if (PhonePattern.test(document.form.Phone.value) == false) {
        window.alert("! נא להזין מספר טלפון חוקי");
        document.form.Phone.value = "";
        document.form.Phone.focus();
        return false;
    }

    var EmailPattern = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;

    if (document.form.EMail.value.indexOf('דו') == -1) {
        if (EmailPattern.test(document.form.EMail.value) == false) {
            window.alert("! נא להזין דואר אלקטרוני חוקי");
            document.form.EMail.value = '';
            document.form.Phone.focus();
            return false;
        }

    }
    document.form.action = "DoSendContact.asp";
    document.form.submit();

}



function checkcontactFromPage() {
   if (document.form.CustomerFirstName.value == "") {
        window.alert("! נא להזין שם פרטי");
        document.form.CustomerFirstName.focus();
        return false;
    }
    if (document.form.CustomerPhone1.value == "") {
        window.alert("! נא להזין מספר טלפון");
        document.form.CustomerPhone1.focus();
        return false;
    }
    if (document.form.CustomerEmail.value == "") {
        window.alert("! נא להזין אימייל");
        document.form.CustomerEmail.focus();
        return false;
    }
    document.form.action = "DoSendContact.asp?FromPage=yes";
    document.form.submit();

}


//var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
//if (mobile) {
//    document.location = "http://www.feminisque.com/mobile.asp";
//}  

function ClearField(field) {
    if (field == 'FullName' && document.form.FullName.value == 'שם מלא') {
        document.form.FullName.value = '';
    }
    if (field == 'Phone' && document.form.Phone.value == 'טלפון') {
        document.form.Phone.value = '';
    }

    if (field == 'EMail' && document.form.EMail.value.indexOf('דו') == 0) {
        document.form.EMail.value = '';
    }

}

function CheckField(field) {
    if (field == 'FullName' && document.form.FullName.value == '') {
        document.form.FullName.value = 'שם מלא';
    }
    if (field == 'Phone' && document.form.Phone.value == '') {
        document.form.Phone.value = 'טלפון';
    }

    if (field == 'EMail' && document.form.EMail.value == '') {
        document.form.EMail.value = 'דוא"ל';
    }
}



function movepic(img_name,img_src) {
document[img_name].src=img_src;
}





//- START ONMOUSE OVER COLOR IN TABLE -->
 

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD"&&source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if
(ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TR"||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
source.style.backgroundColor=originalcolor
}
// END ONMOUSE OVER COLOR IN TABLE -->





var win = null;
function NewWindow(mypage,myname,w,h,scroll){

LeftPosition =  (screen.width/2)-(w/2);
TopPosition =  (screen.height/2)-(h/2);


settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}



//----------------------------------- DHTML email validation script -------------------------->

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}
//-------------------------------- DHTML email validation script end -------------------------->




//---------------------------------- onlyDigits -------------------------->
function onlyDigits(e) {
var _ret = true;
if (window.event.keyCode < 46 || window.event.keyCode > 57) {
window.event.keyCode = 0;
_ret = false;
}
return (_ret); 
}
//------------------------------- onlyDigits  end -------------------------->



function IsNumericCheck(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }


   
   
   
   
   



function ChangeClass(b,className){
	b.className=className;
}

// ------------------------------Login Exist -------------------------------------------------


//------------------- load to div---------------------->

function load2(name, div, name2, div2, metaTitle, metaDescription, metaKeywords) {
  document.getElementById(div).innerHTML = "";
  return ahah2(name, div, name2, div2, metaTitle, metaDescription, metaKeywords);
}


function load(name, div) {

    document.getElementById(div).innerHTML = "";
    return ahah(name, div);
}



function unload(name, div) {
 document.getElementById(div).innerHTML = "";
}

function loadunload(name, div) {
if (document.getElementById(div).innerHTML == "") { 
	ahah(name,div);
    }
else{
    document.getElementById(div).innerHTML = "";
   }
}

function loadunload2(name, div,name2, div2,metaTitle, metaDescription, metaKeywords) {
if (document.getElementById(div).innerHTML == "") { 
	ahah2(name,div,name2, div2,metaTitle, metaDescription, metaKeywords);
    }
else{
    document.getElementById(div).innerHTML = "";
   }
}



function ahah(url, target) {
  document.getElementById(target).innerHTML = '';
  if (window.XMLHttpRequest) {
     req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
       req = new ActiveXObject("Msxml2.XMLHTTP");
  }
  

  if (req != undefined) {
    req.onreadystatechange = function() {ahahDone(url, target);};
    req.open("GET", url, true);
    req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=iso-8859-8");
    req.send(null);
  }
}  

function ahah2(url, target,url2, target2,metaTitle, metaDescription, metaKeywords) {
  document.getElementById(target).innerHTML = '';
  if (window.XMLHttpRequest) {
     req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
       req = new ActiveXObject("Msxml2.XMLHTTP");
  }
  

  if (req != undefined) {
    req.onreadystatechange = function() {ahahDone2(url, target,url2, target2,metaTitle, metaDescription, metaKeywords);};
    req.open("GET", url, true);
    req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=iso-8859-8");
    req.send(null);
  }
}

function ahahDone(url, target) {

    if (req.readyState == 4) { // only if req is "loaded"

        if (req.status == 200) { // only if "OK"
            document.getElementById(target).innerHTML = req.responseText;
               } else {
            document.getElementById(target).innerHTML = " AHAH Error:\n" + req.status + "\n" + req.statusText;
        }
    }
}


function ahahDone2(url, target,url2, target2,metaTitle, metaDescription, metaKeywords) {

  if (req.readyState == 4) { // only if req is "loaded"
  
    if (req.status == 200) { // only if "OK"
          document.getElementById(target).innerHTML = req.responseText;
          if(url2!='' && target2!='') {
              load(url2, target2);
             }
          ChangeMetaTags(metaTitle, metaDescription, metaKeywords);
    } else {
      document.getElementById(target).innerHTML=" AHAH Error:\n"+ req.status + "\n" +req.statusText;
    }
  }
}


function ChangeMetaTags(metaTitle, metaDescription, metaKeywords) {
    document.title = metaTitle; 
    $('meta[name=Description]').attr('CONTENT', metaDescription);
    $('meta[name=Keywords]').attr('CONTENT', metaKeywords);
    
}


//------------------load to div end ------------------->







function HebDecode(str) { 
   var str2="";
   var ch;
   
  if(str!="")
  {
   for (j=0;j<str.length;j++)
        {
		ch=str.charCodeAt(j);
		if (str2=='')
		{str2=ch}
		else
		{str2=str2+','+ch}
		
		}
   return str2;
   }
 }

 function OnMouseTitle(id, className) {
     var itm = null;
     if (document.getElementById) {
         itm = document.getElementById(id);
     } else if (document.all) {
         itm = document.all[id];
     } else if (document.layers) {
         itm = document.layers[id];
     }
     itm.className = className;
 }
 

function show(id){
	    var itm = null;
		if (document.getElementById) {
      	itm = document.getElementById(id);
		} else if (document.all){
			itm = document.all[id];
		} else if (document.layers){
			itm = document.layers[id];
		}
		if (itm.style) {
           itm.style.display = ""; 
			
		}
   
}

function hide_span(id)
	{
  
		var itm = null;
		if (document.getElementById) {
			itm = document.getElementById(id);
		} else if (document.all){
			itm = document.all[id];
		} else if (document.layers){
			itm = document.layers[id];
		}
		
    
            itm.style.display = "none"; 
	
            
	}
    


