// JavaScript Document

var fadeimages5=new Array()
var delaytime_array5=new Array()
var maxorder5=0;
// Add By Abhishek Mittal

for(j5=0;j5<total_banner5;j5++)
		  {
			fadeimages5[j5]=["http://www.piotv.com/photos/banners/"+banner5[j5][0]+"", siteurl5[j5][0], "_blank"]
		  }
for(j5=0;j5<total_banner5;j5++)
		  {
			delaytime_array5[j5]=[delaytime5[j5][0]]
		  }		  
// End Added by Abhishek Mittal		  
var fadebgcolor5="white"
////NO need to edit beyond here/////////////
var indexstate5=0; 
var indexflag5=0;
var fadearray5=new Array() //array to cache fadeshow instances
var fadeclear5=new Array() //array to cache corresponding clearinterval pointers
var dom5=(document.getElementById) //modern dom browsers
var iebrowser5=document.all
function fadeshow5(theimages5, fadewidth5, fadeheight5, borderwidth5, delay5, pause5, img5, displayorder5){
//alert(fadeshow5);
fadeshow5.pausecheck5=pause5
fadeshow5.mouseovercheck5=0
fadeshow5.delay5=delay5
fadeshow5.degree5=100 //initial opacity degree (10%)
fadeshow5.curimageindex5=img5
fadeshow5.nextimageindex5=img5+1
fadearray5[fadearray5.length]=fadeshow5
fadeshow5.slideshowid5=fadearray5.length-1
fadeshow5.canvasbase5="canvas"+fadeshow5.slideshowid5

fadeshow5.curcanvas5="submaster5_0"
fadeshow5.theimages5=theimages5
fadeshow5.imageborder5=parseInt(borderwidth5)
fadeshow5.postimages5=new Array() //preload images

for (p=0;p<theimages5.length;p++){
fadeshow5.postimages5[p]=new Image()
fadeshow5.postimages5[p].src=theimages5[p][0]

}
	
/*var fadewidth5=728
var fadeheight5=79*/
if (iebrowser5&&dom5||dom5)
{//if IE5+ or modern browsers (ie: Firefox)
//alert("One");

document.write('<div  id="master5" style="position:relative;width:'+fadewidth5+'px;height:'+fadeheight5+'px;overflow:hidden;"><div id="submaster5_0" style="position:absolute;width:'+fadewidth5+'px;height:'+fadeheight5+'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:'+fadebgcolor5+'"></div><div id="submaster5_1" style="position:absolute;width:'+fadewidth5+'px;height:'+fadeheight5+'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:'+fadebgcolor5+'"></div></div>')
}
else
{
	//alert("Two");
document.write('<div><img name="defaultslide'+fadeshow5.slideshowid5+'" src="'+fadeshow5.postimages5[0].src+'"></div>')
}

if (iebrowser5&&dom5||dom5) //if IE5+ or modern browsers such as Firefox
fadeshow5.startit5()

else{
fadeshow5.curimageindex5++

setInterval("fadearray5["+fadeshow5.slideshowid5+"].rotateimage5()", fadeshow5.delay5)

}
}
function fadepic5(obj5){
if (obj5.degree5<100){
obj5.degree5+=100
if (obj5.tempobj5.filters&&obj5.tempobj5.filters[0]){
if (typeof obj5.tempobj5.filters[0].opacity=="number") //if IE6+
obj5.tempobj5.filters[0].opacity=obj5.degree5
else //else if IE5.5-
obj5.tempobj5.style.filter="alpha(opacity="+obj5.degree5+")"
}
else if (obj5.tempobj5.style.MozOpacity)
obj5.tempobj5.style.MozOpacity=obj5.degree5/101
else if (obj5.tempobj5.style.KhtmlOpacity)
obj5.tempobj5.style.KhtmlOpacity=obj5.degree5/100
else if (obj5.tempobj5.style.opacity&&!obj5.tempobj5.filters)
obj5.tempobj5.style.opacity=obj5.degree5/101
}
else{
clearInterval(fadeclear5[obj5.slideshowid5])
//alert(obj5.canvasbase5+"_1");
obj5.nextcanvas5=(obj5.curcanvas5=="submaster5_0")? "submaster5_0" : "submaster5_1"
obj5.tempobj5=iebrowser5? iebrowser5[obj5.nextcanvas5] : document.getElementById(obj5.nextcanvas5)
if(indexflag5==1){
	clearInterval(fadeclear5[obj5.slideshowid5])
	 obj5.nextimageindex5=indexstate5
	 indexflag5=0
}
obj5.populateslide5(obj5.tempobj5, obj5.nextimageindex5)
obj5.nextimageindex5=(obj5.nextimageindex5<obj5.postimages5.length-1)? obj5.nextimageindex5+1 : 0
if(maxorder5==total_banner5)
	maxorder5=0;
setTimeout("fadearray5["+obj5.slideshowid5+"].rotateimage5()", delaytime_array5[maxorder5])
maxorder5++;
}
}
fadeshow5.populateslide5=function(picobj5, picindex5){
var slideHTML5=""
if (fadeshow5.theimages5[picindex5][1]!="") //if associated link exists for image
slideHTML5='<a href="http://'+fadeshow5.theimages5[picindex5][1]+'" target="'+fadeshow5.theimages5[picindex5][2]+'">'

split_path_ext5=fadeshow5.postimages5[picindex5].src.split(".");
if(split_path_ext5[split_path_ext5.length-1]=='swf')
	slideHTML5+='<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="'+fadeshow5.postimages5[picindex5].src+'" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><embed src="'+fadeshow5.postimages5[picindex5].src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="150"  WMODE="transparent"></embed></object>'
else
	slideHTML5+='<img src="'+fadeshow5.postimages5[picindex5].src+'" border="'+fadeshow5.imageborder5+'px">'

if (fadeshow5.theimages5[picindex5][1]!="") //if associated link exists for image
slideHTML5+='</a>'




picobj5.innerHTML=slideHTML5
}
fadeshow5.rotateimage5=function(){
if (fadeshow5.pausecheck5==1) //if pause onMouseover enabled, cache object
var cacheobj5=fadeshow5
if (fadeshow5.mouseovercheck5==1)
setTimeout(function(){cacheobj5.rotateimage5()}, 100)
else if (iebrowser5&&dom5||dom5){
fadeshow5.resetit5()
var crossobj5=fadeshow5.tempobj5=iebrowser5? iebrowser5[fadeshow5.curcanvas5] : document.getElementById(fadeshow5.curcanvas5)
crossobj5.style.zIndex++
fadeclear5[fadeshow5.slideshowid5]=setInterval("fadepic5(fadearray5["+fadeshow5.slideshowid5+"])",50)
fadeshow5.curcanvas5=(fadeshow5.curcanvas5=="submaster5_0")? "submaster5_1" : "submaster5_0"
}
else{
var ns4imgobj5=document.images['defaultslide'+fadeshow5.slideshowid5]
ns4imgobj5.src=fadeshow5.postimages5[fadeshow5.curimageindex5].src
}
fadeshow5.curimageindex5=(fadeshow5.curimageindex5<fadeshow5.postimages5.length-1)? fadeshow5.curimageindex5+1 : 0
}
fadeshow5.resetit5=function(){
fadeshow5.degree5=100
var crossobj5=iebrowser5? iebrowser5[fadeshow5.curcanvas5] : document.getElementById(fadeshow5.curcanvas5)
if (crossobj5.filters&&crossobj5.filters[0]){
if (typeof crossobj5.filters[0].opacity=="number") //if IE6+
crossobj5.filters(0).opacity=fadeshow5.degree5
else //else if IE5.5-
crossobj5.style.filter="alpha(opacity="+fadeshow5.degree5+")"
}
else if (crossobj5.style.MozOpacity)
crossobj5.style.MozOpacity=fadeshow5.degree5/101
else if (crossobj5.style.KhtmlOpacity)
crossobj5.style.KhtmlOpacity=fadeshow5.degree5/100
else if (crossobj5.style.opacity&&!crossobj5.filters)
crossobj5.style.opacity=fadeshow5.degree5/101
}
fadeshow5.prototype.restart5=function(){
}
fadeshow5.startit5=function(){
var crossobj5=iebrowser5? iebrowser5[fadeshow5.curcanvas5] : document.getElementById(fadeshow5.curcanvas5)
fadeshow5.populateslide5(crossobj5, fadeshow5.curimageindex5)
if (fadeshow5.pausecheck5==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj5=fadeshow5
var crossobjcontainer5=iebrowser5? iebrowser5["master5"] : document.getElementById("master5")
crossobjcontainer5.onmouseover=function(){cacheobj5.mouseovercheck5=1}
crossobjcontainer5.onmouseout=function(){cacheobj5.mouseovercheck5=0}
}
fadeshow5.rotateimage5()
}
function startSlide5(image5){
  indexflag5=1;
  indexstate5=image5;
  fadeshow5.prototype.restart5();
  }
