// JavaScript Document

var fadeimages7=new Array()
var delaytime_array7=new Array()
var maxorder7=0;
// Add By Abhishek Mittal

for(j7=0;j7<total_banner7;j7++)
		  {
			fadeimages7[j7]=["http://www.piotv.com/photos/banners/"+banner7[j7][0]+"", siteurl7[j7][0], "_blank"]
		  }
for(j7=0;j7<total_banner7;j7++)
		  {
			delaytime_array7[j7]=[delaytime7[j7][0]]
		  }		  
// End Added by Abhishek Mittal		  
var fadebgcolor7="white"
////NO need to edit beyond here/////////////
var indexstate7=0; 
var indexflag7=0;
var fadearray7=new Array() //array to cache fadeshow instances
var fadeclear7=new Array() //array to cache corresponding clearinterval pointers
var dom7=(document.getElementById) //modern dom browsers
var iebrowser7=document.all
function fadeshow7(theimages7, fadewidth7, fadeheight7, borderwidth7, delay7, pause7, img7, displayorder7){
//alert(fadeshow7);
fadeshow7.pausecheck7=pause7
fadeshow7.mouseovercheck7=0
fadeshow7.delay7=delay7
fadeshow7.degree7=100 //initial opacity degree (10%)
fadeshow7.curimageindex7=img7
fadeshow7.nextimageindex7=img7+1
fadearray7[fadearray7.length]=fadeshow7
fadeshow7.slideshowid7=fadearray7.length-1
fadeshow7.canvasbase7="canvas"+fadeshow7.slideshowid7

fadeshow7.curcanvas7="submaster7_0"
fadeshow7.theimages7=theimages7
fadeshow7.imageborder7=parseInt(borderwidth7)
fadeshow7.postimages7=new Array() //preload images

for (p=0;p<theimages7.length;p++){
fadeshow7.postimages7[p]=new Image()
fadeshow7.postimages7[p].src=theimages7[p][0]

}
	
/*var fadewidth7=728
var fadeheight7=79*/
if (iebrowser7&&dom7||dom7)
{//if IE5+ or modern browsers (ie: Firefox)
//alert("One");

document.write('<div  id="master7" style="position:relative;width:'+fadewidth7+'px;height:'+fadeheight7+'px;overflow:hidden;"><div id="submaster7_0" style="position:absolute;width:'+fadewidth7+'px;height:'+fadeheight7+'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:'+fadebgcolor7+'"></div><div id="submaster7_1" style="position:absolute;width:'+fadewidth7+'px;height:'+fadeheight7+'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:'+fadebgcolor7+'"></div></div>')
}
else
{
	//alert("Two");
document.write('<div><img name="defaultslide'+fadeshow7.slideshowid7+'" src="'+fadeshow7.postimages7[0].src+'"></div>')
}

if (iebrowser7&&dom7||dom7) //if IE5+ or modern browsers such as Firefox
fadeshow7.startit7()

else{
fadeshow7.curimageindex7++

setInterval("fadearray7["+fadeshow7.slideshowid7+"].rotateimage7()", fadeshow7.delay7)

}
}
function fadepic7(obj7){
if (obj7.degree7<100){
obj7.degree7+=100
if (obj7.tempobj7.filters&&obj7.tempobj7.filters[0]){
if (typeof obj7.tempobj7.filters[0].opacity=="number") //if IE6+
obj7.tempobj7.filters[0].opacity=obj7.degree7
else //else if IE5.5-
obj7.tempobj7.style.filter="alpha(opacity="+obj7.degree7+")"
}
else if (obj7.tempobj7.style.MozOpacity)
obj7.tempobj7.style.MozOpacity=obj7.degree7/101
else if (obj7.tempobj7.style.KhtmlOpacity)
obj7.tempobj7.style.KhtmlOpacity=obj7.degree7/100
else if (obj7.tempobj7.style.opacity&&!obj7.tempobj7.filters)
obj7.tempobj7.style.opacity=obj7.degree7/101
}
else{
clearInterval(fadeclear7[obj7.slideshowid7])
//alert(obj7.canvasbase7+"_1");
obj7.nextcanvas7=(obj7.curcanvas7=="submaster7_0")? "submaster7_0" : "submaster7_1"
obj7.tempobj7=iebrowser7? iebrowser7[obj7.nextcanvas7] : document.getElementById(obj7.nextcanvas7)
if(indexflag7==1){
	clearInterval(fadeclear7[obj7.slideshowid7])
	 obj7.nextimageindex7=indexstate7
	 indexflag7=0
}
obj7.populateslide7(obj7.tempobj7, obj7.nextimageindex7)
obj7.nextimageindex7=(obj7.nextimageindex7<obj7.postimages7.length-1)? obj7.nextimageindex7+1 : 0
if(maxorder7==total_banner7)
	maxorder7=0;
setTimeout("fadearray7["+obj7.slideshowid7+"].rotateimage7()", delaytime_array7[maxorder7])
maxorder7++;
}
}
fadeshow7.populateslide7=function(picobj7, picindex7){
var slideHTML7=""
if (fadeshow7.theimages7[picindex7][1]!="") //if associated link exists for image
slideHTML7='<a href="http://'+fadeshow7.theimages7[picindex7][1]+'" target="'+fadeshow7.theimages7[picindex7][2]+'">'

split_path_ext7=fadeshow7.postimages7[picindex7].src.split(".");
if(split_path_ext7[split_path_ext7.length-1]=='swf')
	slideHTML7+='<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="'+fadeshow7.postimages7[picindex7].src+'" /><param name="quality" value="high" /> <param name="wmode" value="transparent" /><embed src="'+fadeshow7.postimages7[picindex7].src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="150"  WMODE="transparent"></embed></object>'
else
	slideHTML7+='<img src="'+fadeshow7.postimages7[picindex7].src+'" border="'+fadeshow7.imageborder7+'px">'

if (fadeshow7.theimages7[picindex7][1]!="") //if associated link exists for image
slideHTML7+='</a>'




picobj7.innerHTML=slideHTML7
}
fadeshow7.rotateimage7=function(){
if (fadeshow7.pausecheck7==1) //if pause onMouseover enabled, cache object
var cacheobj7=fadeshow7
if (fadeshow7.mouseovercheck7==1)
setTimeout(function(){cacheobj7.rotateimage7()}, 100)
else if (iebrowser7&&dom7||dom7){
fadeshow7.resetit7()
var crossobj7=fadeshow7.tempobj7=iebrowser7? iebrowser7[fadeshow7.curcanvas7] : document.getElementById(fadeshow7.curcanvas7)
crossobj7.style.zIndex++
fadeclear7[fadeshow7.slideshowid7]=setInterval("fadepic7(fadearray7["+fadeshow7.slideshowid7+"])",50)
fadeshow7.curcanvas7=(fadeshow7.curcanvas7=="submaster7_0")? "submaster7_1" : "submaster7_0"
}
else{
var ns4imgobj7=document.images['defaultslide'+fadeshow7.slideshowid7]
ns4imgobj7.src=fadeshow7.postimages7[fadeshow7.curimageindex7].src
}
fadeshow7.curimageindex7=(fadeshow7.curimageindex7<fadeshow7.postimages7.length-1)? fadeshow7.curimageindex7+1 : 0
}
fadeshow7.resetit7=function(){
fadeshow7.degree7=100
var crossobj7=iebrowser7? iebrowser7[fadeshow7.curcanvas7] : document.getElementById(fadeshow7.curcanvas7)
if (crossobj7.filters&&crossobj7.filters[0]){
if (typeof crossobj7.filters[0].opacity=="number") //if IE6+
crossobj7.filters(0).opacity=fadeshow7.degree7
else //else if IE5.5-
crossobj7.style.filter="alpha(opacity="+fadeshow7.degree7+")"
}
else if (crossobj7.style.MozOpacity)
crossobj7.style.MozOpacity=fadeshow7.degree7/101
else if (crossobj7.style.KhtmlOpacity)
crossobj7.style.KhtmlOpacity=fadeshow7.degree7/100
else if (crossobj7.style.opacity&&!crossobj7.filters)
crossobj7.style.opacity=fadeshow7.degree7/101
}
fadeshow7.prototype.restart7=function(){
}
fadeshow7.startit7=function(){
var crossobj7=iebrowser7? iebrowser7[fadeshow7.curcanvas7] : document.getElementById(fadeshow7.curcanvas7)
fadeshow7.populateslide7(crossobj7, fadeshow7.curimageindex7)
if (fadeshow7.pausecheck7==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj7=fadeshow7
var crossobjcontainer7=iebrowser7? iebrowser7["master7"] : document.getElementById("master7")
crossobjcontainer7.onmouseover=function(){cacheobj7.mouseovercheck7=1}
crossobjcontainer7.onmouseout=function(){cacheobj7.mouseovercheck7=0}
}
fadeshow7.rotateimage7()
}
function startSlide7(image7){
  indexflag7=1;
  indexstate7=image7;
  fadeshow7.prototype.restart7();
  }