﻿// JScript File
var version=0;
var isie=false;
var runer=null;
var runer_h=0;
var runertop=0;
var img_arr;
var intervalid;
var alp=0;
var st=0;
 var ttl;
  var iid;
function split_paths()
{
 var imgtotalpath=document.getElementById('HiddenField2').value;
 img_arr=imgtotalpath.split("~");
 
 ttl=new Array(img_arr.length);
 iid=new Array(img_arr.length);
 for(q=0;q<img_arr.length;q++)
 {
  ttl[q]=img_arr[q].substr(0,img_arr[q].length-4);
  iid[q]="gallery/big/"+img_arr[q];
 }
 if(img_arr[0]==""){
    img_arr=null;
   
 }
}
function set_pop_img( imgsrc)
{
document.getElementById('popimg').src=iid[imgsrc];
document.getElementById('imgttl').innerHTML=ttl[imgsrc];

}
function show_images()
{

    var str_to_write="";
   
    if(img_arr!=null){
    for(i=st;i<img_arr.length;i++){
       //var iid="'gallery/big/"+img_arr[i]+"'";
       str_to_write+="<a class=\"gallacss\" href=\"javascript:set_pop_img("+i+")\" title=\""+ttl[i]+"\" ><img class=\"gallcss\" src=\"gallery/small/"+img_arr[i]+"\" /></a>";
       if(i>=st+9)
       {
         break;
       }
    }
    st+=10;
    document.getElementById('maindiv').innerHTML=str_to_write;
    if(img_arr.length>st){
      document.getElementById('next').style.visibility="visible";
    }else{
      document.getElementById('next').style.visibility="hidden";
    }
    if(st>10){
      
      document.getElementById('prev').style.visibility="visible";
    }else{
      document.getElementById('prev').style.visibility="hidden";
    }
    }
}

function show_imagesprev()
{

    var str_to_write="";
    st-=20;
    for(i=st;i<img_arr.length;i++){
      // var iid="'gallery/big/"+img_arr[i]+"'";
       str_to_write+="<a class=\"gallacss\" href=\"javascript:set_pop_img("+i+")\" title=\""+ttl[i]+"\" ><img class=\"gallcss\" src=\"gallery/small/"+img_arr[i]+"\" /></a>";
       if(i>=st+9)
       {
         break;
       }
    }
    st+=10;
    document.getElementById('maindiv').innerHTML=str_to_write;
    if(img_arr.length>st){
      
      document.getElementById('next').style.visibility="visible";
    }else{
      document.getElementById('next').style.visibility="hidden";
    }
    if(st>10){
      
      document.getElementById('prev').style.visibility="visible";
    }else{
      document.getElementById('prev').style.visibility="hidden";
    }
}


