﻿//js for addition of index
function fPistion(tag,pos){
	var tg = document.getElementById(tag);
	var sH = tg.getElementsByTagName("img")[0].scrollHeight,
		sW = tg.getElementsByTagName("img")[0].scrollWidth;
	var notIE6 = navigator.userAgent.indexOf("MSIE 7.0")>0 || window.XMLHttpRequest,
		isIE6 = navigator.userAgent.indexOf("MSIE 6.0")>0;
		
	with(tg.style){
		top = "50%";
		right = "0";
		height = sH + "px";
		width = sW + "px";
		overflow = "hidden";
		marginTop = "-" + sH/2 + "px";
	}
	
	if(isIE6){
		tg.style.position = "absolute";
		window.onscroll = function(){doScroll()};
	}else if(notIE6){
		tg.style.position = "fixed";
	}
	
	var doScroll = function(){
		tg.style.marginTop = document.documentElement.scrollTop -sH/2 + "px";
	}
}
