

function tab (mod,cursor,n){
//location.href="support_sales_service.aspx?cityId="+cursor;
	for(i=1;i<=n;i++){
		var nav=document.getElementById(mod+"_"+"div"+i)
		var cont=document.getElementById(mod+"_"+"cont"+i);
		nav.style.display=(i==cursor)?"block":"none";
		cont.style.display=(i==cursor)?"block":"none";
	}
}

function showtab (mod,cursor,n){
	for(i=1;i<=n;i++){
		var nav=document.getElementById(mod+i);
		var cont=document.getElementById(mod+"_"+"cont"+i);
		nav.className=(i==cursor)?"on":"";
		cont.style.display=(i==cursor)?"block":"none";
	}
	
}

function protab (mod,cursor,n){
	for(i=1;i<=n;i++){
		var nav=document.getElementById(mod+i);
		var cont=document.getElementById(mod+"_"+"cont"+i);
		nav.className=(i==cursor)?"on":"";
		cont.style.display=(i==cursor)?"block":"none";
	}
	
}


function funtab (mod,cursor,n){
	for(i=1;i<=n;i++){
		var nav=document.getElementById(mod+i);
		var cont=document.getElementById(mod+"_"+"cont"+i);
		nav.className=(i==cursor)?"on":"";
		cont.style.display=(i==cursor)?"block":"none";
	}

}


var flag = false;
function drawImage(ImgD, wth, hht, alt) {
    var salt = alt;
    var image = new Image();
    var iwidth = wth; //定义允许图片宽度
    var iheight = hht; //定义允许图片高度
    image.src = ImgD.src;
    if (image.width > 0 && image.height > 0) {
        flag = true;
        if (image.width / image.height >= iwidth / iheight) {
            if (image.width > iwidth) {
                ImgD.width = iwidth;
                ImgD.height = (image.height * iwidth) / image.width;
            } else {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }

            ImgD.alt = salt;
        } else {
            if (image.height > iheight) {
                ImgD.height = iheight;
                ImgD.width = (image.width * iheight) / image.height;
            } else {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
            ImgD.alt = salt;
        }
    }
}
