function showNews(ID){
	document.location="kiwiw3_news.asp?id="+ID	
}
function MorePage(classSrc,type){
	switch(type){
		case 0:
		document.location="kiwiw3_newsmore.asp?class="+classSrc;
		break;
		case 1:
		document.location="kiwiw3_picmore.asp?class="+classSrc;
		break;
	}
}
function Mover(obj){
	obj.style.backgroundColor="#e9f5c0"
	}
function Mout(obj){
	obj.style.backgroundColor=""
	}
function Web2Flash(args1,args2){
	
	var sendText1 = args1.value;
	var sendText2 = args2.value;
window.document.leftMenu.SetVariable("_root.TitleFromWeb",sendText1);
window.document.leftMenu.SetVariable("_root.URLFromWeb",sendText2);
window.document.leftMenu.SetVariable("_root.go","go");

}

function DrawImage(ImgD,widthMax,heightMax){
var image=new Image() ;
image.src=ImgD.src;
if (image.width>0 && image.height>0){
if (image.width/image.height>= widthMax/heightMax){
if(image.width>widthMax){ 
ImgD.width=widthMax;
ImgD.height=(image.height*widthMax )/image.width;
}else{
ImgD.width=image.width;
ImgD .height=image.height;
}
//ImgD.alt=image.width+"กม"+image.height;
}
else{
if(image.height>heightMax){ 
ImgD.height=heightMax;
ImgD.width=(image.width*heightMax)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt=image.width+"กม"+image.height;
}
}
}
//
function initMarquee() {
		var str=marqueeContent[0];
		document.write('<div id="marqueeBox" style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>');
		marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}
function startMarquee() {
		var str=marqueeContent[marqueeId];
        marqueeId++;
		if(marqueeId>=marqueeContent.length) marqueeId=0;
		if(marqueeBox.childNodes.length==1) {
        var nextLine=document.createElement('DIV');
        nextLine.innerHTML=str;
        marqueeBox.appendChild(nextLine);
        }
		else {
        marqueeBox.childNodes[0].innerHTML=str;
        marqueeBox.appendChild(marqueeBox.childNodes[0]);
        marqueeBox.scrollTop=0;
        }
		clearInterval(marqueeInterval[1]);
		marqueeInterval[1]=setInterval("scrollMarquee()",20);
}
function scrollMarquee() {
		marqueeBox.scrollTop++;
		if(marqueeBox.scrollTop%marqueeHeight==(marqueeHeight-3)){
        clearInterval(marqueeInterval[1]);
		marqueeBox.scrollTop=0;
        }
}
