//Footer Paging
function createXMLHttpRequest_footer(){
	var xmlhttp = false;
	
	if(window.XMLHttpRequest){
		xmlhttp = new XMLHttpRequest();
		return xmlhttp;	
	}
	try{
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		return xmlhttp;	
	}catch(e){
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");	
			return xmlhttp;
		}catch(e1){}
	}
	//object has not been created
	return xmlhttp;
}
var request_footer = createXMLHttpRequest_footer();
var BoolShrFt=true;
/*
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('w x(){6(c==d){y d}c=d;e=2.3("f").4;j=7.k(e);6(2.3("8").5!="0"&&2.3("8").5!=2.3("l").4){2.3("m"+e).9.n="g";h=o(j)+1;2.3("z").5=\'<a p="q:r(0);" A="B();C();" s="t D" 9="u-v:g;" >&E; F</a>\';6(7[h]){b=7[h];2.3("m"+b).9.n="";G();2.3("f").4=b;2.3("i").4=2.3("i").4+","+b}c=H;6(7.k(2.3("f").4)+1==2.3("l").4){2.3("I").5=\'&J; <a p="q:r(0);" s="t" 9="u-v:g; K:L;" >M &N;</a>\';O(2.3("i").4)}2.3("8").5=o(2.3("8").5)+1}}',51,51,'||document|getElementById|value|innerHTML|if|shrdItmsArr|fromLmt|style||nxtshrid|BoolShrFt|false|curntshrid|CurntShrId|none|nxtpos|viewed_shrids|curshridpos|position|shrIdsAryCnt|gtaspn|display|parseInt|href|javascript|void|class|graytxt|text|decoration|function|nxtShrdItm|return|prevlnkid|onclick|prevShrdItm|ChangeAd|bold|laquo|Previous|fireMyPopup|true|nxtlnkid|nbsp|cursor|auto|Next|raquo|shareEmpty'.split('|'),0,{}))


eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('u v(){5(8==9){w 9}8=9;b=2.3("c").d;i=6.j(b);5(2.3("e").4!="0"){2.3("k"+b).7.l="f";g=m(i)-1;2.3("x").4=\'&y; <a n="o:p(0);"  z="A();B();" q="r C" 7="s-t:f;" >D &E;</a>\';5(6[g]){h=6[g];2.3("k"+h).7.l="";2.3("c").d=h;F()}5(6.j(2.3("c").d)==0){2.3("G").4=\'<a n="o:p(0);" q="r" 7="s-t:f; H:I;" >&J; K</a>\'}2.3("e").4=m(2.3("e").4)-1;8=L}}',48,48,'||document|getElementById|innerHTML|if|shrdItmsArr|style|BoolShrFt|false||curntshrid|CurntShrId|value|fromLmt|none|prevpos|prevshrid|curshridpos|position|gtaspn|display|parseInt|href|javascript|void|class|graytxt|text|decoration|function|prevShrdItm|return|nxtlnkid|nbsp|onclick|nxtShrdItm|ChangeAd|bold|Next|raquo|fireMyPopup|prevlnkid|cursor|auto|laquo|Previous|true'.split('|'),0,{}))

eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 c(6){7(2==3){d 3}2=3;8 9="e="+6;8 a=f+"g.h";1.i("j",a,b);1.k(\'l-m\',\'n/o-p-q-r\');1.s=5(){7(1.t==4){2=b}u{v=0}};1.w(9)}',33,33,'|request_footer|BoolShrFt|false||function|sids|if|var|postVariables|filePath|true|shareEmpty|return|shrid|STURL|rmt_shritms_empty|php|open|POST|setRequestHeader|Content|Type|application|x|www|form|urlencoded|onreadystatechange|readyState|else|gta|send'.split('|'),0,{}))
*/

