var browserWidth=0; 
function getBrowserWidth(){
		if (window.innerWidth){
			return window.innerWidth;}
		else if (document.documentElement && document.documentElement.clientWidth != 0){
			return document.documentElement.clientWidth;	}
		else if (document.body){return document.body.clientWidth;}		
			return 0;
	}
	browserWidth = getBrowserWidth();
	var ie	= document.all
	var ns6	= document.getElementById&&!document.all
	if (!ns6)
	{
		browserWidth=browserWidth+21;
	}
	if(browserWidth<1024){
		document.write('<style type="text/css">\n')
		document.write('#container9 .hdiv {width:360px;}\n')
		document.write('#container9 .lef {FLOAT: left}\n')
		document.write('#container9 .hp {cursor:pointer}\n')
		document.write('#container9 DIV#cont {OVERFLOW: hidden;WIDTH: 360px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 360px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con td{WIDTH: 360px;}\n')
		document.write('#container9 .lef1 {FLOAT: left}\n')
		document.write('#container9 .hp1 {cursor:pointer}\n')
		document.write('#container9 DIV#cont1 {OVERFLOW: hidden;WIDTH: 360px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con1 {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 360px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content1 {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin1 {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con1{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con1 td{WIDTH: 360px;}\n')
		document.write('#container9 .lef2 {FLOAT: left}\n')
		document.write('#container9 .hp2 {cursor:pointer}\n')
		document.write('#container9 DIV#cont2 {OVERFLOW: hidden;WIDTH: 360px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con2 {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 360px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content2 {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin2 {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con2{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con2 td{WIDTH: 360px;}\n')
		document.write('</style>\n')
	}
	else if(browserWidth>=1280){
		document.write('<style type="text/css">\n')
		document.write('#container9 .hdiv {width:655px;}\n')
		document.write('#container9 .lef {FLOAT: left}\n')
		document.write('#container9 .hp {cursor:pointer}\n')
		document.write('#container9 DIV#cont {OVERFLOW: hidden;WIDTH: 655px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 655px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con td{WIDTH: 655px;}\n')
		document.write('#container9 .lef1 {FLOAT: left}\n')
		document.write('#container9 .hp1 {cursor:pointer}\n')
		document.write('#container9 DIV#cont1 {OVERFLOW: hidden;WIDTH: 655px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con1 {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 655px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content1 {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin1 {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con1{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con1 td{WIDTH: 655px;}\n')
		document.write('#container9 .lef2 {FLOAT: left}\n')
		document.write('#container9 .hp2 {cursor:pointer}\n')
		document.write('#container9 DIV#cont2 {OVERFLOW: hidden;WIDTH: 655px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con2 {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 655px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content2 {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin2 {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con2{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con2 td{WIDTH: 655px;}\n')
		document.write('</style>\n')
	}
	else {
		document.write('<style type="text/css">\n')
		document.write('#container9 .hdiv {width:540px;}\n')
		document.write('#container9 .lef {FLOAT: left}\n')
		document.write('#container9 .hp {cursor:pointer}\n')
		document.write('#container9 DIV#cont {OVERFLOW: hidden;WIDTH: 540px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 540px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con td{WIDTH: 540px;}\n')
		document.write('#container9 .lef1 {FLOAT: left}\n')
		document.write('#container9 .hp1 {cursor:pointer}\n')
		document.write('#container9 DIV#cont1 {OVERFLOW: hidden;WIDTH: 540px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con1 {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 540px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content1 {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin1 {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con1{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con1 td{WIDTH: 540px;}\n')
		document.write('#container9 .lef2 {FLOAT: left}\n')
		document.write('#container9 .hp2 {cursor:pointer}\n')
		document.write('#container9 DIV#cont2 {OVERFLOW: hidden;WIDTH: 540px;POSITION: relative;HEIGHT:135px;}\n')
		document.write('#container9 DIV#con-con2 {Z-INDEX: 1;LEFT: 0px;OVERFLOW: hidden;WIDTH: 540px;POSITION: absolute;TOP: 0px;}\n')
		document.write('#container9 DIV.content2 {Z-INDEX: 2;LEFT: 0px;VISIBILITY: hidden;POSITION: relative;TOP: 0px;}\n')
		document.write('#container9 DIV#salin2 {Z-INDEX: 3;right: 0px;POSITION: absolute;TOP: 110px;}\n')
		document.write('#container9 TABLE#tab-con2{WIDTH: 1950px;}\n')
		document.write('#container9 TABLE#tab-con2 td{WIDTH: 540px;}\n')
		document.write('</style>\n')
	}
