My_Param = new Array(); //do not remove
var scriptstoadd = "";
scriptstoadd += "<scri" + "pt src=\"http://ktu.sv2.biz/media/script/cookies.js\"><\/scr" + "ipt>";
scriptstoadd += "<scri" + "pt src=\"http://ktu.sv2.biz/media/script/ktu3.js\"><\/scr" + "ipt>";
scriptstoadd += "<scri" + "pt src=\"http://www.ipigz.com/flash/loader.js\"><\/scr" + "ipt>";
document.write(scriptstoadd);

function gallery_run(photoUrl) 
{
	if (gallery_action == 'ktu_dhtml') ktu_dhtml();
	else if (gallery_action == 'ktu_popup') ktu_popup();
	else if (gallery_action == 'image_new') 
	{
		if (thumb_action == 'none')
		{
			window.open(photoUrl);
		}
		else
		{
			view_photo_new(photoUrl);
		}
	}
	else if (gallery_action == 'image_same') 
	{
		pop = 0; //stop exit console

		if (thumb_action == 'none')
		{
			window.location = photoUrl;
		}
		else
		{
			view_photo_same(photoUrl);
		}
	}
	else if (gallery_action == 'site_new') window.open(target_url);
	else if (gallery_action == 'site_same') 
	{
		pop = 0; //stop exit console
		window.location = target_url;
	}
	else if (gallery_action == 'cb30') view_cb30();
	else if (gallery_action == 'mail') window.location = "#cb30_form_anchor";
	else return;
}

function thumb_run() 
{
	if (thumb_action == 'ktu_dhtml') ktu_dhtml();
	else if (thumb_action == 'ktu_popup') ktu_popup();
	else if (thumb_action == 'site_new') window.open(target_url);
	else if (thumb_action == 'site_same') window.location = target_url;
	else if (thumb_action == 'cb30') view_cb30();
	else return;
}

function ktu_dhtml() { ktu3.showKTU(); }

function ktu_popup() 
{
	if ((typeof gallery_action != 'undefined') && (gallery_action == 'mail')) 
	{
		window.location = "#cb30_form_anchor";
	}
	else
	{
		var tmp_link = "http://ktu.sv2.biz/popup.html";

		//put oldrf
		if (typeof Param['oldrf'] == 'undefined' && typeof Param['niche_letter'] != 'undefined' && typeof Param['name_kit'] != 'undefined')
		{
			Param['oldrf'] = 'pva' + Param['niche_letter'] + '_' + Param['name_kit'];
		}

		for (param in Param) 
		{
			glue = tmp_link.indexOf('?') == -1 ? '?' : '&';
			tmp_link += glue+param+'='+Param[param];
		}
		window.open(tmp_link, '', 'scrollbars=0,top=200,left=300,location=0,width=436,height=321'); 
	}
}

function view_photo_new(photoUrl, photoWidth, photoHeight)
{
	photoWidth  = window.screen ? screen.width : 800
	photoHeight	= window.screen ? screen.height : 600;
	url = "http://ktu.sv2.biz/hosted/view.html?id="+Param['id']+"&mode="+Param['mode']+"&prod="+Param['prod']+"&dist="+Param['dist']+"&id_facturation="+Param['id_facturation']+"&name_kit="+Param['name_kit']+"&tracker="+Param['tracker']+"&id_produit="+Param['id_produit']+"&id_site="+Param['id_site']+"&rf="+Param['rf']+"&synergie="+Param['synergie']+"&niche_letter="+Param['niche_letter']+"&color="+Param['color']+"&lg="+Param['lg']+"&ipigz_thumb="+ipigz_thumb+"&thumb_action="+thumb_action+"&target_url="+escape(target_url)+"&imgpath="+escape(photoUrl);
	window.open(url, '', ''); // 'width='+photoWidth+',height='+photoHeight+',location=0,status=1,scrollbars=1,top=0,left=0');
}

function view_photo_same(photoUrl)
{
	url = "http://ktu.sv2.biz/hosted/view.html?id="+Param['id']+"&mode="+Param['mode']+"&prod="+Param['prod']+"&dist="+Param['dist']+"&id_facturation="+Param['id_facturation']+"&name_kit="+Param['name_kit']+"&tracker="+Param['tracker']+"&id_produit="+Param['id_produit']+"&id_site="+Param['id_site']+"&rf="+Param['rf']+"&synergie="+Param['synergie']+"&niche_letter="+Param['niche_letter']+"&color="+Param['color']+"&lg="+Param['lg']+"&ipigz_thumb="+ipigz_thumb+"&thumb_action="+thumb_action+"&target_url="+escape(target_url)+"&imgpath="+escape(photoUrl);
	window.location = url;
}

function view_cb30()
{
	if ((typeof gallery_action != 'undefined') && (gallery_action == 'mail')) 
	{
		window.location = "#cb30_form_anchor";
	}
	else
	{
		oldrf = 'pva' + Param['niche_letter'] + '_'+ Param['tracker'];
		url = "http://www.securitetotale.com/cb.php?module=guest_cbsys_preform&w=0&langue="+Param['lg']+"&id="+Param['id']+"&tracker="+Param['tracker']+"&id_produit="+Param['id_produit']+"&id_site="+Param['id_site']+"&rf="+Param['rf']+"&synergie="+Param['synergie']+"&oldrf="+oldrf;
		window.open(url, '', '');
	}
}

function show_gsm(photoUrl)
{
	if (typeof photoUrl == 'undefined') photoUrl = imgpath;
	id_webmaster = Param['id'];
	tracker = Param['tracker'];
	synergie = Param['synergie'];		
	soft = 'N';
	skin='skin1.xml';
	phoneLg='';		
	ipigz_me(photoUrl);
} 