function sendToFriend()
{
	var strPath = '../send_to_friend/send_to_friend_he.html';
	var sendToFriendWin = window.open(strPath,'PopUp','width=520,height=520,scrollbars,resizable');
	sendToFriendWin.focus();
}

/////////////resize image popup//////////////

var imageWin;//must be global

function resizeImageWin()
{		
	//alert(imageWin.document.images[0].width);
	var winWidth = imageWin.document.images[0].width + 40;
	var winHeight = imageWin.document.images[0].height + 105;
	winHeight = winHeight > screen.height - 30 ? screen.height - 30 : winHeight;
	
	imageWin.resizeTo(winWidth, winHeight);
	imageWin.focus();
}

////////////image popup/////////////////////

function showImage(linkObj)
{
var imgObj = linkObj.firstChild;
if (imgObj.src.indexOf("_ill.") != -1 || imgObj.src.indexOf("_gal.") != -1)
{
	var strImgSrc = imgObj.src.substring(0,  imgObj.src.lastIndexOf(".") - 4) + "_big" + imgObj.src.substring(imgObj.src.lastIndexOf("."));
}
else
{
	var strImgSrc = imgObj.src.substring(0,  imgObj.src.lastIndexOf(".")) + "_big" + imgObj.src.substring(imgObj.src.lastIndexOf("."));
}

var strAltText = imgObj.alt;
var strTitleText = "Copyright &copy; 2004 Paintball Israel";
imageWin=window.open("","winImage","top=0,left=0,width=600,height=510,resizable=yes");

with(imageWin.document)
	{
		open();
		write("<html><head><title>Paintball Israel - " + strAltText + "</title>");
		write("<link rel='stylesheet' type='text/css' href='../_css/general_pb_he.css'>");
		write("<link rel='stylesheet' type='text/css' media='print' href='../_css/print_pb_he.css'>");
		write("</head><body dir='rtl' onload='opener.resizeImageWin()'><table align='center'><tr><td>");
		write("<img src='" + strImgSrc + "' title='" +strTitleText +"' alt='" + strAltText + "'><br></td></tr>");
		write("<tr class='noPrint'><td align='center'><form>");
		write("<button style='margin:2 0 0 20' class='button' onClick='window.close();' title='Close'>Close</button>");
		write("<button style='margin:2 20 0 0' class='button' onClick='window.print();' title='Print'>Print</button>");
		write("</form></td></tr></table></body></html>");
		close();
	}
return false;
}

////////////map popup/////////////////////

