var urlBB = 'indexbb.html?pmk=hpswu';
var urlNB = 'index.html?pmk=hpswu';
var defaultUrl = urlNB;
var connectionSpeed = "Connessione:NarrowBand";

/* animazione NEWS */
var n_tot = 3;
var delay = 3000;
var n_cor = 1;
var n_pre = n_tot;

function getStars(numb)
{
	if(numb!=undefined && numb!="")
	{
		var re=/^(\d+)(,\d+)?$/;
		if(re.test(numb))
		{
			var path="http://"+window.location.host+"/images/BigHunter/Rating/";
			var vote=numb.replace(re,"$1");
			return "<img src='"+path+"star_"+vote+".gif' alt='Voto'/>";
		}
		else return "";
	}
	else return "";
}

function getStarsFromBlob(numb)
{
	if(numb!=undefined && numb!="")
	{
		var re=/^.+(\d+)(,\d+).+?$/;
		if(re.test(numb))
		{
			var path="http://"+window.location.host+"/images/BigHunter/Rating/";
			var vote=numb.replace(re,"$1");
			return "<img src='"+path+"star_"+vote+".gif' alt='Voto'/>";
		}
		else return "";
	}
	else return "";
}

function startnews(){

 	findLayer('art_'+n_pre).style.visibility = "hidden";
 	findLayer('art_'+n_cor).style.visibility = "visible";

	n_pre = n_cor;

	if (n_cor == n_tot) { n_cor = 1; } else { n_cor++; }
	setTimeout("startnews()", delay);
}
/*fine funzioni per animazione NEWS*/

function goSearch(dom, qs){
	if ( qs=='Cerca con Virgilio:' ){
		qs='';
	}
	document.location.href=('http://search.virgilio.it/search/cgi/search.cgi?dom=' + dom + '&f=hp&switch=0&offset=0&hits=10&qs=' + escape(qs));
	return false;
}

function checkScreen(){
	var w = screen.width;
	var h = screen.height;
	var ret = (w>=1024 && h>=768) ? true : false;
	return ret;
}


function genericPop(myUrl,myWinName,myWidth,myHeight,myPars) {
 var winl = (screen.width - myWidth) / 2;
 var wint = (screen.height - myHeight) / 2;
 parameters = myPars + '';
 if (parameters == '') parameters = ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no';
 gwin=window.open(myUrl,myWinName,'width='+myWidth+',height='+myHeight+',left='+winl+',top='+wint+parameters);
 gwin.focus();
}


function openRAWindow(anchorObject){
	openRAWindowFromFlash(anchorObject);
	return false;
}

function openRAWindowFromFlash(o){
	var features = 'scrollbars=no,resizable=no,status=yes';
	if (screen.width==800 && screen.height==600){
		features = 'scrollbars=yes,resizable=no,status=yes';
	}
	if(o.getAttribute){
		window.open(o.getAttribute('href'),'',features);
	}else{
		window.open(o,'',features);
	}
}

function checkFlashVersion() {
  var reqVer=7;
  var plugin = (navigator.mimeTypes &&
  navigator.mimeTypes["application/x-shockwave-flash"]) ?
  navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  var isVerOk=false;
  if (plugin) {
      var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	  var flaVer;
      for (var i = 0; i < words.length; i++){
          if (isNaN(parseInt(words[i]))){
              continue;
		  }
          flaVer = words[i];
		  break;
      }
      isVerOk = (flaVer >= reqVer);
  }
  else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)){
      try {
		var instance=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+reqVer);
		isVerOk = true;
	  }
      catch (e){isVerOk=false}
  }
  return isVerOk;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function findLayer(layerID){
	if(document.getElementById){
		return document.getElementById(layerID);
	}else if(document.all){
		return document.all[layerID];
	}else if(document.layers){
		return document.layers[layerID];
	}
}

function loadBoxMail(){
	findLayer('mail').style.display = 'block';
}

function goToNB(){
	var scade = new Date();
	scade.setTime(scade.getTime() + 30*24*60*60*1000);
	SetCookie("UserChoice", "NB", scade, "/", null, null);

	document.location.href=urlNB;
}

