// JavaScript Document
var i;
var timer_id; 
i=0;

function scroll_iframe(frm,inc,dir) {
  if (timer_id) clearTimeout(timer_id);
  if (window.frames[frm]) {
    window.frames[frm].scrollBy(0, inc);
    timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" + dir + "')", 20);
  }
}

function stopScroll() {
 if (timer_id) clearTimeout(timer_id);
  }

function img_rot(im, n) {
	/*if (i<=n) {i++;}*/
/*	else {i=2;}*/
  
  i = Math.ceil(n * Math.random());

  
	document.getElementById(im).src=im + "" + i+'.jpg';	
	
	if (im == "thisIm" && i == 0) {document.getElementById('speyes').style.visibility = 'visible';}
	else {document.getElementById('speyes').style.visibility = 'hidden';}
	
	}
	
function son(objID,i) {
if (i == 1) {document.getElementById(objID).style.visibility = 'visible';}
else {document.getElementById(objID).style.visibility = 'hidden';}
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 