
$(document).ready(function() {
	var contentPath=$('#contextPath').val();
	var brand_id = "";
	var b_location = window.location.href;
	if(b_location.indexOf("brands")!=-1){
		brand_id = $('#brand').val();
	}else{
		brand_id = "undefined";
	}
	var url=contentPath+"/en/module/pageInfoAction.do?method=getHomeIconAjax&brandid="+brand_id;
	var onlinetuition_url = "../module/productBrandWebAction.do?method=getOnlinetuition&brandid="+brand_id;
	var htmlstring="";
	$("#leftsub_quicklink").html('');
	$.getJSON(url,function(data){
		$.post(onlinetuition_url,function(item){
			if(item=="true"){
				htmlstring="<div class=\"leftbanner\"><a href=\"../brands/onlinetuition.html?id="+brand_id+"\">"+
				"<img src=\"../images/left_banner01.png\" /></a></div>";
			}
		});
		if(data.iconImage1!=""){
			if(typeof(data.iconImage1)!="undefined"){
				htmlstring+="<div class=\"leftbanner\"><a href=\""+data.iconUrl1+"\">"+"<img src=\""+contentPath+data.iconImage1+"\" /></a></div>";
			}
		}
		if(data.iconImage2!=""){ 
			if(typeof(data.iconImage2)!="undefined"){
				htmlstring+="<div class=\"leftbanner\"><a href=\""+data.iconUrl2+"\">"+"<img src=\""+contentPath+data.iconImage2+"\" /></a></div>";
			}
		}
		$("#leftsub_quicklink").html(htmlstring); 
	});
});