var mycnt1=1;
var mycnt2=0;
if(browserWidth>=1280)	{
var myarr = new Array(0,0,975,655,655,655);	
} 
else if(browserWidth>=1024)	{
var myarr = new Array(0,0,975,650,540,540);
}
else {
var myarr = new Array(0,0,975,650,487,390);
}


//var mycnt1=1;
//var cnt1=browserWidth >= 1024?0:myarr[mycnt1]
//var mycnt2=0;
//var cnt2=browserWidth >= 1024?0:myarr[mycnt2]
var mycnt3=0; 
	var cnt3=myarr[mycnt3]
var cnt1=myarr[mycnt1]
var cnt2=myarr[mycnt2]
var content ;
var content1 ;
var content2 ;
var contentcontainer ;
var contentcontainer1 ;
var contentcontainer2 ;
var position = 1;
var position1 = 1;
var position2 = 1;
var rot_position = 1;
var rot_position1 = 1;
var rot_position2 = 1;
var rot_timer;
var rot_timer1;
var rot_timer2;
var maxY,maxY1,maxY2,wd,wd1,wd2, maxX, maxX1,maxX2, ready,ready1,ready2, slideDur=1000,slideDur1=1000,slideDur2=1000, destX=0, destX1=0,destX2=0,destY=0,destY1=0,destY2=0, distY,distY1,distY2, distX,distX1,distX2, per,per1,per2, sliding,sliding1,sliding2, slideStart,slideStart1,slideStart2, aniTimer,aniTimer1,aniTimer2, startX, startY, startX1,startX2, startY1,startY2, xcoordinate,xcoordinate1,xcoordinate2, ycoordinate,ycoordinate1,ycoordinate2,url_path_rotation,url_path_rotation1,url_path_rotation2;

function loadcontent()                //To decide which function will call at onload 
{
	if(1)
	{
		load('tab-con',2800,'ts/');
	}
	else if(0)
	{
		load2('tab-con2',2800,'ts/');
	}
	else if(0)
	{
		load1('tab-con1',2800,'ts/');
	}
	else
	{
	return ;
	}
}

/*---------------------------------------FOR NEW PRODUCTS-----------------------------------*/
function load(cntId,rot_value,url_path)
{
	clearInterval(rot_timer1);
	clearInterval(rot_timer2);
	position = 0;
	url_path_rotation = url_path;
	if(!document.getElementById)
		return;

	content = document.getElementById("content"); 
	contentcontainer = document.getElementById("con-con"); 

	content.visibility="hidden";
	content.style.top=0;
	content.style.left=0;
	xcoordinate=0;
	ycoordinate=0;
	maxY=(content.offsetHeight-contentcontainer.offsetHeight>0)?content.offsetHeight-contentcontainer.offsetHeight:0;
	wd=cntId?document.getElementById(cntId).offsetWidth:content.offsetWidth;
	maxX=(wd-contentcontainer.offsetWidth>0)?wd-contentcontainer.offsetWidth:0;
	content.style.visibility="visible";
	ready=true;
	document.getElementById("salin").style.visibility="visible";
	rot_timer = setInterval("do_rotation()",rot_value);
 }
 
 function glideTo(MstartX, MstartY)
{
	content = document.getElementById("content"); 
	contentcontainer = document.getElementById("con-con");
	startX = parseInt(content.style.left);
	if(startX == "")
	{
		startX = 0;
	}
	startY = parseInt(content.style.top);
	destX = -Math.max(Math.min(MstartX, maxX), 0);
	destY = -Math.max(Math.min(MstartY, maxY), 0);
	distY = destY - startY;
	distX =  destX - startX;
	per = Math.PI/(2 * slideDur);
	sliding = false;
	slideStart = (new Date()).getTime();
	aniTimer = setInterval("doSlide()",10);
	on_slide_start(startX, startY);
}