function showMap(strImgSrc)
{
var strAltText = "Map";
var strTitleText = "Copyright &copy; 2004 Paintball Israel";
imageWin=window.open("","winImage","top=0,left=0,width=680,height=450,resizable=yes");

with(imageWin.document)
	{
		open();
		write("<html><head><title>Paintball Israel - " + strAltText + "</title>");
		write("<link rel='stylesheet' type='text/css' href='../_css/general_pb_he.css'>");
		write("<link rel='stylesheet' type='text/css' media='print' href='../_css/print_pb_he.css'>");
		write("</head><body dir='rtl'><table align='center'><tr><td>");
		write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="640" height="371" id="map_center" align="middle">');
		write('<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + strImgSrc + '" />');
		write('<param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />');
		write('<embed src="' + strImgSrc + '" quality="high" bgcolor="#ffffff" width="640" height="371" name="map_center" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
		write('</td></tr>');
		write("<tr class='noPrint'><td align='center'><form>");
		write("<button style='margin:2 0 0 20' class='button' onClick='window.close();' title='Close'>Close</button>");
		write("<button style='margin:2 20 0 0' class='button' onClick='window.print();' title='Print'>Print</button>");
		write("</form></td></tr></table></body></html>");
		close();
	}
	imageWin.resizeTo(680,450);
	imageWin.focus();

}
////
////////imgFromLink popup/////////////////////

function showImgFromLink(strImgSrc)
{
var strAltText = "";
var strTitleText = "Copyright &copy; 2004 Paintball Israel";
imageWin=window.open("","winImage","top=0,left=0,width=600,height=510,resizable=yes");

with(imageWin.document)
	{
		open();
		write("<html><head><title>Paintball Israel</title>");
		write("<link rel='stylesheet' type='text/css' href='../_css/general_pb_he.css'>");
		write("<link rel='stylesheet' type='text/css' media='print' href='../_css/print_pb_he.css'>");
		write("</head><body dir='rtl' onload='opener.resizeImageWin()'><table align='center'><tr><td>");
		write("<img src='" + strImgSrc + "' title='" +strTitleText +"' alt=''><br></td></tr>");
		write("<tr class='noPrint'><td align='center'><form>");
		write("<button style='margin:2 0 0 20' class='button' onClick='window.close();' title='Close'>Close</button>");
		write("<button style='margin:2 20 0 0' class='button' onClick='window.print();' title='Print'>Print</button>");
		write("</form></td></tr></table></body></html>");
		close();
	}
}

///////////////card popup/////////////////////

function openCard(strImgSrc)
{
var strAltText = "Card";
var strTitleText = "Copyright &copy; 2004 Paintball Israel";
imageWin=window.open("","winImage",'top=0,left=0,width=640,height=600,scrollbars,resizable,toolbar,menubar');

with(imageWin.document)
	{
		open();
		write("<html><head><title>Paintball Israel - " + strAltText + "</title>");
		write("<link rel='stylesheet' type='text/css' href='../_css/general_pb_he.css'>");
		write("<link rel='stylesheet' type='text/css' media='print' href='../_css/print_pb_he.css'>");
		write("</head><body dir='rtl' onload='opener.resizeImageWin()'><table align='center'><tr><td>");
		write("<img src='" + strImgSrc + "' title='" +strTitleText +"' alt='" + strAltText + "'><br></td></tr>");
		write("<tr class='noPrint'><td align='center'><form>");
		write("<button style='margin:2 0 0 20' class='button' onClick='window.close();' title='Close'>Close</button>");
		write("<button style='margin:2 20 0 0' class='button' onClick='window.print();' title='Print'>Print</button>");
		write("</form></td></tr></table></body></html>");
		close();
	}
}
///////////////html popup/////////////////////

function openPopUp(strPath)
{
	popUpWin=window.open(strPath,"PopUp",'top=0,left=0,width=660,height=450,scrollbars,resizable,toolbar,menubar');
	popUpWin.focus();
}
///////////////video popup/////////////////////

function openVideoPopUp(strPath)
{
	popUpWin=window.open(strPath,"PopUp",'top=0,left=0,width=460,height=370,scrollbars,resizable');
	popUpWin.focus();
}

function viewContactDiv(bId)
{
	var branchId = bId || '0';
	
	displayPopUpDiv();
	var	iframe = document.createElement('IFRAME');
	iframe.setAttribute('name', 'contactFrame');
	iframe.setAttribute('id', 'contactFrame');
	iframe.setAttribute('width', '460');
	iframe.setAttribute('height', '500');
	iframe.setAttribute('frameborder', '0');
	iframe.setAttribute('scrolling', 'no');
	iframe.setAttribute('src', '/contact/' + contactFormFile + '?bid=' + branchId);
	document.getElementById('contentDiv').appendChild(iframe);
}

function displayPopUpDiv(sHTML)
{
	var whiteDiv = document.getElementById('whiteDiv');
	if (whiteDiv == null) 
	{        
		whiteDiv = document.createElement('DIV');            
		whiteDiv.id = 'whiteDiv';
		document.getElementsByTagName('BODY')[0].appendChild(whiteDiv);
	}
	whiteDiv.style.height = getDocHeight() + 'px';
	whiteDiv.style.display = 'block';
	
	var centerDiv = document.getElementById('centerDiv');
	if (centerDiv == null) 
	{        
		centerDiv = document.createElement('DIV');            
		centerDiv.id = 'centerDiv';
		document.getElementsByTagName('BODY')[0].appendChild(centerDiv);
	}
	centerDiv.style.height = getDocHeight() + 'px';
	centerDiv.style.display = 'block';
	centerDiv.onclick = closePopUpDiv;
	
	var contentDiv = document.getElementById('contentDiv');
	if (contentDiv == null) 
	{        
		contentDiv = document.createElement('DIV');            
		contentDiv.id = 'contentDiv';
		centerDiv.appendChild(contentDiv);
	}
	contentDiv.style.top = 50 + getYScroll() + 'px';
	contentDiv.style.display = 'block';		
	//if (sHTML) contentDiv.innerHTML = sHTML;
	contentDiv.innerHTML = '<div id="closePopUpDiv"><a href="#" onClick="closePopUpDiv(); return false"><img src="/_images/close_x.gif" alt="' + closeText + '" title="' + closeText + '" width="28" height="28" /></a></div>';
}

function closePopUpDiv()
{		
	var whiteDiv = document.getElementById('whiteDiv');
	if (whiteDiv != null) whiteDiv.style.display = 'none';  	
	
	var centerDiv = document.getElementById('centerDiv');
	if (centerDiv != null) centerDiv.style.display = 'none';   
	
	var contentDiv = document.getElementById('contentDiv');
	if (contentDiv != null) 
	{
		contentDiv.style.display = 'none';
		contentDiv.innerHTML = '';
	}        
}    
    
