/*
RAWR - Preview Box
(c) 2007-2008, RAWR Designs, Some Rights Reserved -
Christopher "That Stevens Guy" Stevens
Richard "Giant Eagle" Tuininga
(CC) http://creativecommons.org/licenses/by-nc-sa/3.0/
Any queries? -
Email: contact[at]rawr-designs.com
Forum: http://www.rejetto.com/forum/index.php?board=34.0
Homepage: http://rawr-designs.com/
If you have a widescreen FLV folder, place in the comment.
*/
var disable = false;
var boxOpen = null;
var ext;
/* Initialise preview box. */
function initPreviewBox(target,file) {
ext = file.substring(file.lastIndexOf("."),file.length);
ext = ext.toLowerCase();
if (disable == false) {
disable = true;
setTimeout("disable=false;", 350);
if(target != boxOpen) {
if(boxOpen!=null) boxFade(boxOpen,"out");
if(ext.match(".jpg|.jpeg|.png|.bmp|.tif|.tiff")) spawnIMGBox(target,file);
else if(ext.match(".flv|.mp3")) spawnRAWRBox(target,file);
else if(ext==".swf") spawnSWFBox(target,file);
else if(ext==".wmv") spawnRAWRwmvBox(target,file);
else if(ext==".wkv") spawnRAWRwkvBox(target,file);
else if(ext.match(".avi|.DivX")) spawnRAWRdivxBox(target,file);
else if(ext.match(".mpg|.mpeg|.mp4|.mpg|.mov")) spawnRAWRMPGBox(target,file);
else if(ext=="search") spawnSEARCHBox(target,file);
} else {
boxFade(boxOpen,"out");
}
}
}
/* Spawn 'Loading' box. */
function spawnBox(target,width,height) {
gEBI(target).innerHTML = "
";
Box = gEBI(target+"Box");
Box.style.left = Box.offsetLeft-500+(480-Box.offsetWidth)+"px";
Box.style.top = Box.offsetTop-(Box.offsetHeight+46)/2+"px";
boxFade(target,"in");
document.onmousedown = startDrag;
}
/* Spawn Search box. */
function spawnSEARCHBox(target,file) {
spawnBox(target,300,62);
setTimeout("setSEARCHBox(\""+target+"\",\""+file+"\");",300);
}
function setSEARCHBox(target,file) {
gEBI(target+"Box").firstChild.style.cursor="default";
document.onmousedown = null;
setName(lv_advSearch);
gEBI(target+"Content").innerHTML = "";
gEBI(target+"Content").style.background="transparent";
}
/* Spawn Image box. */
function spawnIMGBox(target,file) {
img = new Image();
img.src = "previews_and_thumbnails/prev-"+file.substring(file.lastIndexOf("/")+1,file.length)+".jpg";
if(img.complete) {
spawnBox(target,img.width,img.height);
setIMGBox(target,file,"setImmediatly");
} else {
setTimeout("setIMGBox(\""+target+"\",\""+file+"\",\"none\");",10);
}
}
function setIMGBox(target,file,status) {
if(img.width!=0) {
if(status == "none") {
spawnBox(target,img.width,img.height);
status = "boxLoaded";
}
if(status == "boxLoaded") {
setTimeout("setIMGBox(\""+target+"\",\""+file+"\",\"setImage\");",325);
} else if(status == "setImage") {
if(img.complete) {
gEBI(target+"Content").innerHTML = "
";
boxFade(target,"img");
setName(file);
img = null;
} else {
setTimeout("setIMGBox(\""+target+"\",\""+file+"\",\"setImage\");",200);
}
} else if(status == "setImmediatly") {
gEBI(target+"Content").innerHTML = "
";
setName(file);
img = null;
}
} else {
setTimeout("setIMGBox(\""+target+"\",\""+file+"\",\"none\");",50);
}
}
/* Spawn RAWR box. */
var volume = 50;
var height, width, aspect;
var playmethod = "single";
var context = "on";
function spawnRAWRBox(target,file) {
height = ext==".flv"?270:50;
width = ext==".flv"&&aspect=="wide"?480:320;
spawnBox(target,width,height);
setTimeout("setRAWRBox(\""+target+"\",\""+file+"\");",300);
}
function setRAWRBox(target,file) {
setName(file);
file = file.replace('+','%2B').replace('&','%26');
volume = getCookie('Volume') ? getCookie('Volume') : volume;
playmethod = getCookie('Method') ? getCookie('Method')+"&mode=full" : "single&mode=full";
if(autoplay == true) playmethod = "single";
if(mod_folder_tasks=="off"&&mod_statistics=="off"&&mod_shoutbox=="off") context = "off";
gEBI(target+"Content").innerHTML = "