/* jSelect (using jQuery library).
*--------------------------------------------*
*  @author : ukhome ( ukhome@gmail.com | ntkhoa_friends@yahoo.com )
*--------------------------------------------*
*  @released : 24-Mar-2009 : version 1.0
*--------------------------------------------*
*  @revision history : ( latest version : 1.0 )
*--------------------------------------------*
*      + 24-Mar-2009 : version 1.0
*          - released
*--------------------------------------------*
*/

/* External Interface
*/

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
    */
	
	var getSelectId = o.select.attr("id");

	if(jQuery("#filter_form").length > 0){
		if(jQuery("#current_type").val() != jQuery("#l_type").val() || jQuery("#current_segment").val() != jQuery("#l_segment").val()){
			jQuery("#filter_form").submit();
		}
	}
	
	// Begin switch site
	if (getSelectId == 'switch_site') {
		location.href = $('#switch_site').val(); 
	}
	// End switch site
	
	//$("#" + getSelectId).parent().prev().hide();
	//$("#" + getSelectId).next().children().eq(0).removeClass("activeLabel");
	//$("#" + getSelectId).parent().prev().removeClass("activeTextExt");
	
}