function doSlide() 
{
	var elapsed = (new Date()).getTime() - slideStart;
	if (elapsed < slideDur) 
	{
		var x = startX + distX * Math.sin(per*elapsed);
		var y = startY + distY * Math.sin(per*elapsed);
		shiftTo(x, y);
		on_slide(x, y);
	} 
	else
	{	// if time's up
		clearInterval(aniTimer);
		sliding = false;
		shiftTo(destX, destY);
		//content = null;
		on_slide_end(destX, destY);
	}
}

function shiftTo(x,y)
{
	 if(typeof(x) == "number")
	 {
		content.style.left=x+"px";
		content.style.top=y+"px";
	 }
}

on_slide_start = function() {}
on_slide = function() {}
on_slide_end = function() {}

function slide(id,img_url)
{
	clearInterval(rot_timer);
	position = id;
	glideTo(eval(id-1) * cnt1,0);
	for(var z=1;z<=1;z++)
	{
		if(id == z)
		{
			document.getElementById("slide" + id).src = img_url + "slide-on.gif";
		}
		else
		{
			document.getElementById("slide" + z).src = img_url + "slide-off.gif";
		}
	}
	if(id == 1)
	{
		disableAnchor(document.getElementById("slidenext"),true);
		document.getElementById("image_next").src = url_path_rotation + "next-disable.gif";
		disableAnchor(document.getElementById("spre"),false);
		document.getElementById("ipre").src = url_path_rotation + "prev.gif";
	}
	if(id == 1)
	{
		disableAnchor(document.getElementById("spre"),true);
		document.getElementById("ipre").src = url_path_rotation + "prev-disable.gif";
		disableAnchor(document.getElementById("slidenext"),false);
		document.getElementById("image_next").src = url_path_rotation + "next.gif";
	}
	if(position > 1  && position < 1)
	{
		disableAnchor(document.getElementById("slidenext"),false);
		document.getElementById("image_next").src = url_path_rotation + "next.gif";
		disableAnchor(document.getElementById("spre"),false);
		document.getElementById("ipre").src = url_path_rotation + "prev.gif";
	}
}

function npre(str,img_url)
{
	clearInterval(rot_timer);
	if(str == "next")
	{
		if(document.getElementById("spre").href == "")
		{
			if(position != 1)
			{
				disableAnchor(document.getElementById("spre"),false);
				document.getElementById("ipre").src = url_path_rotation + "prev.gif";
			}
		}
		if(position < 1)
		{
			position++;
			glideTo(eval(position-1) * cnt1,0);
			disableAnchor(document.getElementById("slidenext"),false);
			document.getElementById("image_next").src = url_path_rotation + "next.gif";
		}
		if(position == 1)
		{
			disableAnchor(document.getElementById("slidenext"),true);
			document.getElementById("image_next").src = url_path_rotation + "next-disable.gif";
		}
		
	}
	if(str == "pre")
	{
		if(document.getElementById("slidenext").href == "")
		{
			disableAnchor(document.getElementById("slidenext"),false);
			document.getElementById("image_next").src = url_path_rotation + "next.gif";
		}
		if(position > 1)
		{
			position--;
			glideTo(eval(position-1) * cnt1,0);
			disableAnchor(document.getElementById("spre"),false);
			document.getElementById("ipre").src = url_path_rotation + "prev.gif";
		}
		if(position == 1)
		{
			disableAnchor(document.getElementById("spre"),true);
			document.getElementById("ipre").src = url_path_rotation + "prev-disable.gif";
		}

	}
	for(var z=1;z<=1;z++)
	{
		if(position == z)
		{
			document.getElementById("slide" + position).src = img_url + "slide-on.gif";
		}
		else
		{
			document.getElementById("slide" + z).src = img_url + "slide-off.gif";
		}
	}

}

