﻿$(document).ready(function() {		//File Browse
    $('.SelectUI').addSelectUI({
            scrollbarWidth: 15 //default is 10
    });
});

function callExternalFunction (o/*caller*/, droplists/*all droplists*/, val/*rel in <a>*/) {
    /*
    * o : selectUI object
    *   o.select : <select> in jQuery type
    *   o.elUL : list drop down, main list <ul>
    *----------------------------------------------*
    * droplists : all selectUI droplists in page, call by its id droplists(id), will return selectUI object
    * val : rel value in a of each selectUI option
    */
    if (o.select.val() != null || o.select.val() != "") {
        var id = o.select.val();
        
        var string = location.href;
        if(string.match(/SortBy=\d/)) {
            string = string.replace(/SortBy=\d/, 'SortBy=' + id); 
        } else {
            string = 'Gallery.aspx?SortBy=' + id;
        }
        location.href = string;
    }  
}


