﻿   function list_state_selectchange(cmbo,args){
        but=$get("button_trigger");
        cities=igcmbo_getComboById(_list_cityID);
        states=igcmbo_getComboById(cmbo);
        cities.Element.disabled=true;
        but.value=states.getDataValue();
        _skipvalidation=true;
        but.click();
    }
    function validate_address(src, args)
    {
        cities=igcmbo_getComboById(_list_cityID);
        states=igcmbo_getComboById(_list_stateID);
        zip=igedit_getById(_text_zipID);
        args.IsValid=_skipvalidation||(states.getDisplayValue()!="") || zip.getText() !="";
        _skipvalidation=false;
    }
    function showMoreImages(listing, imgKey)
    {
        galleryFrame=$find("Dialog_ImageGallery");
        galleryFrame.show();
        $get("input_galleryImageKey").value=imgKey;
        refresh=$get(_button_galleryTriggerID);
        $get("input_gallerylisting").value=listing;
        _skipvalidation=true;
        refresh.click();
        
    }
    function sortListings( column){
        grid=igtbl_getGridById(_grid_listingsID);
        grid.sortColumn(grid.Bands[0].getColumnFromKey(column).Id);
    }   
    function toggleDetails(src){        
        src=src.parentNode.nextSibling;
        
        //Firefox
        while(src!=null&&(!src.tagName || src.tagName!="DIV"))src=src.nextSibling;
        if(!src._baseCSS)src._baseCSS=src.className;
        if(src._expanded){
            src.className= src._baseCSS +" collapsed";
            src._expanded=false;
        }else
        {
            src._expanded=true;
            src.className=this._baseCSS+" expanded";
        }      
    }
function PhotoGallery_Init(imgViewer)
{
    if(!imgViewer.scrollToView)registerImageViewerExtension();
    imgViewer.scrollToView();
}
function pageLoad(args){ 
    registerImageViewerExtension();
}
function registerImageViewerExtension()
{
    Infragistics.Web.UI.WebImageViewer.prototype.scrollToView=function(){
        if(this.get_selectedIndex()>=0){
         this.get_scrollAnimations().get_nextItemAnimation().moveItemIntoFocus(this.get_items().getItem(this.get_selectedIndex()));
        }
    }
}

