// changFontSize
function changFontSize(id, size) {
	if (document.getElementById(id) != null) {
		document.getElementById(id).style.fontSize = size + "px";
	}
}

// ajax in increament news clickNum
function ajaxIncreamentNewsClickNum(newsId) {
	var desc = new Array();
	desc[0] = document.getElementById("checkName");
	var sqlParam = new Array();
	sqlParam[0] = new SqlParam("id", newsId);
	var url = "ajax/ajaxIncreamentClick.jsp";
	check(desc, url, sqlParam);
}



// cms load start

var images = document.getElementsByTagName("IMG");
var imagesCache = new Array();

	if(images != null) {
		for(var i=0;i<images.length;i++) {
			var url = images[i].src;
			if(!images[i].complete){
				images[i].src = cmsLoadingPic;
				images[i].width = 16;
				images[i].height = 16;
				imagesCache[i] = new Image();
				imagesCache[i].src = url;
			} 
		}
	}
function cmsImagesLoading() {
	
	if(images == null) {
		images = document.getElementsByTagName("IMG");
	}
	if(imagesCache == null) {
		imagesCache = new Array();
	}

	if(imagesCache != null) {
		for(var x=0;x<imagesCache.length;x++) {
			if(imagesCache[x] != null) {
				if(imagesCache[x].readyState ) {
					if(imagesCache[x].readyState == "complete"){
						var tempImage = new Image();
						tempImage.src = imagesCache[x].src;
						
						images[x].src = imagesCache[x].src;
						images[x].width = tempImage.width;
						images[x].heigth = tempImage.heigth;
						
					}
				}
	
			}
	
		}
	}
	


}

setInterval("cmsImagesLoading()",5000);

window.onload = function() {
	cmsOnLoad();
}

function cmsOnLoad() {
	// cms all pic load
	images = null;
	imagesCache = null;
}
// cms load end

// cms image load start
var cmsLoadingPic = "/"+getPath()+"/cmsImages/loading.gif";








// cms image load end

// use other js file (Framework level)
function getPath() {
	var s = top.location.pathname;
	b = s.indexOf('/');
	if(b==0){
		s=s.substring(1,s.length);
	}
	b = s.indexOf('/');
	if(b>0){
		s=s.substring(0,b);
	}
	return s;
}


