<!--

function initRequest()
{
	if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e1) {
				return null;
			}
		}
	} else if (window.XMLHttpRequest) {
		try {
			req = new XMLHttpRequest();
		} catch (e) {
			return null;
		}
	}

}

function processLayer()
{

	var result;

	if (req.readyState == 4) {
		if (req.status == 200) {
			result = req.responseText;
		} else {
			result = req.statusText;
		}
	} else {
		result = "";
	}

	var zone = document.getElementById('zone');

	try { 
		if (result) {
			zone.innerHTML = result;
		}
	} catch (e) {
		return;
	}

}

function processLayer2(ZZ)
{

	var result;

	if (req.readyState == 4) {
		if (req.status == 200) {
			result = req.responseText;
		} else {
			result = req.statusText;
		}
	} else {
		result = "";
	}
	var zone = document.getElementById(ZZ);
//	var zone2 = document.getElementById('zone2');

	try { 
		if (result) {
			zone.innerHTML = result;
//			zone2.innerHTML = result;
		}
	} catch (e) {
		return;
	}

}

function chg(name,img){
	try {
		name.src = img;
	} catch(e) {
		return;
	}
}

function left_roll() {
	if(subrnum == endSubrnum) {
		subrnum=beginSubrnum;
	} else {
		subrnum++;
	}

	showAdPage(getAdUrl(rnum,subrnum));
}

function right_roll() {
	if(subrnum == beginSubrnum) {
		subrnum=endSubrnum;
	} else {
		subrnum--;
	}

	showAdPage(getAdUrl(rnum,subrnum));
}


function sh_left_roll() {
	if(sh_subrnum == shiny_endSubrnum) {
		sh_subrnum=beginSubrnum;
	} else {
		sh_subrnum++;
	}

	showAdPage(getAdUrl2(rnum,sh_subrnum));
}

function sh_right_roll() {
	if(sh_subrnum == beginSubrnum) { //  ·£´ý¼ý 10 == 
		sh_subrnum=shiny_endSubrnum;
	} else {
		sh_subrnum--;
	}

	showAdPage(getAdUrl2(rnum,sh_subrnum));
}

// small zone left rolling
function sh_left_roll_1()
{
	if(subrnum == big_start) {
		subrnum=big_end;
	} else {
		subrnum--;
	}

	showAdPage(getAdUrl(1,subrnum));
}

// small zone right rolling
function sh_right_roll_1()
{
	if(subrnum == big_end) {
		subrnum=big_start;
	} else {
		subrnum++;
	}

	showAdPage(getAdUrl(1,subrnum));
}

function showAdPage(url) {
	req.open("GET",url,true);
	req.onreadystatechange = processLayer;
	req.send("");
}

function showAdPage2(url,ZONE) {
	req.open("GET",url,true);
	req.onreadystatechange = processLayer2(ZONE);
	req.send("");
}

function BO(O)
{
	document.getElementById(O).style.background='red';
}

function BW(O)
{
	document.getElementById(O).style.background='white';
}

initRequest();

//-->