var spot;
var previewid;
spot = 1;



function getWindowHeight() {
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	}
	else {
		if (document.documentElement&&document.documentElement.clientHeight) 
		{
			windowHeight=document.documentElement.clientHeight;
		} else {
			if (document.body&&document.body.clientHeight) {
				windowHeight=document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function previewClip(event){
	var e = event || window.event;
	var source = e.target || e.srcElement;
	var cords = findPos(source);
	var found = false;
	//loop through all clips in cliparr, if any are preview=true||visible=true and not current id then hide them
	for (var clipkey in cliparr){
		var clipobj = cliparr[clipkey];
		if (clipobj.preview == true && clipobj.visible == true){
			//if clipobj is not the id we want to see
			if (clipobj.id != previewid){
				//then hide/unload it
				clipobj.hide();
			}
		}
		//if clipobj is one that we want to display then show
		if (clipobj.id == previewid){
			clipobj.show();
			found = true;
		}
	}
	//if clip still not found then create it
	if (!found){
		var newclip = new clip(previewid);
		//set clip to preview mode
		newclip.preview = true;
		//now show clip at appropriate coords
		newclip.load(cords[0],cords[1]);
	}	
}

function detachPreview(){
	cliparr[previewid].detachPreview();
}

function overHolder(id){
	//
}

function outofHolder(id){
	//
}

function closePreview(){

}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);