

	var dynimages=new Array()
	/*dynimages[0]=["1.jpg", ""]
	dynimages[1]=["2.jpg", ""]
	dynimages[2]=["3.jpg", ""]
	dynimages[3]=["4.jpg", ""]
	dynimages[4]=["5.jpg", ""]
	dynimages[5]=["6.jpg", ""]
	dynimages[6]=["7.jpg", ""]
	dynimages[7]=["8.jpg", ""]
	dynimages[8]=["9.jpg", ""]
	dynimages[9]=["10.jpg", ""]*/

	//Preload images ("yes" or "no"):
	var preloadimg="no"

	//Set optional link target to be added to all images with a link:
	var optlinktarget=""

	//Set image border width
	var imgborderwidth=0

	//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
	var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.5)"

	///////No need to edit beyond here/////

	if (preloadimg=="yes"){
	for (x=0; x<dynimages.length; x++){
	var myimage=new Image()
	myimage.src=dynimages[x][0]
	}
	}

	function returnimgcode(theimg){
	var imghtml=""
	if (theimg[1]!="")
	//imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
	imghtml=''
	if(theimg[0] == 'default.jpg')
	{
		imghtml+='<img src="../images/'+theimg[0]+'"'+imgborderwidth+'">';
	}
	else
	{
		//imghtml+='<img src="'+theimg[0]+'"'+imgborderwidth+'">';
		var arrImgDim = theimg[1].split(':');
		var imageWidth = ' width:'+arrImgDim[0]+'px;';
		var imageHeight = ' height:'+arrImgDim[1]+'px;';
		if(arrImgDim.length == 2)
		{
			if(arrImgDim[0] > 576)
			{
				imageWidth = ' width:576px;';
			}
			if(arrImgDim[1] > 360)
			{
				imageHeight = ' height:360px;';
			}
			//imghtml+='<img border=0 src="'+theimg[0]+'" '+imageWidth+' '+imageHeight+'>';
			imghtml+='<table align="center" border="0" cellpadding="0" cellspacing="0">';
			imghtml+='<tr>';
			imghtml+='<td style="'+imageWidth+' '+imageHeight+' background:url('+theimg[0]+') no-repeat" valign="top">';
			if(isSold == "y")
			{
				imghtml+='<img border="0" src="../images/soldbannerfinal.gif" width="276" height="230">';
			}
			imghtml+='</td>';
			imghtml+='</tr>';
			imghtml+='</table>';
		}
		else
		{
			//imghtml+='<img border=0 src="'+theimg[0]+'">';
			imghtml+='<table align="center" border="0" cellpadding="0" cellspacing="0">';
			imghtml+='<tr>';
			imghtml+='<td style="background:url('+theimg[0]+') no-repeat" valign="top">';
			if(isSold == "y")
			{
				imghtml+='<img border="0" src="../images/soldbannerfinal.gif" width="276" height="230">';
			}
			imghtml+='</td>';
			imghtml+='</tr>';
			imghtml+='</table>';
		}
	}
	if (theimg[1]!="")
	//imghtml+='</a>'
	imghtml+=''
	//alert(imghtml);
	return imghtml
	}
	
	

	function modifyimage(loadarea, imgindex){
	if (document.getElementById){
	var imgobj=document.getElementById(loadarea)
	if (imgobj.filters && window.createPopup){
	imgobj.style.filter=filterstring
	imgobj.filters[0].Apply()
	}	
	imgobj.innerHTML=returnimgcode(dynimages[imgindex])
	if (imgobj.filters && window.createPopup)
	imgobj.filters[0].Play()
	return false
	}
	}

	/* Codes For Prev-Next */
	var pageSize = 10;
	var currentPage = 0;
	var strContent = '';

	function doNext()
	{
		currentPage++;

		var endLimit = (((currentPage * pageSize)+pageSize)-1);
		if(dynimages.length <= endLimit)
		{
			endLimit = (dynimages.length-1);
		}		
		
		var cellIndex = 0;
		for(var i=(currentPage * pageSize); i<=endLimit; i++)
		{
			if(dynimages[i] && dynimages[i][0] == "default.jpg")
			{
				strContent = "<A onmouseover=\"modifyimage('dynloadarea', "+i+")\" href=\"#\"><IMG height=72 src=\"../images/9_small.jpg\" width=100 border=0></A>";
			}
			else
			{
				strContent = "<A onmouseover=\"modifyimage('dynloadarea', "+i+")\" href=\"#\"><IMG height=72 src=\""+(i+1)+"_thumb.jpg\" width=100 border=0></A>";				
			}
			document.getElementById(cellIndex).innerHTML = strContent;
			cellIndex++;
		}

		for(var j=cellIndex; j<10; j++)
		{
			strContent = "<A onmouseover=\"modifyimage('dynloadarea', "+i+")\" href=\"#\"><IMG height=72 src=\"../images/9_small.jpg\" width=100 border=0></A>";
			document.getElementById(j).innerHTML = strContent;
			dynimages[i]=["default.jpg", ""];
			i++;
		}

		document.getElementById('navPrev').innerHTML = '<a href="javascript:doPrev()" style="font-family: Arial; font-size: 8pt; color: #00ffff; text-decoration:none"><img border="0" src="../images/previousbutton.jpg"></a>';

		if((dynimages.length) > i)
		{			
			document.getElementById('navNext').innerHTML = '<a href="javascript:doNext()" style="font-family: Arial; font-size: 8pt; color: #00ffff; text-decoration:none"><img border="0" src="../images/morebutton.jpg"></a>';
		}
		else
		{
			document.getElementById('navNext').innerHTML = '';
		}
	}

	function doPrev()
	{
		currentPage--;

		var cellIndex = 0;
		for(var i=(currentPage * pageSize); i<=((currentPage * pageSize)+pageSize)-1; i++)
		{
			strContent = "<A onmouseover=\"modifyimage('dynloadarea', "+i+")\" href=\"#\"><IMG height=72 src=\""+(i+1)+"_thumb.jpg\" width=100 border=0></A>";
			document.getElementById(cellIndex).innerHTML = strContent;
			cellIndex++;
		}

		if(currentPage > 0)
		{
			document.getElementById('navPrev').innerHTML = '<a href="javascript:doPrev()" style="font-family: Arial; font-size: 8pt; color: #00ffff; text-decoration:none"><img border="0" src="../images/previousbutton.jpg"></a>';
			document.getElementById('navNext').innerHTML = '<a href="javascript:doNext()" style="font-family: Arial; font-size: 8pt; color: #00ffff; text-decoration:none"><img border="0" src="../images/morebutton.jpg"></a>';
		}
		else
		{
			document.getElementById('navPrev').innerHTML = '';
			document.getElementById('navNext').innerHTML = '<a href="javascript:doNext()" style="font-family: Arial; font-size: 8pt; color: #00ffff; text-decoration:none"><img border="0" src="../images/morebutton.jpg"></a>';
		}
	}

	/* Scripts for Refer */
	function showRefer(adNumber)
	{
		document.getElementById("ifRefer").src = "../referFriend.php?adNumber="+escape(adNumber);
		document.getElementById("dynloadarea").style.display = "none";	
		document.getElementById("ifRefer").style.display = "block";
	}

	function hideRefer()
	{
		parent.document.getElementById("dynloadarea").style.display = "block";
		parent.document.getElementById("ifRefer").style.display = "none";
	}