// JavaScript Document

var fadeimages102=new Array()
var delaytime_array102=new Array()
var maxorder102=0;
// Add By Abhishek Mittal

for(j102=0;j102<total_banner102;j102++)
		  {
			fadeimages102[j102]=["http://www.piotv.com/photos/banners/"+banner102[j102][0]+"", siteurl102[j102][0], "_blank"]
		  }
for(j102=0;j102<total_banner102;j102++)
		  {
			delaytime_array102[j102]=[delaytime102[j102][0]]
		  }		  
// End Added by Abhishek Mittal		  
var fadebgcolor102="white"
////NO need to edit beyond here/////////////
var indexstate102=0; 
var indexflag102=0;
var fadearray102=new Array() //array to cache fadeshow instances
var fadeclear102=new Array() //array to cache corresponding clearinterval pointers
var dom102=(document.getElementById) //modern dom browsers
var iebrowser102=document.all
function fadeshow102(theimages102, fadewidth102, fadeheight102, borderwidth102, delay102, pause102, img102, displayorder102){
//alert(fadeshow102);
fadeshow102.pausecheck102=pause102
fadeshow102.mouseovercheck102=0
fadeshow102.delay102=delay102
fadeshow102.degree102=100 //initial opacity degree (10%)
fadeshow102.curimageindex102=img102
fadeshow102.nextimageindex102=img102+1
fadearray102[fadearray102.length]=fadeshow102
fadeshow102.slideshowid102=fadearray102.length-1
fadeshow102.canvasbase102="canvas"+fadeshow102.slideshowid102

fadeshow102.curcanvas102="submaster102_0"
fadeshow102.theimages102=theimages102
fadeshow102.imageborder102=parseInt(borderwidth102)
fadeshow102.postimages102=new Array() //preload images

for (p=0;p<theimages102.length;p++){
fadeshow102.postimages102[p]=new Image()
fadeshow102.postimages102[p].src=theimages102[p][0]

}
	
/*var fadewidth102=728
var fadeheight102=79*/
if (iebrowser102&&dom102||dom102)
{//if IE5+ or modern browsers (ie: Firefox)
//alert("One");

document.write('<div  id="master102" style="position:relative;width:'+fadewidth102+'px;height:'+fadeheight102+'px;overflow:hidden;"><div id="submaster102_0" style="position:absolute;width:'+fadewidth102+'px;height:'+fadeheight102+'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:'+fadebgcolor102+'"></div><div id="submaster102_1" style="position:absolute;width:'+fadewidth102+'px;height:'+fadeheight102+'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:'+fadebgcolor102+'"></div></div>')
}
else
{
	//alert("Two");
document.write('<div><img name="defaultslide'+fadeshow102.slideshowid102+'" src="'+fadeshow102.postimages102[0].src+'"></div>')
}

if (iebrowser102&&dom102||dom102) //if IE5+ or modern browsers such as Firefox
fadeshow102.startit102()

else{
fadeshow102.curimageindex102++

setInterval("fadearray102["+fadeshow102.slideshowid102+"].rotateimage102()", fadeshow102.delay102)

}
}
function fadepic102(obj102){
if (obj102.degree102<100){
obj102.degree102+=100
if (obj102.tempobj102.filters&&obj102.tempobj102.filters[0]){
if (typeof obj102.tempobj102.filters[0].opacity=="number") //if IE6+
obj102.tempobj102.filters[0].opacity=obj102.degree102
else //else if IE5.5-
obj102.tempobj102.style.filter="alpha(opacity="+obj102.degree102+")"
}
else if (obj102.tempobj102.style.MozOpacity)
obj102.tempobj102.style.MozOpacity=obj102.degree102/102
else if (obj102.tempobj102.style.KhtmlOpacity)
obj102.tempobj102.style.KhtmlOpacity=obj102.degree102/100
else if (obj102.tempobj102.style.opacity&&!obj102.tempobj102.filters)
obj102.tempobj102.style.opacity=obj102.degree102/102
}
else{
clearInterval(fadeclear102[obj102.slideshowid102])
//alert(obj102.canvasbase102+"_1");
obj102.nextcanvas102=(obj102.curcanvas102=="submaster102_0")? "submaster102_0" : "submaster102_1"
obj102.tempobj102=iebrowser102? iebrowser102[obj102.nextcanvas102] : document.getElementById(obj102.nextcanvas102)
if(indexflag102==1){
	clearInterval(fadeclear102[obj102.slideshowid102])
	 obj102.nextimageindex102=indexstate102
	 indexflag102=0
}
obj102.populateslide102(obj102.tempobj102, obj102.nextimageindex102)
obj102.nextimageindex102=(obj102.nextimageindex102<obj102.postimages102.length-1)? obj102.nextimageindex102+1 : 0
if(maxorder102==total_banner102)
	maxorder102=0;
setTimeout("fadearray102["+obj102.slideshowid102+"].rotateimage102()", delaytime_array102[maxorder102])
maxorder102++;
}
}
fadeshow102.populateslide102=function(picobj102, picindex102){
var slideHTML102=""
if (fadeshow102.theimages102[picindex102][1]!="") //if associated link exists for image
slideHTML102='<a href="http://'+fadeshow102.theimages102[picindex102][1]+'" target="'+fadeshow102.theimages102[picindex102][2]+'">'

split_path_ext102=fadeshow102.postimages102[picindex102].src.split(".");
if(split_path_ext102[split_path_ext102.length-1]=='swf')
	slideHTML102+='<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="'+fadeshow102.postimages102[picindex102].src+'" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><embed src="'+fadeshow102.postimages102[picindex102].src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="150"  WMODE="transparent"></embed></object>'
else
	slideHTML102+='<img src="'+fadeshow102.postimages102[picindex102].src+'" border="'+fadeshow102.imageborder102+'px">'

if (fadeshow102.theimages102[picindex102][1]!="") //if associated link exists for image
slideHTML102+='</a>'




picobj102.innerHTML=slideHTML102
}
fadeshow102.rotateimage102=function(){
if (fadeshow102.pausecheck102==1) //if pause onMouseover enabled, cache object
var cacheobj102=fadeshow102
if (fadeshow102.mouseovercheck102==1)
setTimeout(function(){cacheobj102.rotateimage102()}, 100)
else if (iebrowser102&&dom102||dom102){
fadeshow102.resetit102()
var crossobj102=fadeshow102.tempobj102=iebrowser102? iebrowser102[fadeshow102.curcanvas102] : document.getElementById(fadeshow102.curcanvas102)
crossobj102.style.zIndex++
fadeclear102[fadeshow102.slideshowid102]=setInterval("fadepic102(fadearray102["+fadeshow102.slideshowid102+"])",50)
fadeshow102.curcanvas102=(fadeshow102.curcanvas102=="submaster102_0")? "submaster102_1" : "submaster102_0"
}
else{
var ns4imgobj102=document.images['defaultslide'+fadeshow102.slideshowid102]
ns4imgobj102.src=fadeshow102.postimages102[fadeshow102.curimageindex102].src
}
fadeshow102.curimageindex102=(fadeshow102.curimageindex102<fadeshow102.postimages102.length-1)? fadeshow102.curimageindex102+1 : 0
}
fadeshow102.resetit102=function(){
fadeshow102.degree102=100
var crossobj102=iebrowser102? iebrowser102[fadeshow102.curcanvas102] : document.getElementById(fadeshow102.curcanvas102)
if (crossobj102.filters&&crossobj102.filters[0]){
if (typeof crossobj102.filters[0].opacity=="number") //if IE6+
crossobj102.filters(0).opacity=fadeshow102.degree102
else //else if IE5.5-
crossobj102.style.filter="alpha(opacity="+fadeshow102.degree102+")"
}
else if (crossobj102.style.MozOpacity)
crossobj102.style.MozOpacity=fadeshow102.degree102/102
else if (crossobj102.style.KhtmlOpacity)
crossobj102.style.KhtmlOpacity=fadeshow102.degree102/100
else if (crossobj102.style.opacity&&!crossobj102.filters)
crossobj102.style.opacity=fadeshow102.degree102/102
}
fadeshow102.prototype.restart102=function(){
}
fadeshow102.startit102=function(){
var crossobj102=iebrowser102? iebrowser102[fadeshow102.curcanvas102] : document.getElementById(fadeshow102.curcanvas102)
fadeshow102.populateslide102(crossobj102, fadeshow102.curimageindex102)
if (fadeshow102.pausecheck102==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj102=fadeshow102
var crossobjcontainer102=iebrowser102? iebrowser102["master102"] : document.getElementById("master102")
crossobjcontainer102.onmouseover=function(){cacheobj102.mouseovercheck102=1}
crossobjcontainer102.onmouseout=function(){cacheobj102.mouseovercheck102=0}
}
fadeshow102.rotateimage102()
}
function startSlide102(image102){
  indexflag102=1;
  indexstate102=image102;
  fadeshow102.prototype.restart102();
  }