function goToBB(){
	var scade = new Date();
	scade.setTime(scade.getTime() + 30*24*60*60*1000);
	SetCookie("UserChoice", "BB", scade, "/", null, null);

	document.location.href=urlBB;
}

function checkBB(){
	/* da chiamare solamente nella BB */
	var normalized  = GetCookie('Normalized');
	if(  !(normalized && normalized=='once')  ){
		if( !(checkFlashVersion() && checkScreen()) ){
			var mai = new Date();
			mai.setTime(mai.getTime() + 2000*24*60*60*1000);
			SetCookie ('Normalized', 'once', mai, "/", null, null);
			setUserChoiceCookie( 'NarrowBand' );
			document.location.href = urlNB;
		}
	}
}

function goToTab(tab){
	var path = document.location.pathname;
	if (path.indexOf('index')){
		path=path.substring(1, path.lastIndexOf('index')-1);
	}
	if(path=='home'){
		path='aliceoggi';
	}
	var userChoice = GetCookie('UserChoice');
	if (userChoice=='NB'){
		document.location.href='/'+tab;
	}else{
		var url = tab+'/indexbb.html';
		if (tab!=''){
			url = '/' + url;
		}
		document.location.href=url + '?pmkf=' + path;
	}
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function drawCSImageTag( fileLocation, fileSize, imgTagProperties, showImage, elementId) {
  var x = document.getElementById(elementId);
	var start = (new Date()).getTime();
	var loc = fileLocation + '?t=' + escape(start);
  var visible = "hidden";
  var showImage = 'checked' ? visible = "visible" : visible = "hidden";
	var imtest = new Image();
	imtest.src = loc;
	try{
		if(  !(navigator.userAgent.indexOf('Mac')>-1 && navigator.appVersion.indexOf('MSIE')>-1)   ){
			imtest.onload = function compute(){
				computeConnectionSpeed( start, fileSize );
			}
		}else{
			eval('imtest.onload = new function compute(){computeConnectionSpeed( start, fileSize );}');
		}
	}catch(e){
		// per baco IE5: esegue la funzione sull'onload ma lancia comunque un eccezione
	}

	return;
}

function connectionType(speed) {

	SLOW_MODEM = 15;
  //FAST_MODEM = 57;
	FAST_MODEM = 70;
	ISDN_MODEM = 120;
	ADSL_MODEM = 600;

	if (speed) {
		if (speed < FAST_MODEM) {
			return "NarrowBand";
		} else {
			return "BroadBand";
		}
	} else {
		return "NarrowBand";
	}
}

function computeConnectionSpeed( start, fileSize ) {
	var end = (new Date()).getTime();
	speed = (Math.floor((((fileSize * 8) / ((end - start) / 1000)) / 1024) * 10) / 10);
	connectionSpeed = 'Connessione:' + connectionType( speed );
	var mai = new Date();
	mai.setTime(mai.getTime() + 2000*24*60*60*1000);
    var cookie = connectionSpeed + '&start=' + start + '&end=' + end + '&ms=' + (end-start) + '&kbps=' + parseInt(speed) + '&bytes=' + fileSize;
    var img = new Image();
    img.src="/home/images/connspeed-out.jpg?" + cookie + "&rand=" + Math.floor(1000000*Math.random());

	SetCookie ("ConnParam", cookie, mai, "/", null, null);

	setUserChoiceCookie( connectionType(speed) );

}

function startDraw() {
	var x = GetCookie("ConnParam");
	var u = GetCookie("UserChoice");
	if (!x) {
		draw();
	} else {
		if (x && !u){
			setUserChoiceCookie( x );
		}

		connectionSpeed = x;
		var img = new Image();
		img.src = "/home/images/connspeed-in.gif?" + x + "&rand=" + Math.floor(1000000*Math.random());
	}
}

function draw() {
	drawCSImageTag("/home/images/connspeed.bmp", // Image filename
                  5194, // Image size
                  "height=54 width=123", "checked", "connspeed");
}

function setUserChoiceCookie(connSpeed){
	var scade = new Date();
	scade.setTime(scade.getTime() + 30*24*60*60*1000);
	if(connSpeed.indexOf('BroadBand') !=-1 && checkFlashVersion() && checkScreen() ){
		SetCookie("UserChoice", "BB", scade, "/", null, null);
	}else{
		SetCookie("UserChoice", "NB", scade, "/", null, null);
	}
}

function writeFlashObject(movie, qs, width, height){
	document.write(
	   '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n'+
	   ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"\n'+
	   ' WIDTH="' + width + '" HEIGHT="' + height + '">\n'+
	   ' <PARAM NAME=movie VALUE="' + movie + '">\n'+
	   ' <PARAM NAME=FlashVars VALUE="'+qs+'">\n'+
	   ' <PARAM NAME=quality VALUE=high>\n'+
	   ' <PARAM NAME=menu VALUE=false>\n'+
	   ' <PARAM name="wmode" VALUE="transparent">\n'+
	   ' <EMBED src="' + movie +'"\n'+
	   '  FlashVars="'+qs+'"\n'+
	   '  wmode="transparent" ' +
	   '  quality=high menu="false" WIDTH="' + width + '" HEIGHT="' + height +
	   '  TYPE="application/x-shockwave-flash"\n'+
	   '  PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>\n'+
	   '</OBJECT>');
}


function faseLuna(DG) {          // RITORNA 5 SE C'E' LA Luna PIENA
    DR = new Date(2000,0,1);	// data di riferimento
    TL = (((DG - DR) / 1000) + 2114500) % 2551443;
    RV = 1
    if (TL < 2508243)   	RV=8   //  CALANTE DA ULTIMO
    if (TL < 1956782.25)	RV=7   //  ULTIMO QUARTO
    if (TL < 1870382.25)	RV=6   //  CALANTE DA PIENA
    if (TL < 1318921.5) 	RV=5   //  PIENA
    if (TL < 1232521.5) 	RV=4   //  CRESCENTE DA PRIMO
    if (TL < 681060.75) 	RV=3   //  PRIMO QUARTO
    if (TL < 594660.75) 	RV=2   //  CRESCENTE DA NUOVA
    if (TL < 43200)	   	RV=1   //  NUOVA
    return  RV
}

function writeFaseLunareImage(basePath)
{
    switch(faseLuna(new Date()))
    {
        case 1:document.write('<img src="'+basePath+'fasillunari_1b.jpg" />');break;
        case 2:document.write('<img src="'+basePath+'fasillunari_2b.jpg" />');break;
        case 3:document.write('<img src="'+basePath+'fasillunari_3b.jpg" />');break;
        case 4:document.write('<img src="'+basePath+'fasillunari_4b.jpg" />');break;
        case 5:document.write('<img src="'+basePath+'fasillunari_5b.jpg" />');break;
        case 6:document.write('<img src="'+basePath+'fasillunari_6b.jpg" />');break;
        case 7:document.write('<img src="'+basePath+'fasillunari_7b.jpg" />');break;
        case 8:document.write('<img src="'+basePath+'fasillunari_8b.jpg" />');break;
    }
}

function writeFaseLunare()
{
    switch(faseLuna(new Date()))
    {
        case 1:document.write("Luna nuova");break;
        case 2:document.write("Luna crescente da nuova");break;
        case 3:document.write("Luna primo quarto");break;
        case 4:document.write("Luna crescente da primo");break;
        case 5:document.write("Luna piena");break;
        case 6:document.write("Luna calante da piena");break;
        case 7:document.write("Luna ultimo quarto");break;
        case 8:document.write("Luna calante da ultimo");break;
    }
}

 function ShortenImageSummary(id,url) {
	var text="";
	if(document.all)
	{
	     text=document.getElementById(id).innerText;
	} 
	else
	{
	    text=document.getElementById(id).textContent;
	}
	
	//var htm=document.getElementById(id).innerHTML;
	//var text=str.replace(/<\/?[^>]+(>|$)/g, "");
	//var re=new RegExp(".*(<img[^>]+>).+", "gi");
	var img="";
	/*if(re.test(htm))
		img=htm.replace(/.*(<img[^>]+>).+/gi, "$1");*/
	if(document.getElementById(id).getElementsByTagName("IMG").length>0)
		img="<img border='0' align='left' src='"+document.getElementById(id).getElementsByTagName("IMG")[0].src+"' />";
	else
		img="";

	if(img!="" && url!=undefined && url!="")
		img="<a href='"+url+"'>"+img+"</a>";

	if(text!=null && text.length<=80){
		document.getElementById(id).innerHTML=img+text;
	}
	else{
		document.getElementById(id).innerHTML=img;
		if(text!=null)
			document.getElementById(id).innerHTML+=text.substr(0,80)+"...";
		//alert(img+text.substr(0,80)+"...")
	}
	
}

/*function GetImagePath(id) {
	    
	if(document.all)
	{
	     text=document.getElementById(id).innerText;
	} 
	else
	{
	    text=document.getElementById(id).textContent;
	}
	
	var img="";
	
	if(document.getElementById(id).getElementsByTagName("IMG").length>0)
		return document.getElementById(id).getElementsByTagName("IMG")[0].src;
	else
		return "";	
}*/

function GetImageThumbPath(desc) 
{	    
	//GetImagePath("<a href='http://local.bighunter.it/Home/Fotodelgiorno/tabid/703/PhotoId/1/AlbumId/3/Default.aspx'><img src='/Portals/0/UltraPhotoGallery/1662/3/thumbs/02A10T6V.jpg' align='left' border=0></a>")
	return desc.replace(/.*<img src='([^']*)'[^>]*>.*/,"$1");
}

