﻿function GalleryNav(GalleryTitle){
			strLink='<table dir="rtl" height="100%" border="0" cellspacing="0" cellpadding="0" class="Top_NavSubsActive"><tr><td width="18">&nbsp;</td><td>&nbsp;&nbsp;|&nbsp;&nbsp;</td><td align="center">' + GalleryTitle + '</td><td>&nbsp;&nbsp;|&nbsp;&nbsp;</td></tr></table>';
			document.getElementById("SubNav").innerHTML=strLink;
		}

/**/

function SubNav(objLink,strActionName,Topic_ID,Topic_Title)
	{
		//alert(objLink);
		//alert(strActionName);
		//alert (Topic_ID);
		var linksArray = objLink.split("|");
		var strLink,objArray;
		
		strLink='<table height="100%" border="0" cellspacing="0" cellpadding="0" class="Top_NavSubs"><tr><td width="18">&nbsp;</td><td>&nbsp;&nbsp;|&nbsp;&nbsp;</td>';
		for (var i = 1;i<linksArray.length;i++)
			{			
			objArray = linksArray[i].split('=');
			if (Topic_ID != objArray[0])
				zClass = "Top_NavSubs";
			else
				zClass = "Top_NavSubsActive";
			
			strLink += '<td align="center" id="zTD_' + objArray[0] + '"><a href="Page_' + strActionName + '.cfm?Topic_ID=' + objArray[0] + '" class="' + zClass + '">' + objArray[1] +'</a></td><td>&nbsp;&nbsp;|&nbsp;&nbsp;</td>'
			}
		strLink += '</tr></table>'
		document.getElementById("SubNav").innerHTML=strLink;
		zTD = "zTD_" + Topic_ID;
		//document.getElementById(zTD).innerHTML='<font color="#204582">' + Topic_Title + '</font>';
		//return Topic_Title;
		return zTD;
	}

/**/

function SubNavNow(objLink,strActionName,Topic_ID,Topic_Title)
	{
		SubNav(objLink,strActionName,Topic_ID,Topic_Title)
		//document.getElementById(zTD).innerHTML='<font color="#204582">' + Topic_Title + '</font>';
	}

/**/

function zDiv(zText)
	{document.getElementById("zDiv").innerHTML = zText;}

/**/
function ShowGalleryPreview(strPreview,Item_Id,Cat_ID,Item_Name,Item_Description,adminMode)
		{
			strImage = '<img src="' + strPreview + '" hspace="0" vspace="0" border="0" height="300" alt="">';
			document.getElementById("Preview_Div").innerHTML = strImage;
			document.getElementById("Name_Div").innerHTML = Item_Name;
			document.getElementById("Info_Div").innerHTML = Item_Description;			
			if(adminMode){
				strBar = '<a href=javascript:OpenSmartWindow("SiteAdmin/SA/Edit_Gallery_Item.cfm?Item_ID=' + Item_Id + '",480,350);> מאפייני תמונה </a>';
				document.getElementById("Bar_Div").innerHTML = strBar;
				}		
		}
/**/		
function ResumeGalleryPreview(strPreview,Item_Id,Cat_ID,Item_Name,Item_Description)
		{
			//alert(strPreview);
			//
			strImage = '<img src="' + strPreview + '" hspace="0" vspace="0" border="0" height="300" width="400" alt=" Click to open large photo ">'
			//
			//strImage = '<a href=JavaScript:OpenOriginalPicture("' + strPreview + '");><img src=' + strPreview + ' border=0 alt=" Click to open large photo "></a>'
			//alert(strImage);
			document.getElementById("Preview_Div").innerHTML = strImage;
			document.getElementById("Name_Div").innerHTML = Item_Name;
			document.getElementById("Info_Div").innerHTML = Item_Description;
		}
				
/**/
function openItemInfoWin(url) {
			var ItemInfoWin = window.open(url, 'ColorChooser', 'resizable,width=550,height=410');
		}

/**/
function OpenSmartWindow(strUrl,zWidth,zHeight,zReferer)
{
	//
	strUrl = strUrl + "&zReferer=" + zReferer;
	//alert(strUrl);
	strWidthHeight = "resizable,status,left=100,top=30,width=" + zWidth + ",height=" + zHeight;
	window.open(strUrl,"SmartWindow",strWidthHeight);
}

/**/
function Open_HP_Item_Window(strUrl,zWidth,zHeight,zReferer)
{
	//
	strUrl = strUrl + "&zReferer=" + zReferer;
	//alert(strUrl);
	strWidthHeight = "resizable,status,left=100,top=30,width=300,height=250";
	window.open(strUrl,"SmartWindow",strWidthHeight);
}

/**/
function OpenContactForm()
	{window.open("ContactForm.htm","ContactForm","scrollbars=NO,left=100,top=100,height=450,width=600");
	 return;}

function ShowPictureL(strUrl)
{
	window.open(strUrl,"LargePicture","status,left=0,top=0,height=250,width=300");
	return;}

function OpenTellAfriend()
	{window.open("TellAfriend.cfm","TellAfriend","left=100,top=100,height=300,width=350");
	 return;}

/**/
function OpenSmartForum()
	{window.open("SmartForum/index.cfm","SmartForum","left=100,top=100,height=800,width=600");
	 return;}

/**/
 	 
//
function ViewLetter(FullFileName)
	{
	//alert(FullFileName);
	window.open("OriginalPicture.cfm?FullFileName=" + FullFileName,"OriginalPicture","status=0,left=1,top=1,height=520,width=620");
	 return;}
//	