function do_rotation()
{
	if(position < 1)
	{
		position++;
		glideTo(eval(position-1) * cnt1,0);
	}
	else
	{
		position = 1;
		content.style.left="0px";
		content.style.top="0px";
	}
	for(var z=1;z<=1;z++)
	{
		if(position == z)
		{
			document.getElementById("slide" + position).src = url_path_rotation + "slide-on.gif";
		}
		else
		{
			document.getElementById("slide" + z).src = url_path_rotation + "slide-off.gif";
		}
	}
}

function disableAnchor(obj, disable)
{
	if(disable)
	{
		var href = obj.getAttribute("href");
		obj.removeAttribute('href');
	}
	else
	{
		if(obj.id == "slidenext")
		{
			obj.setAttribute('href',"Javascript:npre('next','" + url_path_rotation + "')");
		}
		if(obj.id == "spre")
		{
			obj.setAttribute('href',"Javascript:npre('pre','" + url_path_rotation + "')");
		}
	}
}


/*---------------------------------------FOR HOT PRODUCTS-----------------------------------*/

function load1(cntId,rot_value,url_path)
{
	clearInterval(rot_timer);
	clearInterval(rot_timer2);
	position1 = 0;
	url_path_rotation1 = url_path;
	if(!document.getElementById)
		return;

	content1 = document.getElementById("content1"); 
	contentcontainer1 = document.getElementById("con-con1"); 

	content1.visibility="hidden";
	content1.style.top=0;
	content1.style.left=0;
	xcoordinate1=0;
	ycoordinate1=0;
	maxY1=(content1.offsetHeight-contentcontainer1.offsetHeight>0)?content1.offsetHeight-contentcontainer1.offsetHeight:0;
	wd1=cntId?document.getElementById(cntId).offsetWidth:content1.offsetWidth;
	maxX1=(wd1-contentcontainer1.offsetWidth>0)?wd1-contentcontainer1.offsetWidth:0;
	content1.style.visibility="visible";
	ready1=true;
	document.getElementById("salin1").style.visibility="visible";
	rot_timer1 = setInterval("do_rotation1()",rot_value);
 } 
 



function glideTo1(MstartX, MstartY)
{
	content1 = document.getElementById("content1"); 
	contentcontainer1 = document.getElementById("con-con1");
	startX1 = parseInt(content1.style.left);
	if(startX1 == "")
	{
		startX1 = 0;
	}
	startY1 = parseInt(content1.style.top);
	destX1 = -Math.max(Math.min(MstartX, maxX1), 0);
	destY1 = -Math.max(Math.min(MstartY, maxY1), 0);
	distY1 = destY1 - startY1;
	distX1 =  destX1 - startX1;
	per1 = Math.PI/(2 * slideDur1);
	sliding1 = false;
	slideStart1 = (new Date()).getTime();
	aniTimer1 = setInterval("doSlide1()",10);
	on_slide_start1(startX1, startY1);
}


function doSlide1() 
{
	var elapsed = (new Date()).getTime() - slideStart1;
	if (elapsed < slideDur1) 
	{
		var x = startX1 + distX1 * Math.sin(per1*elapsed);
		var y = startY1 + distY1 * Math.sin(per1*elapsed);
		shiftTo1(x, y);
		on_slide1(x, y);
	} 
	else
	{	// if time's up
		clearInterval(aniTimer1);
		sliding1 = false;
		shiftTo1(destX1, destY1);
		//content = null;
		on_slide_end1(destX1, destY1);
	}
}

