// ============== fonction frame killer ==============

if (top.frames.length!=0) top.location=self.document.location;


// ============== fonction popup fullscreen ==============

function fullscreen(url) {
	var windowWith = screen.availWidth - 9;
	var windowHeight = screen.availHeight - 29;
	if (window.open)
		{
			window.open(url,'mainWindowCC','width='+windowWith+',height='+windowHeight+',top=0,left=0');
		}
	else window.location = url;
}


// ============== fonction pop up ==============

var pastLeft=0;
var pastTop=10;
var maxleft=1000;
var popups=new Array();
var cntimg=-1;

function openPopUpImg(img,imgid,imgw,imgh) {

	var iw = parseInt(imgw); // + 20
	var ih = parseInt(imgh); // + 20
	var thisleft=pastLeft+10;
	var newleft=thisleft+iw;
	if (newleft > maxleft)
	{
		newleft=10+iw;
		thisleft=10;
		pastTop=pastTop+50;
	}
	pastLeft=newleft;
	var thistop=pastTop;
	thisleft = 20;
	thistop = 20;
	var details = 'toolbar=0,location=0,directories=0,status=0,scrollbars=no,resizable=0,copyhistory=0,menuBar=0,width='+iw+',height='+ih+',left='+thisleft+',top='+thistop;
	var winname = window.open('popupimg.php?imgid='+imgid,'popupimg'+imgid,details);
}

function openPopUpPDF(tid,ctid) {
	window.open('popuppdf.php?tid='+tid+'&ctid='+ctid,'popuppdf');
}

function openPopUpPrint(tid,ctid) {
	window.open('popupprint.php?tid='+tid+'&ctid='+ctid,'popuppdf');
}

function openPopUpVideo(tid,ctid) {
	var saw = screen.availWidth;
	var sah = screen.availHeight;
	var paw = 630;
	var pah = 525;
	var pl = (saw - paw) / 2;
	var pt = (sah - pah) / 2;
	var details = 'toolbar=0,location=0,directories=0,status=0,scrollbars=no,resizable=0,copyhistory=0,menuBar=0,width='+paw+',height='+pah+',left='+pl+',top='+pt;
	window.open('clip.php?filmid='+tid,'videoclip',details);
}
