<!--

/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function Bookmark(){
  window.external.AddFavorite(document.URL,document.title);
}

/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function TellAFriend(){
  tellwin=window.open('http://www.thegreenbow.com/tell.html','','left=180,top=260,width=300,height=200');
}


/*--------------------------------------------------------------------------------
DynPopup(img,bshow)
jc080404
Dynamic display of an image.

img = url of the img to display in the popup (e.g.:"images/img.jpg")
      Doesn't matter if bshow=='hidden'.
bshow = 'visible'|'hidden'

Example:
<link href="commun/tgbstyle2.css" rel="stylesheet" type="text/css" />	(declaration of the class "#dynpopup")
...
<a onmouseover="javascript:DynPopup('images/windows_firewall_vpn_001.jpg','visible');" onmouseout="javascript:DynPopup(0,'hidden');">
...
<span id="dynpopup">
<table border=1 cellpadding=10><tr><td bgcolor=white align=center><img src="images/img.jpg" id="imgpopup"></td></tr></table>
</span>
--------------------------------------------------------------------------------*/
function DynPopup(img,bshow)
{
  document.getElementById("dynpopup").style.left = 100;
  document.getElementById("dynpopup").style.top = document.body.scrollTop+10;
  document.getElementById("dynpopup").style.visibility = bshow;

  if(bshow=='visible')
    document.getElementById("imgpopup").src = img;
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function ScreenShow(path,x,y,w,h){

  photo = new Image();
  photo.src = path ;

  sztitle = "<title>TheGreenBow VPN IPSec Client</title>";
  szbody = "<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>";
  sztable = "<table width=100% height=100%><tr><td align=center valign=center>";
  imgsrc = "<img src="+ path +">";
  szend = "</td></tr></table></body>"

  win = window.open("","",'left='+x+',top='+y+',width='+w+',height='+h+',');

  screenpage = sztitle + szbody + sztable + imgsrc + szend;
  win.document.write(screenpage);
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function FlashShow(path,x,y,w,h){

  sztitle = '<title>TheGreenBow VPN Mobile</title>';
  szbody = '<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">';
  sztable = "<table width=100% height=100%><tr><td align=center valign=center>";
  flash = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"" + w + "\" height=\"" + h + "\">\n<param name=\"movie\" value=\"" + path + "\" />\n<param name=\"quality\" value=\"high\" />\n<embed src=\"" + path + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + w + "\" height=\"" + h + "\"></embed>\n</object>";
  szend = "</td></tr></table></body>"

	nw = w+10;
	nh= h+10;
  win = window.open("","",'left='+x+',top='+y+',width='+nw+',height='+nh+',');

  screenpage = sztitle + szbody + sztable + flash + szend;
  win.document.write(screenpage);
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function ShowImage(title,path,w,h){
	
	//win.close();
	
	x = (screen.availWidth-w)/2
	y = (screen.availHeight-h)/2
	//Limage.moveTo(((),(screen.availHeight/5));

  sztitle = "<title>"+ title +"</title>";
  szbody = "<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>";
  sztable = "<table width=100% height=100%><tr><td align=center valign=center>";
  imgsrc = "<img src="+ path +">";
  szend = "</td></tr></table></body>"
  
  if(window.tgbview) alert("wintgbview");

  win = window.open("","",'left='+x+',top='+y+',width='+w+',height='+h+',');

	//alert(window.tgbview)
  screenpage = sztitle + szbody + sztable + imgsrc + szend;
  win.document.write(screenpage);
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function WizardShow(path,x,y,w,h)
{
  window.open(path,"",'left='+x+',top='+y+',width='+w+',height='+h+',');
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function WinOpen(page,x,y,w,h)
{
  window.open(page,'page','left='+x+',top='+y+',width='+w+',height='+h+',');
} 


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function jumpto(form) {
  var myindex=form.language.selectedIndex
  parent.location=(form.language.options[myindex].value);
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function editFile(fid){
	document.getElementById('div_' + fid).innerHTML = '<input name="' + fid + '" id="' + fid + '" type="file" size="50" class="arial11" /> <a href="#" onclick="editLink(\'' + fid + '\')" title="Url Link"><img src="http://www.thegreenbow.com/images/icones/ico_link.gif" width="16" height="16" border="0" /></a>';
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function editLink(fid){
	document.getElementById('div_' + fid).innerHTML = '<input name="' + fid + '" id="' + fid + '" type="text" size="50" class="arial11" /> <a href="#" onclick="editFile(\'' + fid + '\')" title="Upload file" ><img src="http://www.thegreenbow.com/images/icones/ico_file.gif" width="16" height="16" border="0" /></a>';
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function new_freecap(){
	// loads new freeCap image
	if(document.getElementById){	
		// extract image name from image source (i.e. cut off ?randomness)
		thesrc = document.getElementById("freecap").src;
		thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
		// add ?(random) to prevent browser/isp caching
		document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000);
	} else {
		alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
	}
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function VerifProduct(){
	product_value = document.getElementById('Product').value
	if( product_value == "BOBPRO" || product_value == "BOB" || product_value == "MAX"){
		document.getElementById('vpn_gateway_plus').style.display = "none";
	}else{
		document.getElementById('vpn_gateway_plus').style.display = "block";
	}
	if( product_value == "MOB"){
		document.getElementById('vpn_mob_plus').style.display = "block";
	}else{
		document.getElementById('vpn_mob_plus').style.display = "none";
	}
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function DisplayFormProduct(){
	product_value = document.getElementById('Product').value;
	
	if( product_value == "fwd" || product_value == "fwp" || product_value == "cml"){
		document.getElementById('vpn_gateway_plus').style.display = "none";
	}else{
		document.getElementById('vpn_gateway_plus').style.display = "block";
	}
	if( product_value == "mob"){
		document.getElementById('vpn_mob_plus').style.display = "block";
	}else{
		document.getElementById('vpn_mob_plus').style.display = "none";
	}
}


/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
function toggleItem(id,button,forcedTo) {
	if(document.getElementById)
		itm = document.getElementById(id);
	else if(document.all)
		itm = document.all[id];
	else if(document.layers)
		itm = document.layers[id];
	else return false;
	
	// Let's force to hidden or visible
	if (forcedTo == 'hidden') request = 2;
	else if (forcedTo == 'visible') request = 1;

	// Let's toggle if no specific request
	else if (itm.style.display == 'none') request = 1;
	else request = 2;
	
	switch (request) {
	default:
	case 1:
		itm.style.display = '';
		if (button != '') button.src = 'images/list_next_out.gif';
		break;    
	case 2:
		itm.style.display = 'none';
		if (button != '') button.src = 'images/list_next2.gif';
		break;
	}
	return false;
}

/*--------------------------------------------------------------------------------
FONCTION COLAPSE EXPAND
--------------------------------------------------------------------------------*/

var div_id_printed=null;

function printId(id_section,itm) {

	if (itm != "") {
		// Let's clear the styles for all similar items by tag and then by id (faster). All items must have the same id.
		var all_itm = document.getElementsByTagName(itm.tagName);
		for(var i = 0;i < all_itm.length;i++) {
			var  this_itm = all_itm.item(i);
			// Let's find only the same items based on their ID
			if (this_itm.id == itm.id) {
				// Let's toggle for current item and clear styles for other items
				if (this_itm == itm) {
					if (this_itm.style.fontStyle == 'italic') {
						this_itm.style.fontStyle = 'normal';
						this_itm.style.color = 'white';
					} else {
						this_itm.style.fontStyle = 'italic';
						this_itm.style.color = '#99A6C3';
					}
				} else {
					this_itm.style.fontStyle = 'normal';
					this_itm.style.color = 'white';
				}
			}
		}
	}

	if (div_id_printed) {
		toggleItem(id_section,'','hidden');
		toggleItem(div_id_printed,'','hidden');
	}
	
	if (div_id_printed==id_section) {
		div_id_printed=null;
	} else {
		toggleItem(id_section,'','visible');
		div_id_printed=id_section;
	}
}
/* --------------------------------------------------- */
/* --------------------------------------------------- */

var div_id_printed1=null;

function printId1(id_section) {
	if (div_id_printed1) {
		toggleItem(id_section,'','hidden');
		toggleItem(div_id_printed1,'','hidden');
	}
	
	if (div_id_printed1==id_section) {
		div_id_printed1=null;
	} else {
		toggleItem(id_section,'','visible');
		div_id_printed1=id_section;
	}
}

/*--------------------------------------------------------------------------------
FONCTION COPY THIS
--------------------------------------------------------------------------------*/

function CopyToClipboard(tagID) {
   CopiedTxt = tagID.createTextRange();
   CopiedTxt.execCommand("Copy");
}

/**/
function copy2Clipboard(obj)
 {
 var textRange = document.body.createTextRange();
 textRange.moveToElementText(obj);
 textRange.execCommand("Copy");
 }
 
/**/

function CopyToClipboard3()

{
   document.Form1.txtArea.focus();
   document.Form1.txtArea.select();
   CopiedTxt = document.selection.createRange();
   CopiedTxt.execCommand("Copy");
}