var currentIndex_tA;
var currentIndex_bA;
var guidedTourString;
var sitesString;
var activitiesString;
//var maxImages = 0;
var maxImages_tA = 0;
var maxImages_bA = 0;
var autoRotateFlg_tA = true;
var autoRotateFlg_bA = true;
var mSecs_tA = 0;
var mSecs1_tA = 0;
var mSecs2_tA = 0;
var mSecs3_tA = 0;
var mSecs4_tA = 0;

var mSecs_bA = 0;
var mSecs1_bA = 0;
var mSecs2_bA = 0;
var mSecs3_bA = 0;
var mSecs4_bA = 0;
function nloadImages_af(photoString,imgdivId,leftdivId,middivId,middivId2,middivId3,rightdivId,leftarrowImg,rightarrowImg,position){
	
	var location_string;
	var pos = photoString.lastIndexOf("||");
	photoString = photoString.substring(0,pos);
	var photoArray = photoString.split("||");
	var html = '';
	var htmlLeft = '';
	var htmlMid = '';
	var htmlMid2 = '';
	var htmlMid3 = '';
	var htmlRight = '';
	var htmlDotSequence_t = '';
	var htmlDotSequence_b = '';
	var thisImage = photoArray[0];
	currentIndex_tA = 0;
	currentIndex_bA = 0;
	thisImage = thisImage.split('~');
	var text1 = thisImage[0];
	var mainImage = thisImage[1];
	var otherText = thisImage[2];
	var linkURL = thisImage[3]; 

	if(position == "tA"){
		photoArrayValues_topA[0] = new Array();
		photoArrayValues_topA[0][0] = text1;
		photoArrayValues_topA[0][1] = mainImage;
		photoArrayValues_topA[0][2] = otherText;
		photoArrayValues_topA[0][3] = linkURL;
		html = '<a href="' + photoArrayValues_topA[0][3] + '"><img src="' + photoArrayValues_topA[0][1] + '" border="0" alt=""></a>';
		htmlMid = photoArrayValues_topA[0][0];
		htmlMid2 = photoArrayValues_topA[0][2];
		if (smallrightarrowImg != '')
		{
		    htmlMid3 = '<a href="' + photoArrayValues_topA[0][3] + '"><img src="' + arrImagesPath + smallrightarrowImg + '" border="0" alt=""></a>';
		}
		if(filledDotImg != '' || emptyDotImg != ''){
			
			htmlDotSequence_t = displayDotSequenceAf(0);
		}


		    htmlLeft = '<a href="javascript:changeAutoFlgA(' + "'" + position + "'" + ');previous_af(' + "'" + imgdivId + "'" + ',' + "'" + leftdivId + "'" + ',' + "'" + middivId + "'" + ',' + "'" + middivId2 + "'" + ',' + "'" + middivId3 + "'" + ',' + "'" + rightdivId + "'" + ',' + "'" + leftarrowImg + "'" + ',' + "'" + rightarrowImg + "'" + ',' + "'" + position + "'" + ');"><img src="' + arrImagesPath + leftarrowImg + '"></a>';
		    htmlRight = '<a href="javascript:changeAutoFlgA(' + "'" + position + "'" + ');next_af(' + "'" + imgdivId + "'" + ',' + "'" + leftdivId + "'" + ',' + "'" + middivId + "'" + ',' + "'" + middivId2 + "'" + ',' + "'" + middivId3 + "'" + ',' + "'" + rightdivId + "'" + ',' + "'" + leftarrowImg + "'" + ',' + "'" + rightarrowImg + "'" + ',' + "'" + position + "'" + ');"><img src="' + arrImagesPath + rightarrowImg + '"></a>';

	}
	else if(position == "bA"){
		photoArrayValues_bottomA[0] = new Array();
		photoArrayValues_bottomA[0][0] = text1;
		photoArrayValues_bottomA[0][1] = mainImage;
		photoArrayValues_bottomA[0][2] = otherText;
		photoArrayValues_bottomA[0][3] = linkURL;
		html = '<a href="' + photoArrayValues_bottomA[0][3] + '"><img src="' + photoArrayValues_bottomA[0][1] + '" border="0" alt=""></a>';
		htmlMid = photoArrayValues_bottomA[0][0];
		htmlMid2 = photoArrayValues_bottomA[0][2];
		if (smallrightarrowImg != '')
		{
		    htmlMid3 = '<a href="' + photoArrayValues_bottomA[0][3] + '"><img src="' + arrImagesPath + smallrightarrowImg + '" border="0" alt=""></a>';
		}
		if(filledDotImg != '' || emptyDotImg != ''){
			
			htmlDotSequence_b = displayDotSequenceAf(0);
		}

		    htmlLeft = '<a href="javascript:changeAutoFlgA(' + "'" + position + "'" + ');previous_af(' + "'" + imgdivId + "'" + ',' + "'" + leftdivId + "'" + ',' + "'" + middivId + "'" + ',' + "'" + middivId2 + "'" + ',' + "'" + middivId3 + "'" + ',' + "'" + rightdivId + "'" + ',' + "'" + leftarrowImg + "'" + ',' + "'" + rightarrowImg + "'" + ',' + "'" + position + "'" + ');"><img src="' + arrImagesPath + leftarrowImg + '"></a>';
		    htmlRight = '<a href="javascript:changeAutoFlgA(' + "'" + position + "'" + ');next_af(' + "'" + imgdivId + "'" + ',' + "'" + leftdivId + "'" + ',' + "'" + middivId + "'" + ',' + "'" + middivId2 + "'" + ',' + "'" + middivId3 + "'" + ',' + "'" + rightdivId + "'" + ',' + "'" + leftarrowImg + "'" + ',' + "'" + rightarrowImg + "'" + ',' + "'" + position + "'" + ');"><img src="' + arrImagesPath + rightarrowImg + '"></a>';

	}
	
	/*if(maxImages > 1){
		htmlLeft = '<img src="'+arrImagesPath+leftarrowImg+'" width="31" height="29" alt="">';
		htmlRight = '<a href="javascript:changeAutoFlg();next_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+rightarrowImg+'"></a>';

	}else{
		htmlLeft = '<img src="'+arrImagesPath+leftarrowImg+'" width="31" height="29" alt="">';
		htmlRight = '<img src="'+arrImagesPath+rightarrowImg+'">';
	}*/

	
	for(var i=1;i<photoArray.length;i++){

		var thisImage = photoArray[i];
		thisImage = thisImage.split('~');
		var text1 = thisImage[0];
		var mainImage = thisImage[1];
		var otherText = thisImage[2];
		var linkURL = thisImage[3];
		if(position == "tA"){
			photoArrayValues_topA[i] = new Array();
			photoArrayValues_topA[i][0] = text1;
			photoArrayValues_topA[i][1] = mainImage;
			photoArrayValues_topA[i][2] = otherText;
			photoArrayValues_topA[i][3] = linkURL;
		}else if(position == "bA"){
			photoArrayValues_bottomA[i] = new Array();
			photoArrayValues_bottomA[i][0] = text1;
			photoArrayValues_bottomA[i][1] = mainImage;
			photoArrayValues_bottomA[i][2] = otherText;
			photoArrayValues_bottomA[i][3] = linkURL;
		/*	alert("["+i+"][0]="+photoArrayValues_bottomA[i][0]);
			alert("["+i+"][1]="+photoArrayValues_bottomA[i][1]);
			alert("["+i+"][2]="+photoArrayValues_bottomA[i][2]);*/
		}


	}
	
	document.getElementById(imgdivId).innerHTML=html;
	document.getElementById(leftdivId).innerHTML=htmlLeft;
	document.getElementById(middivId).innerHTML=htmlMid;
	document.getElementById(middivId2).innerHTML=htmlMid2;
	if (smallrightarrowImg != '')
	{
		document.getElementById(middivId3).innerHTML=htmlMid3;
	}
	if(filledDotImg != '' || emptyDotImg != '')
	{
		if(position == "tA")
		{
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_t;
		}
		else if(position == "bA"){
			
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_b;
		}
	}
	document.getElementById(rightdivId).innerHTML=htmlRight;
	if(position == 'tA'){
		if((maxImages_tA > 1) && autoRotateFlg_tA == true){
			mSecs_tA = setTimeout("next_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);
		}
	}
	else if(position == 'bA'){
		if((maxImages_bA > 1) && autoRotateFlg_bA == true){
			mSecs_bA = setTimeout("next_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);
		}
	}

}
function next_af(imgdivId,leftdivId,middivId,middivId2,middivId3,rightdivId,leftarrowImg,rightarrowImg,position){

	
//	currentIndex_a++;
	if(position == 'tA'){
		//alert("tt-"+currentIndex_tA);
		//alert("tt-"+maxImages_tA);
			if(currentIndex_tA < (maxImages_tA - 1)) {
				currentIndex_tA++;
            }
            else {
                currentIndex_tA = 0;
            }

            html = '<a href="' + photoArrayValues_topA[currentIndex_tA][3] + '"><img src="' + photoArrayValues_topA[currentIndex_tA][1] + '" border="0" alt=""></a>';
			htmlMid = photoArrayValues_topA[currentIndex_tA][0];
			htmlMid2 = photoArrayValues_topA[currentIndex_tA][2];
			if (smallrightarrowImg != '')
			{
			    htmlMid3 = '<a href="' + photoArrayValues_topA[currentIndex_tA][3] + '"><img src="' + arrImagesPath + smallrightarrowImg + '" border="0" alt=""></a>';
			}
			if(filledDotImg != '' || emptyDotImg != '')
			{
				htmlDotSequence_t = displayDotSequenceAf(currentIndex_tA);
			}
	}else if(position == 'bA'){
			
			if(currentIndex_bA < (maxImages_bA - 1)){
				currentIndex_bA++;
            }
            else {
                currentIndex_bA = 0;
            }

			//alert(currentIndex_bA);
            html = '<a href="' + photoArrayValues_bottomA[currentIndex_bA][3] + '"><img src="' + photoArrayValues_bottomA[currentIndex_bA][1] + '" border="0" alt=""></a>';
			htmlMid = photoArrayValues_bottomA[currentIndex_bA][0];
			htmlMid2 = photoArrayValues_bottomA[currentIndex_bA][2];
			if (smallrightarrowImg != '')
			{
			    htmlMid3 = '<a href="' + photoArrayValues_bottomA[currentIndex_bA][3] + '"><img src="' + arrImagesPath + smallrightarrowImg + '" border="0" alt=""></a>';
			}
			if(filledDotImg != '' || emptyDotImg != '')
			{
				htmlDotSequence_b = displayDotSequenceAf(currentIndex_bA);
			}
	}
	////Added on 08  June//////////////////////////////////
	document.getElementById(imgdivId).innerHTML=html;
	document.getElementById(middivId).innerHTML=htmlMid;
	document.getElementById(middivId2).innerHTML=htmlMid2;
	if (smallrightarrowImg != '')
	{
		document.getElementById(middivId3).innerHTML=htmlMid3;
	}
	if(filledDotImg != '' || emptyDotImg != '')
	{
		if(position == "tA")
		{
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_t;
		}
		else if(position == "bA"){
			
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_b;
		}
	}
	if(position == 'tA'){
//			if(currentIndex_tA < maxImages_tA){
//				
//				if(currentIndex_tA == (maxImages_tA - 1)){
//					htmlLeft = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');previous_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+leftarrowImg+'"></a>';
//					
//					htmlRight = '';
//					if(autoRotateFlg_tA == true){
//										
//						document.getElementById(leftdivId).innerHTML=htmlLeft;
//						document.getElementById(rightdivId).innerHTML=htmlRight;
//						currentIndex_tA = 0;
//						mSecs1_tA = setTimeout("previous_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);
//					}
//					document.getElementById(leftdivId).innerHTML=htmlLeft;
//				}else{
					htmlLeft = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');previous_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+leftarrowImg+'"></a>';
					htmlRight = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');next_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+rightarrowImg+'"></a>';
					if(autoRotateFlg_tA == true){
						document.getElementById(leftdivId).innerHTML=htmlLeft;
						document.getElementById(rightdivId).innerHTML=htmlRight;
						mSecs2_tA = setTimeout("next_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);
					}
//				}

//			}
	
	}else if(position == 'bA'){
//			if(currentIndex_bA < maxImages_bA){
//				
//				if(currentIndex_bA == (maxImages_bA - 1)){
//					htmlLeft = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');previous_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+leftarrowImg+'"></a>';
//					
//					htmlRight = '';
//					if(autoRotateFlg_bA == true){
//										
//						document.getElementById(leftdivId).innerHTML=htmlLeft;
//						document.getElementById(rightdivId).innerHTML=htmlRight;
//						currentIndex_bA = 0;
//						mSecs1_bA = setTimeout("previous_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);
//					}
//					document.getElementById(leftdivId).innerHTML=htmlLeft;
//				}else{
					htmlLeft = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');previous_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+leftarrowImg+'"></a>';
					htmlRight = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');next_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+rightarrowImg+'"></a>';
					if(autoRotateFlg_bA == true){
						document.getElementById(leftdivId).innerHTML=htmlLeft;
						document.getElementById(rightdivId).innerHTML=htmlRight;
						mSecs2_bA = setTimeout("next_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);
					}
//				}

//			}
	}
	/*document.getElementById(imgdivId).innerHTML=html;
	document.getElementById(leftdivId).innerHTML=htmlLeft;
	document.getElementById(middivId).innerHTML=htmlMid;
	document.getElementById(middivId2).innerHTML=htmlMid2;
	if (smallrightarrowImg != '')
	{
		document.getElementById(middivId3).innerHTML=htmlMid3;
	}
	if(filledDotImg != '' || emptyDotImg != '')
	{
		if(position == "t")
		{
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_t;
		}
		else if(position == "b"){
			
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_b;
		}
	}*/
	document.getElementById(leftdivId).innerHTML=htmlLeft;
	document.getElementById(rightdivId).innerHTML=htmlRight;
}
function previous_af(imgdivId,leftdivId,middivId,middivId2,middivId3,rightdivId,leftarrowImg,rightarrowImg,position){
	
//	currentIndex_a--;
	
	if(position == 'tA'){
			//alert(currentIndex_tA);
			if(currentIndex_tA > 0){
				currentIndex_tA--;
            }
            else {
                currentIndex_tA = maxImages_tA - 1;
            }

            html = '<a href="' + photoArrayValues_topA[currentIndex_tA][3] + '"><img src="' + photoArrayValues_topA[currentIndex_tA][1] + '" border="0" alt=""></a>';
			htmlMid = photoArrayValues_topA[currentIndex_tA][0];
			htmlMid2 = photoArrayValues_topA[currentIndex_tA][2];
			if (smallrightarrowImg != '')
			{
			    htmlMid3 = '<a href="' + photoArrayValues_topA[currentIndex_tA][3] + '"><img src="' + arrImagesPath + smallrightarrowImg + '" border="0" alt=""></a>';
			}
			if(filledDotImg != '' || emptyDotImg != '')
			{
				htmlDotSequence_t = displayDotSequenceAf(currentIndex_tA);
			}
		}else if(position == 'bA'){
			if(currentIndex_bA > 0){
				currentIndex_bA--;
            }
            else {
                currentIndex_bA = maxImages_bA - 1;
            }

            html = '<a href="' + photoArrayValues_bottomA[currentIndex_bA][3] + '"><img src="' + photoArrayValues_bottomA[currentIndex_bA][1] + '" border="0" alt=""></a>';
			htmlMid = photoArrayValues_bottomA[currentIndex_bA][0];
			htmlMid2 = photoArrayValues_bottomA[currentIndex_bA][2];
			if (smallrightarrowImg != '')
			{
			    htmlMid3 = '<a href="' + photoArrayValues_bottomA[currentIndex_tA][3] + '"><img src="' + arrImagesPath + smallrightarrowImg + '" border="0" alt=""></a>';
			}
			if(filledDotImg != '' || emptyDotImg != '')
			{
				htmlDotSequence_b = displayDotSequenceAf(currentIndex_bA);
			}
	}
	document.getElementById(imgdivId).innerHTML=html;
//	document.getElementById(leftdivId).innerHTML=htmlLeft;
	document.getElementById(middivId).innerHTML=htmlMid;
	document.getElementById(middivId2).innerHTML=htmlMid2;
	if (smallrightarrowImg != '')
	{
		document.getElementById(middivId3).innerHTML=htmlMid3;
	}
	if(filledDotImg != '' || emptyDotImg != '')
	{
		if(position == "tA")
		{
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_t;
		}
		else if(position == "bA"){
			
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_b;
		}
	}
	
if(position == 'tA'){
//			if(currentIndex_tA>=0){
//				if(currentIndex_tA == 0){
//					
//					htmlLeft = '';
//					htmlRight = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');next_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+rightarrowImg+'"></a>';
//					if(autoRotateFlg_tA == true){
//							document.getElementById(leftdivId).innerHTML=htmlLeft;
//							document.getElementById(rightdivId).innerHTML=htmlRight;
//							mSecs3_tA = setTimeout("next_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);

//					}

//				}else{
					htmlLeft = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');previous_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+leftarrowImg+'"></a>';
					htmlRight = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');next_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+rightarrowImg+'"></a>';
					if(autoRotateFlg_tA == true){
							document.getElementById(leftdivId).innerHTML=htmlLeft;
							document.getElementById(rightdivId).innerHTML=htmlRight;
							mSecs4_tA = setTimeout("previous_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);

					}
//				}	

//			}
}else if(position == 'bA'){
//			if(currentIndex_bA>=0){
//				if(currentIndex_bA == 0){
//					
//					htmlLeft = '';
//					htmlRight = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');next_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+rightarrowImg+'"></a>';
//					if(autoRotateFlg_bA == true){
//							document.getElementById(leftdivId).innerHTML=htmlLeft;
//							document.getElementById(rightdivId).innerHTML=htmlRight;
//							mSecs3_bA = setTimeout("next_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);

//					}

//				}else{
					htmlLeft = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');previous_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+leftarrowImg+'"></a>';
					htmlRight = '<a href="javascript:changeAutoFlgA('+"'"+position+"'"+');next_af('+"'"+imgdivId+"'"+','+"'"+leftdivId+"'"+','+"'"+middivId+"'"+','+"'"+middivId2+"'"+','+"'"+middivId3+"'"+','+"'"+rightdivId+"'"+','+"'"+leftarrowImg+"'"+','+"'"+rightarrowImg+"'"+','+"'"+position+"'"+');"><img src="'+arrImagesPath+rightarrowImg+'"></a>';
					if(autoRotateFlg_bA == true){
							document.getElementById(leftdivId).innerHTML=htmlLeft;
							document.getElementById(rightdivId).innerHTML=htmlRight;
							mSecs4_bA = setTimeout("previous_af('"+imgdivId+"','"+leftdivId+"','"+middivId+"','"+middivId2+"','"+middivId3+"','"+rightdivId+"','"+leftarrowImg+"','"+rightarrowImg+"','"+position+"')", 60000);

					}
//				}	

//			}
}		

	/*document.getElementById(imgdivId).innerHTML=html;
	document.getElementById(leftdivId).innerHTML=htmlLeft;
	document.getElementById(middivId).innerHTML=htmlMid;
	document.getElementById(middivId2).innerHTML=htmlMid2;
	if (smallrightarrowImg != '')
	{
		document.getElementById(middivId3).innerHTML=htmlMid3;
	}
	if(filledDotImg != '' || emptyDotImg != '')
	{
		if(position == "t")
		{
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_t;
		}
		else if(position == "b"){
			
			document.getElementById(dotSequenceDivId).innerHTML=htmlDotSequence_b;
		}
	}*/
	document.getElementById(leftdivId).innerHTML=htmlLeft;
	document.getElementById(rightdivId).innerHTML=htmlRight;
	
}
function displayDotSequenceAf(currentnum){
	var dotSequence = '';
	for(var num=0;num < maxImages_tA;num++){
			if(num == currentnum){
				dotSequence +='<img src="'+arrImagesPath+filledDotImg+'"> ';
			}else{
				dotSequence +='<img src="'+arrImagesPath+emptyDotImg+'"> ';
			}
			
	}
	return dotSequence;
}
function changeAutoFlgA(position){
	/*if(autoRotateFlg == true){
		autoRotateFlg = false;
	
		clearTimeout(mSecs_tA);
		clearTimeout(mSecs1_t);
		clearTimeout(mSecs2_t);
		clearTimeout(mSecs3_t);
		clearTimeout(mSecs4_t);
		
	}*/
	//if(position == 'tA' && (autoRotateFlg_tA == true)){
	if(position == 'tA'){
		//autoRotateFlg_tA = false;
	
		clearTimeout(mSecs_tA);
		clearTimeout(mSecs1_tA);
		clearTimeout(mSecs2_tA);
		clearTimeout(mSecs3_tA);
		clearTimeout(mSecs4_tA);
		
	}
	//else if(position == 'bA' && (autoRotateFlg_bA == true)){
	else if(position == 'bA'){
		//autoRotateFlg_bA = false;
	
		clearTimeout(mSecs_bA);
		clearTimeout(mSecs1_bA);
		clearTimeout(mSecs2_bA);
		clearTimeout(mSecs3_bA);
		clearTimeout(mSecs4_bA);
	}
}