// JavaScript Document

var fadeimages6=new Array()
var delaytime_array6=new Array()
var maxorder6=0;
// Add By Abhishek Mittal

for(j6=0;j6<total_banner6;j6++)
		  {
			fadeimages6[j6]=["http://www.piotv.com/photos/banners/"+banner6[j6][0]+"", siteurl6[j6][0], "_blank"]
		  }
for(j6=0;j6<total_banner6;j6++)
		  {
			delaytime_array6[j6]=[delaytime6[j6][0]]
		  }		  
// End Added by Abhishek Mittal		  
var fadebgcolor6="white"
////NO need to edit beyond here/////////////
var indexstate6=0; 
var indexflag6=0;
var fadearray6=new Array() //array to cache fadeshow instances
var fadeclear6=new Array() //array to cache corresponding clearinterval pointers
var dom6=(document.getElementById) //modern dom browsers
var iebrowser6=document.all
function fadeshow6(theimages6, fadewidth6, fadeheight6, borderwidth6, delay6, pause6, img6, displayorder6){
//alert(fadeshow6);
fadeshow6.pausecheck6=pause6
fadeshow6.mouseovercheck6=0
fadeshow6.delay6=delay6
fadeshow6.degree6=100 //initial opacity degree (10%)
fadeshow6.curimageindex6=img6
fadeshow6.nextimageindex6=img6+1
fadearray6[fadearray6.length]=fadeshow6
fadeshow6.slideshowid6=fadearray6.length-1
fadeshow6.canvasbase6="canvas"+fadeshow6.slideshowid6

fadeshow6.curcanvas6="submaster6_0"
fadeshow6.theimages6=theimages6
fadeshow6.imageborder6=parseInt(borderwidth6)
fadeshow6.postimages6=new Array() //preload images

for (p=0;p<theimages6.length;p++){
fadeshow6.postimages6[p]=new Image()
fadeshow6.postimages6[p].src=theimages6[p][0]

}
	
/*var fadewidth6=728
var fadeheight6=79*/
if (iebrowser6&&dom6||dom6)
{//if IE5+ or modern browsers (ie: Firefox)
//alert("One");

document.write('<div  id="master6" style="position:relative;width:'+fadewidth6+'px;height:'+fadeheight6+'px;overflow:hidden;"><div id="submaster6_0" style="position:absolute;width:'+fadewidth6+'px;height:'+fadeheight6+'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:'+fadebgcolor6+'"></div><div id="submaster6_1" style="position:absolute;width:'+fadewidth6+'px;height:'+fadeheight6+'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:'+fadebgcolor6+'"></div></div>')
}
else
{
	//alert("Two");
document.write('<div><img name="defaultslide'+fadeshow6.slideshowid6+'" src="'+fadeshow6.postimages6[0].src+'"></div>')
}

if (iebrowser6&&dom6||dom6) //if IE5+ or modern browsers such as Firefox
fadeshow6.startit6()

else{
fadeshow6.curimageindex6++

setInterval("fadearray6["+fadeshow6.slideshowid6+"].rotateimage6()", fadeshow6.delay6)

}
}
function fadepic6(obj6){
if (obj6.degree6<100){
obj6.degree6+=100
if (obj6.tempobj6.filters&&obj6.tempobj6.filters[0]){
if (typeof obj6.tempobj6.filters[0].opacity=="number") //if IE6+
obj6.tempobj6.filters[0].opacity=obj6.degree6
else //else if IE5.5-
obj6.tempobj6.style.filter="alpha(opacity="+obj6.degree6+")"
}
else if (obj6.tempobj6.style.MozOpacity)
obj6.tempobj6.style.MozOpacity=obj6.degree6/101
else if (obj6.tempobj6.style.KhtmlOpacity)
obj6.tempobj6.style.KhtmlOpacity=obj6.degree6/100
else if (obj6.tempobj6.style.opacity&&!obj6.tempobj6.filters)
obj6.tempobj6.style.opacity=obj6.degree6/101
}
else{
clearInterval(fadeclear6[obj6.slideshowid6])
//alert(obj6.canvasbase6+"_1");
obj6.nextcanvas6=(obj6.curcanvas6=="submaster6_0")? "submaster6_0" : "submaster6_1"
obj6.tempobj6=iebrowser6? iebrowser6[obj6.nextcanvas6] : document.getElementById(obj6.nextcanvas6)
if(indexflag6==1){
	clearInterval(fadeclear6[obj6.slideshowid6])
	 obj6.nextimageindex6=indexstate6
	 indexflag6=0
}
obj6.populateslide6(obj6.tempobj6, obj6.nextimageindex6)
obj6.nextimageindex6=(obj6.nextimageindex6<obj6.postimages6.length-1)? obj6.nextimageindex6+1 : 0
if(maxorder6==total_banner6)
	maxorder6=0;
setTimeout("fadearray6["+obj6.slideshowid6+"].rotateimage6()", delaytime_array6[maxorder6])
maxorder6++;
}
}
fadeshow6.populateslide6=function(picobj6, picindex6){
var slideHTML6=""
if (fadeshow6.theimages6[picindex6][1]!="") //if associated link exists for image
slideHTML6='<a href="http://'+fadeshow6.theimages6[picindex6][1]+'" target="'+fadeshow6.theimages6[picindex6][2]+'">'

split_path_ext6=fadeshow6.postimages6[picindex6].src.split(".");
if(split_path_ext6[split_path_ext6.length-1]=='swf')
	slideHTML6+='<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="'+fadeshow6.postimages6[picindex6].src+'" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><embed src="'+fadeshow6.postimages6[picindex6].src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="150"  WMODE="transparent"></embed></object>'
else
	slideHTML6+='<img src="'+fadeshow6.postimages6[picindex6].src+'" border="'+fadeshow6.imageborder6+'px">'

if (fadeshow6.theimages6[picindex6][1]!="") //if associated link exists for image
slideHTML6+='</a>'




picobj6.innerHTML=slideHTML6
}
fadeshow6.rotateimage6=function(){
if (fadeshow6.pausecheck6==1) //if pause onMouseover enabled, cache object
var cacheobj6=fadeshow6
if (fadeshow6.mouseovercheck6==1)
setTimeout(function(){cacheobj6.rotateimage6()}, 100)
else if (iebrowser6&&dom6||dom6){
fadeshow6.resetit6()
var crossobj6=fadeshow6.tempobj6=iebrowser6? iebrowser6[fadeshow6.curcanvas6] : document.getElementById(fadeshow6.curcanvas6)
crossobj6.style.zIndex++
fadeclear6[fadeshow6.slideshowid6]=setInterval("fadepic6(fadearray6["+fadeshow6.slideshowid6+"])",50)
fadeshow6.curcanvas6=(fadeshow6.curcanvas6=="submaster6_0")? "submaster6_1" : "submaster6_0"
}
else{
var ns4imgobj6=document.images['defaultslide'+fadeshow6.slideshowid6]
ns4imgobj6.src=fadeshow6.postimages6[fadeshow6.curimageindex6].src
}
fadeshow6.curimageindex6=(fadeshow6.curimageindex6<fadeshow6.postimages6.length-1)? fadeshow6.curimageindex6+1 : 0
}
fadeshow6.resetit6=function(){
fadeshow6.degree6=100
var crossobj6=iebrowser6? iebrowser6[fadeshow6.curcanvas6] : document.getElementById(fadeshow6.curcanvas6)
if (crossobj6.filters&&crossobj6.filters[0]){
if (typeof crossobj6.filters[0].opacity=="number") //if IE6+
crossobj6.filters(0).opacity=fadeshow6.degree6
else //else if IE5.5-
crossobj6.style.filter="alpha(opacity="+fadeshow6.degree6+")"
}
else if (crossobj6.style.MozOpacity)
crossobj6.style.MozOpacity=fadeshow6.degree6/101
else if (crossobj6.style.KhtmlOpacity)
crossobj6.style.KhtmlOpacity=fadeshow6.degree6/100
else if (crossobj6.style.opacity&&!crossobj6.filters)
crossobj6.style.opacity=fadeshow6.degree6/101
}
fadeshow6.prototype.restart6=function(){
}
fadeshow6.startit6=function(){
var crossobj6=iebrowser6? iebrowser6[fadeshow6.curcanvas6] : document.getElementById(fadeshow6.curcanvas6)
fadeshow6.populateslide6(crossobj6, fadeshow6.curimageindex6)
if (fadeshow6.pausecheck6==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj6=fadeshow6
var crossobjcontainer6=iebrowser6? iebrowser6["master6"] : document.getElementById("master6")
crossobjcontainer6.onmouseover=function(){cacheobj6.mouseovercheck6=1}
crossobjcontainer6.onmouseout=function(){cacheobj6.mouseovercheck6=0}
}
fadeshow6.rotateimage6()
}
function startSlide6(image6){
  indexflag6=1;
  indexstate6=image6;
  fadeshow6.prototype.restart6();
  }