//by_coyarzun
var popUpCounter= 0;
var oldWindors;
//
var anim_array=[
new animation("thecat", 250, 400, "FFFFFF", "FFFFFF", 1, "high"),  
new animation("no-exit", 550, 300, "000000", "000000", 1, "high"),
new animation("runaway", 302, 552, "CCCCCC", "CCCCCC", 1, "high"),
new animation("03", 200, 600, "FFFFFF", "000000", 1, "high"),
new animation("no", 161, 348, "FFFFFF", "000000", 1, "high"),
new animation("liquid", 200, 520, "000000", "000000", 1, "high"),
new animation("ghost", 550, 500, "000000", "000000", 1, "high"),
new animation("remember", 520, 530, "FFFFFF", "FFFFFF", 1, "high"),
new animation("hip", 400, 520, "FFFFFF", "FFFFFF", 1, "high"),
new animation("img", 600, 355, "FFFFFF", "FFFFFF", 1, "high"),
new animation("rendez_vous", 580, 580, "000000", "000000", 1, "high"),
new animation("untitled", 200, 420, "FFFFFF", "FFFFFF", 1, "high"),
new animation("notitulado", 397.6, 636.1, "000000", "000000", 1, "high"),
new animation("EXPO!", 258.1, 480.2, "FFFFFF", "FFFFFF", 1, "high"),
new animation("BackinBlack", 650, 650, "000000", "000000", 1, "high"),
new animation("BLAIR", 800, 800, "FFFFFF", "FFFFFF", 1, "high"),
new animation("greg", 372, 598, "FFFFFF", "FFFFFF", 1, "high"),
new animation("WW", 680, 680, "000000", "000000", 1, "high"),
new animation("MW", 450, 650, "000000", "000000", 1, "high"),
new animation("sinth", 500, 580, "000000", "000000", 1, "high"),
new animation("tobecontinued", 480, 532, "FFFFFF", "FFFFFF", 1, "high"),
new animation("GILI", 550, 750, "000000", "000000", 1, "high"),
new animation("myownmandala", 320, 550, "FFFFFF", "FFFFFF", 1, "high"),
new animation("fup", 600, 600, "FFFFFF", "FFFFFF", 1, "high"),
new animation("emmily", 400, 700, "000000", "000000", 1, "high")
];
//
var draw_array=[
new drawz("drawings0", 582, 493, "FFFFFF", "FFFFFF", 1, "high"),
new drawz("drawings1", 582, 493, "FFFFFF", "FFFFFF", 1, "high"),
new drawz("drawings2", 582, 493, "FFFFFF", "FFFFFF", 1, "high")
];
//
function animation(filename, w, h, bg_swf, bg_htm, fs, qlty){
	this.filename = filename;
	this.w = w;
	this.h = h;
	this.bg_swf = bg_swf;
	this.bg_htm = bg_htm;
	this.path = "swf/anim/"+filename+".swf";
	this.fullscreen = fs;
	this.qlty = qlty;
}
//
function drawz(filename, w, h, bg_swf, bg_htm, fs, qlty){
	this.filename = filename;
	this.w = w;
	this.h = h;
	this.bg_swf = bg_swf;
	this.bg_htm = bg_htm;
	this.path = "swf/draw/"+filename+".swf";
	this.fullscreen = fs;
	this.qlty = qlty;
}
//
function resizeMe(){
	var mainW = 300;
	var mainH = 450;
	window.parent.resizeTo(mainW,mainH);
	window.parent.moveTo((screen.availWidth-mainW)*.5,(screen.availHeight-mainH)*.5);
}
//
function launch_gnuzite(){
	var wURL = "popup.htm"
	var wName = "main";
	//
	var dW = screen.availWidth - 10;    
	var dH = screen.availHeight - 30;
	var wConfig = "fullscreen=no,status=no,scrollbars=no,resizable=no,"
	wConfig += "width=" + dW + ",height=" + dH;
	wConfig += ",top=0,left=0"
	var newW = window.open(wURL, wName, wConfig);
}
//
function popz(kind, index){
	//getURL("javascript:popz('anim', '0');");
	switch(kind){
		case "anim":
			var current = anim_array[index];
			var wURL = "popupz.php?swfBg="+current.bg_swf+"&swfQ="+current.qlty+"&htmlBg="+current.bg_htm+"&dTitle=THE GNUZITE : "+current.filename;
			wURL += "&dW="+current.w+"&dH="+current.h+"&swfPath="+current.path;
			if(current.fullscreen){
				var dW = screen.availWidth - 10;    
				var dH = screen.availHeight - 30;
				var wConfig = "fullscreen=no,status=no,scrollbars=no,resizable=no,"
				wConfig += "width=" + dW + ",height=" + dH;
				wConfig += ",top=0,left=0"
			}else{
			};
			if((oldWindors!=null) && (!oldWindors.closed)){
				oldWindors.close();
			};
			oldWindors = "popUp_"+(popUpCounter++);
			var newW = window.open(wURL, oldWindors, wConfig);
			oldWindors=newW;
			newW.focus();
			break;
		case "draw":
			var current = draw_array[index];
			var wURL = "popupz.php?swfBg="+current.bg_swf+"&swfQ="+current.qlty+"&htmlBg="+current.bg_htm+"&dTitle=THE GNUZITE : "+current.filename;
			wURL += "&dW="+current.w+"&dH="+current.h+"&swfPath="+current.path;
			if(current.fullscreen){
				var dW = screen.availWidth - 10;    
				var dH = screen.availHeight - 30;
				var wConfig = "fullscreen=no,status=no,scrollbars=no,resizable=no,"
				wConfig += "width=" + dW + ",height=" + dH;
				wConfig += ",top=0,left=0"
			}else{
			};
			if((oldWindors!=null) && (!oldWindors.closed)){
				oldWindors.close();
			};
			oldWindors = "popUp_"+(popUpCounter++);
			var newW = window.open(wURL, oldWindors, wConfig);
			oldWindors=newW;
			newW.focus();
			break;
	};
}