function shiftTo1(x,y)
{
	 if(typeof(x) == "number")
	 {
		content1.style.left=x+"px";
		content1.style.top=y+"px";
	 }
}

on_slide_start1 = function() {}
on_slide1 = function() {}
on_slide_end1 = function() {}

function slider(id,img_url)
{
	clearInterval(rot_timer1);
	position1 = id;
	glideTo1(eval(id-1) * cnt2,0);
	for(var z=1;z<=0;z++)
	{
		if(id == z)
		{
			document.getElementById("slider" + id).src = img_url + "slide-on.gif";
		}
		else
		{
			document.getElementById("slider" + z).src = img_url + "slide-off.gif";
		}
	}
	if(id == 0)
	{
		disableAnchor1(document.getElementById("slidenext1"),true);
		document.getElementById("image_next1").src = url_path_rotation1 + "next-disable.gif";
		disableAnchor1(document.getElementById("spre1"),false);
		document.getElementById("ipre1").src = url_path_rotation1 + "prev.gif";
	}
	if(id == 1)
	{
		disableAnchor1(document.getElementById("spre1"),true);
		document.getElementById("ipre1").src = url_path_rotation1 + "prev-disable.gif";
		disableAnchor1(document.getElementById("slidenext1"),false);
		document.getElementById("image_next1").src = url_path_rotation1 + "next.gif";
	}
	if(position1 > 1  && position1 < 0)
	{
		disableAnchor1(document.getElementById("slidenext1"),false);
		document.getElementById("image_next1").src = url_path_rotation1 + "next.gif";
		disableAnchor1(document.getElementById("spre1"),false);
		document.getElementById("ipre1").src = url_path_rotation1 + "prev.gif";
	}
}



function npre1(str,img_url)
{
	clearInterval(rot_timer1);
	if(str == "next")
	{
		if(document.getElementById("spre1").href == "")
		{
			if(position1 != 0)
			{
				disableAnchor1(document.getElementById("spre1"),false);
				document.getElementById("ipre1").src = url_path_rotation1 + "prev.gif";
			}
		}
		if(position1 < 0)
		{
			position1++;
			glideTo1(eval(position1-1) * cnt2,0);
			disableAnchor1(document.getElementById("slidenext1"),false);
			document.getElementById("image_next1").src = url_path_rotation1 + "next.gif";
		}
		if(position1 == 0)
		{
			disableAnchor1(document.getElementById("slidenext1"),true);
			document.getElementById("image_next1").src = url_path_rotation1 + "next-disable.gif";
		}
		
	}
	if(str == "pre")
	{
		if(document.getElementById("slidenext1").href == "")
		{
			disableAnchor1(document.getElementById("slidenext1"),false);
			document.getElementById("image_next1").src = url_path_rotation1 + "next.gif";
		}
		if(position1 > 1)
		{
			position1--;
			glideTo1(eval(position1-1) * cnt2,0);
			disableAnchor1(document.getElementById("spre1"),false);
			document.getElementById("ipre1").src = url_path_rotation1 + "prev.gif";
		}
		if(position1 == 1)
		{
			disableAnchor1(document.getElementById("spre1"),true);
			document.getElementById("ipre1").src = url_path_rotation1 + "prev-disable.gif";
		}

	}
	for(var z=1;z<=0;z++)
	{
		if(position1 == z)
		{
			document.getElementById("slider" + position1).src = img_url + "slide-on.gif";
		}
		else
		{
			document.getElementById("slider" + z).src = img_url + "slide-off.gif";
		}
	}

}

function do_rotation1()
{
	if(position1 < 0)
	{
		position1++;
		glideTo1(eval(position1-1) * cnt2,0);
	}
	else
	{
		position1 = 1;
		content1.style.left="0px";
		content1.style.top="0px";
	}
	for(var z=1;z<=0;z++)
	{
		if(position1 == z)
		{
			document.getElementById("slider" + position1).src = url_path_rotation1 + "slide-on.gif";
		}
		else
		{
			document.getElementById("slider" + z).src = url_path_rotation1 + "slide-off.gif";
		}
	}
}