function InsertImageInSlider(arr,desc,link,extra,title) 
{	    
	//GetImagePath("<a href='http://local.bighunter.it/Home/Fotodelgiorno/tabid/703/PhotoId/1/AlbumId/3/Default.aspx'><img src='/Portals/0/UltraPhotoGallery/1662/3/thumbs/02A10T6V.jpg' align='left' border=0></a>")
	var path=desc.replace(/.*<img src='([^']*)'[^>]*>.*/,"$1").replace("thumbs","large");
	if(path.indexOf("_hd")==-1)
	{
	    arr[arr.length]=[path,link,extra,title]; //image with link syntax
	}
}

function InsertImageInFotoDelGiornoSlider(arr,desc,link,extra,title) 
{	    
	//GetImagePath("<a href='http://local.bighunter.it/Home/Fotodelgiorno/tabid/703/PhotoId/1/AlbumId/3/Default.aspx'><img src='/Portals/0/UltraPhotoGallery/1662/3/thumbs/02A10T6V.jpg' align='left' border=0></a>")
	var path=desc.replace(/.*<img src='([^']*)'[^>]*>.*/,"$1").replace("thumbs","home");
	if(path.indexOf("_hd")==-1)
	{
	    arr[arr.length]=[path,link,extra,title]; //image with link syntax
	}
}

