﻿
function SetPage(PageNumber,ControlId){
    
document.getElementById(ControlId).value = PageNumber
}
function NextClick(){
ReturnCurrentPageNumInput().value = parseInt(ReturnCurrentPageNumInput().value)+1
}
function PrevClick(){
ReturnCurrentPageNumInput().value= parseInt(ReturnCurrentPageNumInput().value)-1
}
function SelectedLinkDropList(elementObj)
{
    if(elementObj.selectedIndex>0)
    {
        WindowOpen(elementObj.item(elementObj.selectedIndex).value,"400","400",null,"LinkWindow") 
    }
}
function WindowOpen(Path,width,height,Params,WindowName)
{

    var x  = (window.screen.availWidth/2)-width/2; 
    var y  = (window.screen.availHeight/2)-height/2;     
    var newWindow  = window.open(Path,WindowName,Params + ",height=" + height + ",width=" + width + ",left=" + x + ",top=" + y + ",status=1,toolbar=1,location=1,menubar=1,resizable=1"); 
    newWindow.focus()
}

function openCloseSubMenu(ElementId)
{
    
    if($(ElementId).style.display == "none")
        $(ElementId).style.display = ""
    else
        $(ElementId).style.display = "none"
}
function loadXML(stringXml)
{
    var xmlDoc;
    // code for IE
    if (window.ActiveXObject)
      {
      xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async=false;
      xmlDoc.loadXML(stringXml);
      
      return xmlDoc; 
      }
    // code for Mozilla, Firefox, Opera, etc.
    else if (document.implementation &&
    document.implementation.createDocument)
      {
      xmlDoc=document.implementation.createDocument("","",null);
      xmlDoc.loadXML(stringXml);
     }
    else
      {
      alert('Your browser cannot handle this script');
      }
      return xmlDoc; 
}


function setCurrentSearchResult()
{
    
  
    
if($('select').selectedIndex!=0)
{
    window.location.href = "Search_Results.aspx?select=" + $('select').item($('select').selectedIndex).value + "&SearchTxt=" + $('search').value  ; 
    
   
}
else
{
    alert('אנא בחר/י קטגוריה')
}

}


function setImageLink(elementObj)
{
    var IndieBanner = new BCS.Web.IndieBanner(elementObj); 
    IndieBanner.dataBind(); 
    //alert(elementObj); 
}