// JavaScript Document

var fadeimages101=new Array()
var delaytime_array101=new Array()
var maxorder101=0;
// Add By Abhishek Mittal

for(j101=0;j101<total_banner101;j101++)
		  {
			fadeimages101[j101]=["http://www.piotv.com/photos/banners/"+banner101[j101][0]+"", siteurl101[j101][0], "_blank"]
		  }
for(j101=0;j101<total_banner101;j101++)
		  {
			delaytime_array101[j101]=[delaytime101[j101][0]]
		  }		  
// End Added by Abhishek Mittal		  
var fadebgcolor101="white"
////NO need to edit beyond here/////////////
var indexstate101=0; 
var indexflag101=0;
var fadearray101=new Array() //array to cache fadeshow instances
var fadeclear101=new Array() //array to cache corresponding clearinterval pointers
var dom101=(document.getElementById) //modern dom browsers
var iebrowser101=document.all








function fadeshow101(theimages101, fadewidth101, fadeheight101, borderwidth101, delay101, pause101, img101, displayorder101){
//alert(fadeshow101);
fadeshow101.pausecheck101=pause101
fadeshow101.mouseovercheck101=0
fadeshow101.delay101=delay101
fadeshow101.degree101=100 //initial opacity degree (10%)
fadeshow101.curimageindex101=img101
fadeshow101.nextimageindex101=img101+1
fadearray101[fadearray101.length]=fadeshow101
fadeshow101.slideshowid101=fadearray101.length-1
fadeshow101.canvasbase101="canvas"+fadeshow101.slideshowid101

fadeshow101.curcanvas101="submaster101_0"
fadeshow101.theimages101=theimages101
fadeshow101.imageborder101=parseInt(borderwidth101)
fadeshow101.postimages101=new Array() //preload images

for (p=0;p<theimages101.length;p++){
fadeshow101.postimages101[p]=new Image()
fadeshow101.postimages101[p].src=theimages101[p][0]

}
	
/*var fadewidth101=728
var fadeheight101=79*/
if (iebrowser101&&dom101||dom101)
{//if IE5+ or modern browsers (ie: Firefox)
//alert("One");

document.write('<div  id="master101" style="position:relative;width:'+fadewidth101+'px;height:'+fadeheight101+'px;overflow:hidden;"><div id="submaster101_0" style="position:absolute;width:'+fadewidth101+'px;height:'+fadeheight101+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor101+'"></div><div id="submaster101_1" style="position:absolute;width:'+fadewidth101+'px;height:'+fadeheight101+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor101+'"></div></div>')
}
else
{
	//alert("Two");
document.write('<div><img name="defaultslide'+fadeshow101.slideshowid101+'" src="'+fadeshow101.postimages101[0].src+'"></div>')
}

if (iebrowser101&&dom101||dom101) //if IE5+ or modern browsers such as Firefox
fadeshow101.startit101()

else{
fadeshow101.curimageindex101++

setInterval("fadearray101["+fadeshow101.slideshowid101+"].rotateimage101()", fadeshow101.delay101)

}
}
function fadepic101(obj101){
if (obj101.degree101<100){
obj101.degree101+=100
if (obj101.tempobj101.filters&&obj101.tempobj101.filters[0]){
if (typeof obj101.tempobj101.filters[0].opacity=="number") //if IE6+
obj101.tempobj101.filters[0].opacity=obj101.degree101
else //else if IE5.5-
obj101.tempobj101.style.filter="alpha(opacity="+obj101.degree101+")"
}
else if (obj101.tempobj101.style.MozOpacity)
obj101.tempobj101.style.MozOpacity=obj101.degree101/101
else if (obj101.tempobj101.style.KhtmlOpacity)
obj101.tempobj101.style.KhtmlOpacity=obj101.degree101/100
else if (obj101.tempobj101.style.opacity&&!obj101.tempobj101.filters)
obj101.tempobj101.style.opacity=obj101.degree101/101
}
else{
clearInterval(fadeclear101[obj101.slideshowid101])
//alert(obj101.canvasbase101+"_1");
obj101.nextcanvas101=(obj101.curcanvas101=="submaster101_0")? "submaster101_0" : "submaster101_1"
obj101.tempobj101=iebrowser101? iebrowser101[obj101.nextcanvas101] : document.getElementById(obj101.nextcanvas101)
if(indexflag101==1){
	clearInterval(fadeclear101[obj101.slideshowid101])
	 obj101.nextimageindex101=indexstate101
	 indexflag101=0
}
obj101.populateslide101(obj101.tempobj101, obj101.nextimageindex101)
obj101.nextimageindex101=(obj101.nextimageindex101<obj101.postimages101.length-1)? obj101.nextimageindex101+1 : 0
if(maxorder101==total_banner101)
	maxorder101=0;
setTimeout("fadearray101["+obj101.slideshowid101+"].rotateimage101()", delaytime_array101[maxorder101])
maxorder101++;
}
}
fadeshow101.populateslide101=function(picobj101, picindex101){
var slideHTML101=""
if (fadeshow101.theimages101[picindex101][1]!="") //if associated link exists for image
slideHTML101='<a href="http://'+fadeshow101.theimages101[picindex101][1]+'" target="'+fadeshow101.theimages101[picindex101][2]+'">'

split_path_ext101=fadeshow101.postimages101[picindex101].src.split(".");
if(split_path_ext101[split_path_ext101.length-1]=='swf')
	slideHTML101+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="180" height="150"  style="z-index:0;"><param name="movie" value="'+fadeshow101.postimages101[picindex101].src+'" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><embed src="'+fadeshow101.postimages101[picindex101].src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="150"  WMODE="transparent"></embed></object>'
else
	slideHTML101+='<img src="'+fadeshow101.postimages101[picindex101].src+'" border="'+fadeshow101.imageborder101+'px">'

if (fadeshow101.theimages101[picindex101][1]!="") //if associated link exists for image
slideHTML101+='</a>'




picobj101.innerHTML=slideHTML101
}
fadeshow101.rotateimage101=function(){
if (fadeshow101.pausecheck101==1) //if pause onMouseover enabled, cache object
var cacheobj101=fadeshow101
if (fadeshow101.mouseovercheck101==1)
setTimeout(function(){cacheobj101.rotateimage101()}, 100)
else if (iebrowser101&&dom101||dom101){
fadeshow101.resetit101()
var crossobj101=fadeshow101.tempobj101=iebrowser101? iebrowser101[fadeshow101.curcanvas101] : document.getElementById(fadeshow101.curcanvas101)
fadeclear101[fadeshow101.slideshowid101]=setInterval("fadepic101(fadearray101["+fadeshow101.slideshowid101+"])",50)
fadeshow101.curcanvas101=(fadeshow101.curcanvas101=="submaster101_0")? "submaster101_1" : "submaster101_0"
}
else{
var ns4imgobj101=document.images['defaultslide'+fadeshow101.slideshowid101]
ns4imgobj101.src=fadeshow101.postimages101[fadeshow101.curimageindex101].src
}
fadeshow101.curimageindex101=(fadeshow101.curimageindex101<fadeshow101.postimages101.length-1)? fadeshow101.curimageindex101+1 : 0
}
fadeshow101.resetit101=function(){
fadeshow101.degree101=100
var crossobj101=iebrowser101? iebrowser101[fadeshow101.curcanvas101] : document.getElementById(fadeshow101.curcanvas101)
if (crossobj101.filters&&crossobj101.filters[0]){
if (typeof crossobj101.filters[0].opacity=="number") //if IE6+
crossobj101.filters(0).opacity=fadeshow101.degree101
else //else if IE5.5-
crossobj101.style.filter="alpha(opacity="+fadeshow101.degree101+")"
}
else if (crossobj101.style.MozOpacity)
crossobj101.style.MozOpacity=fadeshow101.degree101/101
else if (crossobj101.style.KhtmlOpacity)
crossobj101.style.KhtmlOpacity=fadeshow101.degree101/100
else if (crossobj101.style.opacity&&!crossobj101.filters)
crossobj101.style.opacity=fadeshow101.degree101/101
}
fadeshow101.prototype.restart101=function(){
}
fadeshow101.startit101=function(){
var crossobj101=iebrowser101? iebrowser101[fadeshow101.curcanvas101] : document.getElementById(fadeshow101.curcanvas101)
fadeshow101.populateslide101(crossobj101, fadeshow101.curimageindex101)
if (fadeshow101.pausecheck101==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj101=fadeshow101
var crossobjcontainer101=iebrowser101? iebrowser101["master101"] : document.getElementById("master101")
crossobjcontainer101.onmouseover=function(){cacheobj101.mouseovercheck101=1}
crossobjcontainer101.onmouseout=function(){cacheobj101.mouseovercheck101=0}
}
fadeshow101.rotateimage101()
}
function startSlide101(image101){
  indexflag101=1;
  indexstate101=image101;
  fadeshow101.prototype.restart101();
  }