function GetImagePath(desc) 
{	    
	//GetImagePath("<a href='http://local.bighunter.it/Home/Fotodelgiorno/tabid/703/PhotoId/1/AlbumId/3/Default.aspx'><img src='/Portals/0/UltraPhotoGallery/1662/3/thumbs/02A10T6V.jpg' align='left' border=0></a>")
	return desc.replace(/.*<img src='([^']*)'[^>]*>.*/,"$1").replace("thumbs","large");
}

function GetImageUrl(id) 
{
	    
	if(document.all)
	{
	     text=document.getElementById(id).innerText;
	} 
	else
	{
	    text=document.getElementById(id).textContent;
	}
	
	var img="";
	
	if(document.getElementById(id).getElementsByTagName("IMG").length>0)
		return document.getElementById(id).getElementsByTagName("IMG")[0].src;
	else
		return "";	
}

function LeaveOnlyImage(id,url,align,w) {
	var text="";
	var wText="";
	if(w && w>0)
	{
	    wText="width='"+w+"'";
	    //alert(wText)
	}
	    
	if(document.all)
	{
	     text=document.getElementById(id).innerText;
	} 
	else
	{
	    text=document.getElementById(id).textContent;
	}
	
	//var htm=document.getElementById(id).innerHTML;
	//var text=str.replace(/<\/?[^>]+(>|$)/g, "");
	//var re=new RegExp(".*(<img[^>]+>).+", "gi");
	var img="";
	/*if(re.test(htm))
		img=htm.replace(/.*(<img[^>]+>).+/gi, "$1");*/
	if(document.getElementById(id).getElementsByTagName("IMG").length>0)
		img="<img border='0' "+wText+" align='"+align+"' src='"+document.getElementById(id).getElementsByTagName("IMG")[0].src+"' />";
	else
		img="";

	if(img!="" && url!=undefined && url!="")
		img="<a href='"+url+"'>"+img+"</a>";
    //alert(img)
	document.getElementById(id).innerHTML=img;
	
}
  

