function slideshowPic(id,type){
	urchinTracker('/clicks/style/artgallery/'+type);
	_em.trackAjaxPageview('/clicks/style/artgallery/'+type);
	var showResponse = function (originalRequest) {
		slideshowPicR = originalRequest.responseText;
		imgTxt = slideshowPicR.substr(0,slideshowPicR.search('###'));
		pTxt = slideshowPicR.substr(slideshowPicR.search('###')+3);
		
		$('dImg').innerHTML = imgTxt;
		$('dImgTxt').innerHTML = pTxt;
	};
	
	var showProgress = function () {
		$('dImg').innerHTML = '<div style="text-align:center"><img src="/images/ajax-loader_big_bgWhite.gif" /></div>';
		$('dImgTxt').innerHTML = 'loading...';
	};

	parameter = "id="+id+"&type="+type+"&current="+$('hiddenNow').value;
	var url = publicdomainobj + "/articleTools/loadSSImg.xml.php";
	var myAjax = new Ajax.Request( url,{method: 'post', parameters: parameter, onLoading: showProgress, onComplete: showResponse});
}
var clipTop = 0;
var clipWidth = 326;
var clipBottom = 309;
var topper = 0;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;

function getObj(name)
{
  if (document.getElementById)
  {
	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = document.layers[name];
	this.style = document.layers[name];
  }
}

function initscroll()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('scroll-list');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		x.style.clip = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
	}
}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;
	if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
	time = setTimeout('realscroll()',theTime);
}

function stopScroll()
{
	if (time) clearTimeout(time);
	if (time2) clearTimeout(time2);
}

var clipLeft = 0;
var clipHeight = 139;
var clipRight = 714;
var topper2 = 0;
var lyrheight2 = 0;
var time2,amount2,theTime2,theHeight2,DHTML2;

function initscroll2()
{
	DHTML2 = (document.getElementById || document.all || document.layers)
	if (!DHTML2) return;
	var x = new getObj('scroll-list2');
	if (document.layers)
	{
		lyrheight2 = x.style.clip.right;
		lyrheight2 += 20;
		x.style.clip.top = 0;
		x.style.clip.left = clipLeft;
		x.style.clip.right = clipRight;
		x.style.clip.bottom = clipHeight;
	}
	else if (document.getElementById || document.all)
	{
		lyrheight2 = x.obj.offsetWidth;
		x.style.clip = 'rect(0,'+clipRight+'px,'+clipHeight+'px,'+clipLeft+'px)';
	}
}

function scrollayer2(layername,amt,tim)
{
	if (!DHTML2) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount2 = amt;
	theTime2 = tim;
	realscroll2();
}

function realscroll2()
{
	if (!DHTML2) return;
	clipLeft += amount2;
	clipRight += amount2;
	topper2 -= amount2;
	if (clipLeft < 0 || clipRight > lyrheight2)
	{
		clipLeft -= amount2;
		clipRight -= amount2;
		topper2 += amount2;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect(0,'+clipRight+'px,'+clipHeight+'px,'+clipLeft+'px)';
		thelayer.style.clip = clipstring;
		thelayer.style.left = topper2 + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.left = clipLeft;
		thelayer.style.clip.right = clipRight;
		thelayer.style.left = topper2;
	}
	time2 = setTimeout('realscroll2()',theTime2);
}


function articleList(obj,channel,pg){

	urchinTracker('/clicks/style/listlatest');
	_em.trackAjaxPageview("/clicks/style/listlatest");
	var showResponse = function (originalRequest) {
		document.getElementById(obj).innerHTML = originalRequest.responseText;
	};

	var showProgress = function () { $(obj).innerHTML = '<div style="text-align:center">Loading, please wait...<br /><img src="/images/ajax-loader_big_bgWhite.gif" /></div>'; }
	parameter = "channel="+channel+"&page="+pg+"&obj="+obj;
	var url = publicdomainobj + "ajax/style_list.php";
	var myAjax = new Ajax.Request( url,{method: 'get', parameters: parameter, onComplete: showResponse, onLoading: showProgress});

}