function nxtShrdItm()
{
  /* alert(shrdItmsArr[20]);*/
  //alert(vstedArr);
  if(BoolShrFt==false)
  {
	return false;
  }
  BoolShrFt=false;	
  curntshrid=document.getElementById("CurntShrId").value;
  curshridpos=shrdItmsArr.position(curntshrid)
  if(document.getElementById("fromLmt").innerHTML!="0" && document.getElementById("fromLmt").innerHTML!=document.getElementById("shrIdsAryCnt").value)
  {
	  document.getElementById("gtaspn"+curntshrid).style.display="none";
	  
	  nxtpos=parseInt(curshridpos)+1;
	  
	 document.getElementById("prevlnkid").innerHTML='<a href="javascript:void(0);" onclick="prevShrdItm();ChangeAd();" class="graytxt bold" style="text-decoration:none;padding-left:10px;" >&laquo; Previous</a>';

	  if(shrdItmsArr[nxtpos])
	  {
		  nxtshrid=shrdItmsArr[nxtpos];
		  document.getElementById("gtaspn"+nxtshrid).style.display="";
   	      fireMyPopup();
		  document.getElementById("CurntShrId").value=nxtshrid;
		  document.getElementById("viewed_shrids").value=document.getElementById("viewed_shrids").value+","+nxtshrid;
		  //vstedArr.push(nxtshrid);
	  }
	  BoolShrFt=true;
	  if(shrdItmsArr.position(document.getElementById("CurntShrId").value)+1==document.getElementById("shrIdsAryCnt").value)
	  {
		//Disable the Next Link
		document.getElementById("nxtlnkid").innerHTML='<a href="javascript:void(0);" class="graytxt" style="text-decoration:none; cursor:auto;" >Next &raquo;</a>';
		shareEmpty(document.getElementById("viewed_shrids").value);
	  }
	  document.getElementById("fromLmt").innerHTML=parseInt(document.getElementById("fromLmt").innerHTML)+1;
  }
}
function prevShrdItm()
{
  if(BoolShrFt==false)
  {
	return false;
  }
  BoolShrFt=false;	

  curntshrid=document.getElementById("CurntShrId").value;
  curshridpos=shrdItmsArr.position(curntshrid)
  if(document.getElementById("fromLmt").innerHTML!="0" )
  {
	  //alert("3");
	  document.getElementById("gtaspn"+curntshrid).style.display="none";
	  prevpos=parseInt(curshridpos)-1;
	  //alert(prevpos);
document.getElementById("nxtlnkid").innerHTML='<a href="javascript:void(0);"  onclick="nxtShrdItm();ChangeAd();" class="graytxt bold" style="text-decoration:none;" >Next &raquo;</a>';
	  if(shrdItmsArr[prevpos])
	  {
		  prevshrid=shrdItmsArr[prevpos];
		  document.getElementById("gtaspn"+prevshrid).style.display="";
		  document.getElementById("CurntShrId").value=prevshrid;
		  fireMyPopup();
	  }
	  if(shrdItmsArr.position(document.getElementById("CurntShrId").value)==0)
	  {
		//Disable the Prev Link
	document.getElementById("prevlnkid").innerHTML='<a href="javascript:void(0);" class="graytxt" style="text-decoration:none; cursor:auto;padding-left:10px;" >&laquo; Previous</a>';
	  }
	  document.getElementById("fromLmt").innerHTML=parseInt(document.getElementById("fromLmt").innerHTML)-1;
	   BoolShrFt=true;
  }
}
function shareEmpty(sids)
{
  if(BoolShrFt==false)
  {
	return false;
  }
  BoolShrFt=false;	

  var postVariables = "shrid="+sids;
  var filePath = STURL+"rmt_shritms_empty.php";
  request_footer.open("POST", filePath, true);
  request_footer.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  request_footer.onreadystatechange = function(){
										if(request_footer.readyState == 4){
											BoolShrFt=true;
										}else{
											gta=0;
										}
	};
	request_footer.send(postVariables);
}





<!--
Array.prototype.position = function (s) {
	var i = 0;
	while (i < this.length && this [i] != s) {i++};
	return i < this.length ? i : undefined;
}
// -->



//Fading

function setOpacity( value,fldname ) {
 document.getElementById("ShrdDispDiv").style.opacity = value / 10;
 document.getElementById("ShrdDispDiv").style.filter = 'alpha(opacity=' + value * 10 + ')';
}
function fadeInMyPopup(fldname) 
{
 for( var i = 0 ; i <= 100 ; i++ )
   setTimeout( 'setOpacity(' + (i / 10) +')' , 8 * i );
}
function fireMyPopup()
{
 setOpacity( 0 ); 
 document.getElementById("ShrdDispDiv").style.display = "block";
 fadeInMyPopup();
}
function showFooterDiv()
{
	if(document.getElementById('showDiv').style.display=="none")	
	document.getElementById('showDiv').style.display='';
	else
	document.getElementById('showDiv').style.display='none';
}