// JavaScript Document

var fadeimages1=new Array()
var delaytime_array1=new Array()
var maxorder1=0;
// Add By Abhishek Mittal

for(j1=0;j1<total_banner1;j1++)
		  {
			fadeimages1[j1]=["http://www.piotv.com/photos/banners/"+banner1[j1][0]+"", siteurl1[j1][0], "_blank"]
		  }
for(j1=0;j1<total_banner1;j1++)
		  {
			delaytime_array1[j1]=[delaytime1[j1][0]]
		  }		  
// End Added by Abhishek Mittal		  
var fadebgcolor1="white"
////NO need to edit beyond here/////////////
var indexstate1=0; 
var indexflag1=0;
var fadearray1=new Array() //array to cache fadeshow instances
var fadeclear1=new Array() //array to cache corresponding clearinterval pointers
var dom1=(document.getElementById) //modern dom browsers
var iebrowser1=document.all
function fadeshow1(theimages1, fadewidth1, fadeheight1, borderwidth1, delay1, pause1, img1, displayorder1){
//alert(fadeshow1);
fadeshow1.pausecheck1=pause1
fadeshow1.mouseovercheck1=0
fadeshow1.delay1=delay1
fadeshow1.degree1=100 //initial opacity degree (10%)
fadeshow1.curimageindex1=img1
fadeshow1.nextimageindex1=img1+1
fadearray1[fadearray1.length]=fadeshow1
fadeshow1.slideshowid1=fadearray1.length-1
fadeshow1.canvasbase1="canvas"+fadeshow1.slideshowid1

fadeshow1.curcanvas1="submaster1_0"
fadeshow1.theimages1=theimages1
fadeshow1.imageborder1=parseInt(borderwidth1)
fadeshow1.postimages1=new Array() //preload images

for (p=0;p<theimages1.length;p++){
fadeshow1.postimages1[p]=new Image()
fadeshow1.postimages1[p].src=theimages1[p][0]

}
	
/*var fadewidth1=728
var fadeheight1=79*/
if (iebrowser1&&dom1||dom1)
{//if IE5+ or modern browsers (ie: Firefox)
//alert("One");

document.write('<div  id="master1" style="position:relative;width:'+fadewidth1+'px;height:'+fadeheight1+'px;overflow:hidden;"><div id="submaster1_0" style="position:absolute;width:'+fadewidth1+'px;height:'+fadeheight1+'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:'+fadebgcolor1+'"></div><div id="submaster1_1" style="position:absolute;width:'+fadewidth1+'px;height:'+fadeheight1+'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:'+fadebgcolor1+'"></div></div>')
}
else
{
	//alert("Two");
document.write('<div><img name="defaultslide'+fadeshow1.slideshowid1+'" src="'+fadeshow1.postimages1[0].src+'"></div>')
}

if (iebrowser1&&dom1||dom1) //if IE5+ or modern browsers such as Firefox
fadeshow1.startit1()

else{
fadeshow1.curimageindex1++

setInterval("fadearray1["+fadeshow1.slideshowid1+"].rotateimage1()", fadeshow1.delay1)

}
}
function fadepic1(obj1){
if (obj1.degree1<100){
obj1.degree1+=100
if (obj1.tempobj1.filters&&obj1.tempobj1.filters[0]){
if (typeof obj1.tempobj1.filters[0].opacity=="number") //if IE6+
obj1.tempobj1.filters[0].opacity=obj1.degree1
else //else if IE5.5-
obj1.tempobj1.style.filter="alpha(opacity="+obj1.degree1+")"
}
else if (obj1.tempobj1.style.MozOpacity)
obj1.tempobj1.style.MozOpacity=obj1.degree1/101
else if (obj1.tempobj1.style.KhtmlOpacity)
obj1.tempobj1.style.KhtmlOpacity=obj1.degree1/100
else if (obj1.tempobj1.style.opacity&&!obj1.tempobj1.filters)
obj1.tempobj1.style.opacity=obj1.degree1/101
}
else{
clearInterval(fadeclear1[obj1.slideshowid1])
//alert(obj1.canvasbase1+"_1");
obj1.nextcanvas1=(obj1.curcanvas1=="submaster1_0")? "submaster1_0" : "submaster1_1"
obj1.tempobj1=iebrowser1? iebrowser1[obj1.nextcanvas1] : document.getElementById(obj1.nextcanvas1)
if(indexflag1==1){
	clearInterval(fadeclear1[obj1.slideshowid1])
	 obj1.nextimageindex1=indexstate1
	 indexflag1=0
}
obj1.populateslide1(obj1.tempobj1, obj1.nextimageindex1)
obj1.nextimageindex1=(obj1.nextimageindex1<obj1.postimages1.length-1)? obj1.nextimageindex1+1 : 0
if(maxorder1==total_banner1)
	maxorder1=0;
setTimeout("fadearray1["+obj1.slideshowid1+"].rotateimage1()", delaytime_array1[maxorder1])
maxorder1++;
}
}
fadeshow1.populateslide1=function(picobj1, picindex1){
var slideHTML1=""
if (fadeshow1.theimages1[picindex1][1]!="") //if associated link exists for image
slideHTML1='<a href="http://'+fadeshow1.theimages1[picindex1][1]+'" target="'+fadeshow1.theimages1[picindex1][2]+'">'

split_path_ext1=fadeshow1.postimages1[picindex1].src.split(".");
if(split_path_ext1[split_path_ext1.length-1]=='swf')
	slideHTML1+='<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="'+fadeshow1.postimages1[picindex1].src+'" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><embed src="'+fadeshow1.postimages1[picindex1].src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="150"  WMODE="transparent"></embed></object>'
else
	slideHTML1+='<img src="'+fadeshow1.postimages1[picindex1].src+'" border="'+fadeshow1.imageborder1+'px">'

if (fadeshow1.theimages1[picindex1][1]!="") //if associated link exists for image
slideHTML1+='</a>'




picobj1.innerHTML=slideHTML1
}
fadeshow1.rotateimage1=function(){
if (fadeshow1.pausecheck1==1) //if pause onMouseover enabled, cache object
var cacheobj1=fadeshow1
if (fadeshow1.mouseovercheck1==1)
setTimeout(function(){cacheobj1.rotateimage1()}, 100)
else if (iebrowser1&&dom1||dom1){
fadeshow1.resetit1()
var crossobj1=fadeshow1.tempobj1=iebrowser1? iebrowser1[fadeshow1.curcanvas1] : document.getElementById(fadeshow1.curcanvas1)
crossobj1.style.zIndex++
fadeclear1[fadeshow1.slideshowid1]=setInterval("fadepic1(fadearray1["+fadeshow1.slideshowid1+"])",50)
fadeshow1.curcanvas1=(fadeshow1.curcanvas1=="submaster1_0")? "submaster1_1" : "submaster1_0"
}
else{
var ns4imgobj1=document.images['defaultslide'+fadeshow1.slideshowid1]
ns4imgobj1.src=fadeshow1.postimages1[fadeshow1.curimageindex1].src
}
fadeshow1.curimageindex1=(fadeshow1.curimageindex1<fadeshow1.postimages1.length-1)? fadeshow1.curimageindex1+1 : 0
}
fadeshow1.resetit1=function(){
fadeshow1.degree1=100
var crossobj1=iebrowser1? iebrowser1[fadeshow1.curcanvas1] : document.getElementById(fadeshow1.curcanvas1)
if (crossobj1.filters&&crossobj1.filters[0]){
if (typeof crossobj1.filters[0].opacity=="number") //if IE6+
crossobj1.filters(0).opacity=fadeshow1.degree1
else //else if IE5.5-
crossobj1.style.filter="alpha(opacity="+fadeshow1.degree1+")"
}
else if (crossobj1.style.MozOpacity)
crossobj1.style.MozOpacity=fadeshow1.degree1/101
else if (crossobj1.style.KhtmlOpacity)
crossobj1.style.KhtmlOpacity=fadeshow1.degree1/100
else if (crossobj1.style.opacity&&!crossobj1.filters)
crossobj1.style.opacity=fadeshow1.degree1/101
}
fadeshow1.prototype.restart1=function(){
}
fadeshow1.startit1=function(){
var crossobj1=iebrowser1? iebrowser1[fadeshow1.curcanvas1] : document.getElementById(fadeshow1.curcanvas1)
fadeshow1.populateslide1(crossobj1, fadeshow1.curimageindex1)
if (fadeshow1.pausecheck1==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj1=fadeshow1
var crossobjcontainer1=iebrowser1? iebrowser1["master1"] : document.getElementById("master1")
crossobjcontainer1.onmouseover=function(){cacheobj1.mouseovercheck1=1}
crossobjcontainer1.onmouseout=function(){cacheobj1.mouseovercheck1=0}
}
fadeshow1.rotateimage1()
}
function startSlide1(image1){
  indexflag1=1;
  indexstate1=image1;
  fadeshow1.prototype.restart1();
  }