function OpenOriginalPicture(FullFileName)
	{window.open("../../OriginalPicture.cfm?FullFileName=" + FullFileName,"OriginalPicture","status=0,left=1,top=1,height=340,width=430");
	 return;}
//	 
function OpenSmartWin(strUrl)
{
	//alert(strUrl);
	window.open(strUrl,"SmartWindow","status,left=100,top=30,height=400,width=600");
}

function OpenFilezManager(strURL)
	{
		window.open(strURL,"FilesManager","status,left=200,top=30,height=600,width=800");
	 return;
	 }
 
function OpenLargePic(strUrl)
{
	alert(strUrl)
	window.open(strUrl,"PictureWindow","left=10,top=10,height=300,width=440")
} 

function ShowPreview(strPreview)
		{
			strImage = '<a href=JavaScript:OpenOriginalPicture("' + strPreview + '");><img src=' + strPreview + ' border=0 alt=" Click to open large photo "></a>'
			//alert(strImage);
			parent.mainFrame.document.getElementById("PreviewDiv").innerHTML = strImage;
		}
function ShowGalleryPhoto(strGalleryPath,strFilename)
		{
			strImage = '<img id="_Ath_Slide" src=' + strGalleryPath + strFilename + ' hspace="0" vspace="0" border=0 alt=""  onload="OnImgLoad()">'
			//alert(strImage);
			document.getElementById("PreviewDiv").innerHTML = strImage;
			//<cfset CurrentFile=strFilename>
		}
		
function ShowGalleryPhotoLink(strPreview)
		{
			strImage = '<a href=JavaScript:OpenOriginalPicture("' + strPreview + '");><img src=' + strPreview + ' border=0 alt=" Click to open large photo "></a>'
			//alert(strImage);
			document.getElementById("PreviewDiv").innerHTML = strImage;
		}
		
function ShowDescription(strDescription,objAction,strActionName)
		{
		//alert(objAction)
		if (strDescription!=null)
		{
			document.getElementById("DescriptionDiv").innerHTML=strDescription;
		}
		
		if (strActionName != null)
		{
			//parent.leftFrame.location = 'left.cfm?action=' + strActionName + '&adminMode=#AdminMode#';
		
			var links=genLinks(objAction,strActionName);
		
			//alert(document.getElementById("zDiv"));
			if (document.getElementById("zDiv") != null)
			{
				document.getElementById("zDiv").innerHTML=links;
			}
		}
		//parent.leftFrame.document.getElementById("links").innerHTML ='';
		//parent.leftFrame.document.getElementById("zTable").innerHTML = links;
		//parent.leftFrame.document.getElementById("zDiv").innerHTML=links;
		}
		
//	Displays the 0 level Categories for a SECTION	
	function genLinks(objLink,strActionName)
	{
		//alert(objLink);
		
		var linksArray = objLink.split("|");
		
		var strLink,objArray;
		strLink='<table height="15" align="center" border="0" cellspacing="0" cellpadding="0" id="zTable" dir="rtl" lang="he" class="Top_SubLinks"><tr><TD height="15" width="50"><IMG src="images/spacer.gif" width="1" height="15" hspace="0" vspace="0" border="0" alt=""></td>';
		
		for (var i = 1;i<linksArray.length;i++)
		{
			objArray = linksArray[i].split('=');
			strLink += '<td align="center" nowrap"><a href="main.cfm?action=ShowDPCategory&table=Dp_' + strActionName + '_Cat&CatId=' + objArray[0] + '&actionName=' + strActionName +  '&adminMode=No" target="mainFrame" class="Top_SubLinks"><li>' + objArray[1] +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li></a></td>'
		}
		strLink += '</tr></table>'
		//alert(strLink);
		return strLink;
		
	}
	
/**/

// SMART Manager ------------------------------------------------------

function LayerOff(layer_id) {
	//alert(layer_id);
	if (document.all){
		//alert('hiding');
		document.all[layer_id].style.display="none"
		document.all[layer_id].style.visibility="hidden"
	}
	else
	{
		if(parent.document.layers){
		document.layers[layer_id].visibility="hide"
		}
	}
}

/**/
var layer_id;
function popUpFooterSubDiv(zCount) {
	layer_id = 'FooterSubDiv_' + zCount;	
	//alert(layer_id);
	if (document.all){
		//alert('block');
		document.all[layer_id].style.display="block"
		document.all[layer_id].style.visibility="visible"
		}
	else
		//alert('show');
		if(document.layers){
		document.layers[layer_id].visibility="show"
		}
	}

/**/

var layer_id;
function popUpFooterEditor() {
	layer_id = 'FooterEditorDiv';	
	if (document.all){
		//alert('block');
		document.all[layer_id].style.display="block"
		document.all[layer_id].style.visibility="visible"
		}
	else
		//alert('show');
		if(document.layers){
		document.layers[layer_id].visibility="show"
		}

//	}
	
	layer_id = 'FooterNormalDiv';
	if (document.all){
		//alert('hiding');
		document.all[layer_id].style.display="none"
		document.all[layer_id].style.visibility="hidden"
	}
	else
		if(parent.document.layers){
		document.layers[layer_id].visibility="hide"
		}
	
	//document.getElementById('PopUpButton').innerHTML = '<a href="javascript:popUpNormal();">ללא עריכה</a>' ;
}
/**/
var layer_id;
function popUpFooterSubDiv(zCount) {
	layer_id = 'FooterSubDiv_' + zCount;	
	
	if (document.all){
		//alert('if');
		document.all[layer_id].style.display='block'
		document.all[layer_id].style.visibility='visible'
		}
	else
		//alert('else');
		if(document.layers){
		document.layers[layer_id].visibility="show"
		}
	//alert(layer_id);
	return;
	}


/**/