function popload(id, type, lang)
{
	var file;
	
	var wHeight = screen.height;
	var wWidth = screen.width;
	
	if(wWidth > 1600) wWidth = 1600;
	if(wHeight > 1200) wHeight = 1200;
	
	if(wWidth < 1024) wWidth = 1024;
	if(wHeight < 768) wHeight = 768;
	
	testwindow = window.open ('http://www.profilestudio.net/modules/flashPopup.php?id='+id+'&type='+type+'&lang='+lang, "mywindow", "height="+wHeight+",width="+wWidth+",resizable=1,scrollbars=0,location=0,status=1,menubar=0");
	testwindow.moveTo(0,0);
}

var periodicPicture;
var currentPic1;
var currentPic2;
var currentTab = 0;

function rotateImages()
{
	if (currentTab == 0)
	{
		array1 = $$('div.wedding-div');
		currentPic1 = (currentPic1 + 1) % array1.length;
		for(i=0;i<array1.length;i++)
		{
			var tmp = "pic_wed_"+i;			
			if ($(tmp))	$(tmp).hide();			
		}
		if ($('pic_wed_'+currentPic1)) $('pic_wed_'+currentPic1).show();
	} else
	{
		array2 = $$('div.commercial-div');
		currentPic2 = (currentPic2 + 1) % array2.length;
		for(i=0;i<array2.length;i++)
		{
			var tmp = "pic_com_"+i;			
			if ($(tmp))	$(tmp).hide();			
		}
		if ($('pic_com_'+currentPic2)) $('pic_com_'+currentPic2).show();
	}
	currentTab = !currentTab;
}

function startRotateImages(interval)
{
	array1 = $$('div.wedding-div');
	array2 = $$('div.commercial-div');
	currentPic1 = Math.floor(Math.random()*array1.length+1);
	currentPic2 = Math.floor(Math.random()*array2.length+1);
	rotateImages(); rotateImages();
	periodicPicture = new PeriodicalExecuter(rotateImages, interval);
}