if (navigator.appVersion.indexOf("MSIE")!=-1){
temp=navigator.appVersion.split("MSIE")
version=parseFloat(temp[1])
}
if (version>=5.5) //NON IE browser will return 0
isie=true;
function adjushome_start(){
        var mac=null;
        var  myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
        mac=1;
        //Non-IE

        myHeight = window.innerHeight;
        } else if( document.documentElement && (document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
        } else if( document.body && (  document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
        }
       // var content_h= 613;
        if(myHeight>613)
        {
        document.getElementById('main').style.top=((myHeight-613)/2).toString(10)+'px';
        }else{
        document.getElementById('main').style.top='0px';
        }
      
       //split_paths();
        
}
function adjushome(){
        var mac=null;
        var  myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
        mac=1;
        //Non-IE

        myHeight = window.innerHeight;
        } else if( document.documentElement && (document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
        } else if( document.body && (  document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
        }
        var content_h= parseInt(document.getElementById('main').style.height.replace(/px/,""));
        if(myHeight>613)
        {
        document.getElementById('main').style.top=((myHeight-content_h)/2).toString(10)+'px';
        }else{
        document.getElementById('main').style.top='0px';
        }
      
       //split_paths();
        
}
function adjushome_withimg(){
       /* var mac=null;
        var  myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
        mac=1;
        //Non-IE

        myHeight = window.innerHeight;
        } else if( document.documentElement && (document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
        } else if( document.body && (  document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
        }
        var content_h= parseInt(document.getElementById('main').style.height.replace(/px/,""));
        if(myHeight>613)
        {
        document.getElementById('main').style.top=((myHeight-content_h)/2).toString(10)+'px';
        }else{
        document.getElementById('main').style.top='0px';
        }*/
      
       
        split_paths();
        show_images();
        
}
function adjushomeinit(){
        var mac=null;
        var  myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
        mac=1;
        //Non-IE

        myHeight = window.innerHeight;
        } else if( document.documentElement && (document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
        } else if( document.body && (  document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
        }
        var content_h= parseInt(document.getElementById('main').style.height.replace(/px/,""));
        if(myHeight>613)
        {
        document.getElementById('main').style.top=((myHeight-content_h)/2).toString(10)+'px';
        }else{
        document.getElementById('main').style.top='0px';
        }
        // document.getElementById('Menu1').style.background-color='transparent';
}

    
  

function runnews()
{
 //adjushome();
    var mailflash = "<embed style=\"z-index: 1000;left:253px;top:197px;position:absolute;\" src=\"banerup1.swf?links='" + Math.round(new Date().getTime() / 30000) + "'\" wmode=\"transparent\" quality=\"high\" bgcolor=\"#ffffff\" width=\"473\" height=\"99\" name=\"main_flash\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
//dror
    var mailflash2 = "<embed style=\"z-index: 1000;left:253px;top:295px;position:absolute;\" src=\"main_flash.swf\" wmode=\"transparent\" quality=\"high\" bgcolor=\"#ffffff\" width=\"473\" height=\"194\" name=\"main_flash\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
//סל אשכולות
    var mailflash3 = "<embed style=\"z-index: 1000;left:253px;top:477px;position:absolute;\" src=\"bottom.swf\" wmode=\"transparent\" quality=\"high\" bgcolor=\"#ffffff\" width=\"474\" height=\"80\" name=\"bottom_flash\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
    
 document.getElementById('main').innerHTML += mailflash;
 document.getElementById('main').innerHTML += mailflash2;
 document.getElementById('main').innerHTML += mailflash3;
 runer=document.getElementById('newsruner');
 runer_h=parseInt(runer.offsetHeight);
 setInterval('runerinterval()',200);
 //alert(runer_h);

}
function runerinterval()
{
runertop-=2;
if(runertop<=(runer_h*(-1))){
   runertop=90;
}
runer.style.top=runertop.toString(10)+'px';
}
function showpop_gall(){

   var qq="alpha(opacity=40)";
  document.getElementById('pop').style.visibility='visible';
  document.getElementById('pop').style.filter="alpha(opacity=0)";
  document.getElementById('pop').style.opacity=".0";
  intervalid=setInterval('popinterval()',30);
  
}
function showpop()
{
  var qq="alpha(opacity=40)";
  document.getElementById('pop').style.visibility='visible';
  document.getElementById('pop').style.filter="alpha(opacity=0)";
  document.getElementById('pop').style.opacity=".0";
  intervalid=setInterval('popinterval()',30);
  document.getElementById('Dropparasha').style.visibility='hidden';
  document.getElementById('Dropyear').style.visibility='hidden';
}

function popinterval()
{
        alp+=5;
        document.getElementById('pop').style.filter='alpha(opacity='+alp.toString(10)+')';
        document.getElementById('pop').style.opacity=(alp/100).toString(10);
        if(alp>=100){
           alp=0;
           clearInterval(intervalid);
        }
}

function Button1_onclick() {
  document.getElementById('pop').style.visibility='hidden';
  document.getElementById('Dropparasha').style.visibility='visible';
  document.getElementById('Dropyear').style.visibility='visible';
}
function Button_img_onclick() {
  document.getElementById('pop').style.visibility='hidden';
  
}