function GetSummary(str) {
	var s=str.replace(/<\/?[^>]+(>|$)/g, "");
	if(s!=null && s.length>50)
		return s.substr(0,50)+"...";
	else
		return s;
}

/*function ShortenSummaryLen(id,len) {

	var text="";
	if(document.all)
	{
	     text=document.getElementById(id).innerText;
	} 
	else
	{
	     text=document.getElementById(id).textContent;
	}

	text=text.replace(/<\/?[^>]+(>|$)/g, "");

	if(text!=null && text.length<=len){
		document.getElementById(id).innerHTML=text;
	}
	else{
		document.getElementById(id).innerHTML=text.substr(0,len)+"...";
	}

}*/

function ShortenSummary(id) {
	//var s=str.replace(/<\/?[^>]+(>|$)/g, "");
	var s="";
	if(document.all)
	{
	     text=document.getElementById(id).innerText;
	     if(s!=null && s.length>100)
	      document.getElementById(id).innerText=s.substr(0,100)+"...";
	} 
	else
	{
	    text=document.getElementById(id).textContent;
	    if(s!=null && s.length>100)
	      document.getElementById(id).textContent=s.substr(0,100)+"...";
	}

    	
}

/* Image Rotator*/

/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var fadeimages=new Array()

var fadebgcolor="#000000"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimg, fadewidth, fadeheight,imgcontheight,stip, borderwidth, bgcolor, delay, pause, displayorder){

this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.showtip=stip
var tipId="photoTip_"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimg.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimg
this.imageborder=parseInt(borderwidth)
this.fadebgcolor=bgcolor
this.fadewidth=fadewidth
this.fadeheight=fadeheight
this.imagecontainerheight=imgcontheight
this.postimages=new Array() //preload images
for (p=0;p<theimg.length;p++){
this.postimages[p]=new Image();
this.postimages[p].src=theimg[p][0];
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+this.fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+this.fadebgcolor+'"></div></div><div id="'+tipId+'" style="display:'+(this.showtip?"block":"none")+'">'+this.theimages[0][3]+'</div>')
else
document.write('<div style="height:'+this.imagecontainerheight+'px:overflow:hidden"><img align="center" name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div><div id="photoTip_"'+this.slideshowid+'>'+this.theimages[0][3]+'</div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML='<div style="height:'+this.imagecontainerheight+'px:overflow:hidden">';
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img align="center" src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
slideHTML+='</div>';
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
    setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom)
{
    this.resetit()
    var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
    crossobj.style.zIndex++
    fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
    this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else
{
    var ns4imgobj=document.images['defaultslide'+this.slideshowid]
    ns4imgobj.src=this.postimages[this.curimageindex].src
}

var photoId="photoTip_"+this.slideshowid

if(this.mouseovercheck==0 && this.showtip && document.getElementById(photoId))
{
        var tip=this.theimages[this.curimageindex][3];
        document.getElementById(photoId).innerText=this.theimages[this.curimageindex][3];
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}