function disableAnchor1(obj, disable)
{
	if(disable)
	{
		var href = obj.getAttribute("href");
		obj.removeAttribute('href');
	}
	else
	{
		if(obj.id == "slidenext1")
		{
			obj.setAttribute('href',"Javascript:npre1('next','" + url_path_rotation1 + "')");
		}
		if(obj.id == "spre1")
		{
			obj.setAttribute('href',"Javascript:npre1('pre','" + url_path_rotation1 + "')");
		}
	}
}


/*---------------------------------------FOR news-----------------------------------*/

function load2(cntId,rot_value,url_path)
{
	clearInterval(rot_timer);
	clearInterval(rot_timer1);
	position2 = 0;
	url_path_rotation2 = url_path;
	if(!document.getElementById)
		return;

	content2 = document.getElementById("content2"); 
	contentcontainer2 = document.getElementById("con-con2"); 

	content2.visibility="hidden";
	content2.style.top=0;
	content2.style.left=0;
	xcoordinate2=0;
	ycoordinate2=0;
	maxY2=(content2.offsetHeight-contentcontainer2.offsetHeight>0)?content2.offsetHeight-contentcontainer2.offsetHeight:0;
	wd2=cntId?document.getElementById(cntId).offsetWidth:content2.offsetWidth;
	maxX2=(wd2-contentcontainer2.offsetWidth>0)?wd2-contentcontainer2.offsetWidth:0;
	content2.style.visibility="visible";
	ready2=true;
	document.getElementById("salin2").style.visibility="visible";
	rot_timer2 = setInterval("do_rotation2()",rot_value);
 } 
 
function glideTo2(MstartX, MstartY)
{
	content2 = document.getElementById("content2"); 
	contentcontainer2 = document.getElementById("con-con2");
	startX2 = parseInt(content2.style.left);
	if(startX2 == "")
	{
		startX2 = 0;
	}
	startY2 = parseInt(content2.style.top);
	destX2 = -Math.max(Math.min(MstartX, maxX2), 0);
	destY2= -Math.max(Math.min(MstartY, maxY2), 0);
	distY2 = destY2 - startY2;
	distX2 =  destX2 - startX2;
	per2 = Math.PI/(2 * slideDur2);
	sliding2 = false;
	slideStart2 = (new Date()).getTime();
	aniTimer2 = setInterval("doSlide2()",10);
	on_slide_start2(startX2, startY2);
}


function doSlide2() 
{
	var elapsed = (new Date()).getTime() - slideStart2;
	if (elapsed < slideDur2) 
	{
		var x = startX2 + distX2 * Math.sin(per2*elapsed);
		var y = startY2 + distY2 * Math.sin(per2*elapsed);
		shiftTo2(x, y);
		on_slide2(x, y);
	} 
	else
	{	// if time's up
		clearInterval(aniTimer2);
		sliding2 = false;
		shiftTo2(destX2, destY2);
		//content = null;
		on_slide_end2(destX2, destY2);
	}
}

function shiftTo2(x,y)
{
	 if(typeof(x) == "number")
	 {
		content2.style.left=x+"px";
		content2.style.top=y+"px";
	 }
}

on_slide_start2 = function() {}
on_slide2 = function() {}
on_slide_end2 = function() {}

function do_rotation2()
{
	if(position2 < 0)
	{
		position2++;
		glideTo2(eval(position2-1) * cnt3,0);
	}
	else
	{
		position2 = 1;
		content2.style.left="0px";
		content2.style.top="0px";
	}
	for(var z=1;z<=0;z++)
	{
		if(position2 == z)
		{
			document.getElementById("slidern" + position2).src = url_path_rotation2 + "slide-on.gif";
		}
		else
		{
			document.getElementById("slidern" + z).src = url_path_rotation2 + "slide-off.gif";
		}
	}
}
 
