

var mysearch = location.search;
var mypath =  location.protocol + "//" + location.host + "/";
var found = 0;



function getelement(myelement)
   {
   //alert( myelement );
   if (parseInt(navigator.appVersion) > 4)
       {                                                        // all version 5+ browsers
       var myObject = document.getElementById(myelement);
       return myObject.style
       }
   else if (navigator.appName == "Microsoft Internet Explorer")
       {                                                       // Old Internet Explorer Browsers
        return document.all[myelement].style
       }
   else if(navigator.appName == "Netscape")
       {                                                       //  Old Nagivator Browsers
       return document.layers[myelement]
       }
   alert( "please use IE of Navigator")
   return "error"
   }


// when we have a dropdown menu as an option (in the video for example)
// the function below is called when the one of the drop down is selected
// the function then added the value on the URL and refreshed the page.
// in the page itself the new value is extracted from the whole URL


function addToUrl( myelement )
    {
		
	var sel = "error";
	for (var x = 0; x < myelement.length; x++ )
	   {
	   var myobject = myelement.options[x];
	   if (myobject.selected == true) 
	     { 
		 sel = myobject.value; 
		 location.href =  location.protocol + "//" + location.host + location.pathname  + "?" + sel;
		 }
	   }			
		
	}


function blendimage(divid, imageid, imagefile, millisec) 
	{ 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
     
    //set the current image as background 
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
     
    //make image transparent 
    changeOpac(0, imageid); 
     
    //make new image 
    document.getElementById(imageid).src = imagefile; 

    //fade in image 
    for(i = 0; i <= 100; i++) { 
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
        timer++; 
    } 
} 




var first = 1;



//function showmyclip()
//   { 
//   var delaytime  = 4000; 
//   if (first != 1) {dopic();}
//   first = 0; 
//   setTimeout('showmyclip()',delaytime);
//   }




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 + ")"; 
	} 

//  -->