function slidern(id,img_url)
{
	clearInterval(rot_timer2);
	position2 = id;
	glideTo2(eval(id-1) * cnt3,0);
	for(var z=1;z<=0;z++)
	{
		if(id == z)
		{
			document.getElementById("slidern" + id).src = img_url + "slide-on.gif";
		}
		else
		{
			document.getElementById("slidern" + z).src = img_url + "slide-off.gif";
		}
	}
	if(id == 0)
	{
		disableAnchor2(document.getElementById("slidenext2"),true);
		document.getElementById("image_next2").src = url_path_rotation2 + "next-disable.gif";
		disableAnchor2(document.getElementById("spre2"),false);
		document.getElementById("ipre2").src = url_path_rotation2 + "prev.gif";
	}
	if(id == 1)
	{
		disableAnchor2(document.getElementById("spre2"),true);
		document.getElementById("ipre2").src = url_path_rotation2 + "prev-disable.gif";
		disableAnchor2(document.getElementById("slidenext2"),false);
		document.getElementById("image_next2").src = url_path_rotation2 + "next.gif";
	}
	if(position2 > 1  && position2 < 0)
	{
		disableAnchor2(document.getElementById("slidenext2"),false);
		document.getElementById("image_next2").src = url_path_rotation2 + "next.gif";
		disableAnchor2(document.getElementById("spre2"),false);
		document.getElementById("ipre2").src = url_path_rotation2 + "prev.gif";
	}
}



function npre2(str,img_url)
{
	clearInterval(rot_timer2);
	if(str == "next")
	{
		if(document.getElementById("spre2").href == "")
		{
			if(position2 != 0)
			{
				disableAnchor2(document.getElementById("spre2"),false);
				document.getElementById("ipre2").src = url_path_rotation2 + "prev.gif";
			}
		}
		if(position2 < 0)
		{
			position2++;
			glideTo2(eval(position2-1) * cnt3,0);
			disableAnchor2(document.getElementById("slidenext2"),false);
			document.getElementById("image_next2").src = url_path_rotation2 + "next.gif";
		}
		if(position2 == 0)
		{
			disableAnchor2(document.getElementById("slidenext2"),true);
			document.getElementById("image_next2").src = url_path_rotation2 + "next-disable.gif";
		}
		
	}
	if(str == "pre")
	{
		if(document.getElementById("slidenext2").href == "")
		{
			disableAnchor2(document.getElementById("slidenext2"),false);
			document.getElementById("image_next2").src = url_path_rotation2 + "next.gif";
		}
		if(position2 > 1)
		{
			position2--;
			glideTo2(eval(position2-1) * cnt3,0);
			disableAnchor2(document.getElementById("spre2"),false);
			document.getElementById("ipre2").src = url_path_rotation2 + "prev.gif";
		}
		if(position2 == 1)
		{
			disableAnchor2(document.getElementById("spre2"),true);
			document.getElementById("ipre2").src = url_path_rotation2 + "prev-disable.gif";
		}

	}
	for(var z=1;z<=0;z++)
	{
		if(position2 == z)
		{
			document.getElementById("slidern" + position2).src = img_url + "slide-on.gif";
		}
		else
		{
			document.getElementById("slidern" + z).src = img_url + "slide-off.gif";
		}
	}

}



function disableAnchor2(obj, disable)
{
	if(disable)
	{
		var href = obj.getAttribute("href");
		obj.removeAttribute('href');
	}
	else
	{
		if(obj.id == "slidenext2")
		{
			obj.setAttribute('href',"Javascript:npre2('next','" + url_path_rotation2 + "')");
		}
		if(obj.id == "spre2")
		{
			obj.setAttribute('href',"Javascript:npre2('pre','" + url_path_rotation2 + "')");
		}
	}
}

 function start(rot_value,ps)
{
	position2 = ps;
	ready2=true;
	rot_timer2 = setInterval("do_rotation2()",rot_value);
 } 
