///////////////////////////////////////////////////////////////////////
//     25/09/2003                                                    //
//                                                                   //
//     This script was designed by Avi Ben Shoshan			         //
//                                                                   //
//     This Script Icludes General JS Function For The Project	     //
///////////////////////////////////////////////////////////////////////

function OpenPopUp(sPath,sLeft,sTop,sWidth,sHeight)
{
	var winHandle;
	var sHtml;
	winHandle = window.open(sPath,'PopUp','width='+ sWidth +',height='+ sHeight +',top='+ sTop +',left='+ sLeft +',scrollbars=1,status=1');
	winHandle.focus();
}

// ---- Function To Return Selected Posting Or Channel In CMS
// Return Value - Thr Selected Item
//var strAppPath = Request.ApplicationPath;
//var strExistingTarget ='קיים נתיב';
//var strTitle = 'נושא';
//var strSubTitle = 'תת נושא';
//var iDialogType = סוג תיבת הדו-שיח :
//		0 - Channels Dialog : Default
//		1 - Templates Dialog
//		2 - Reasource Dialog
//		3 - All
function onClickBrowse(strAppPath,strExistingTarget,strTitle,strSubTitle,iDialogType)
{

	// for Internal Links dialog
	var IDS_DEFAULT_OPEN_POSITION = ",dialogTop=50,dialogWidth=300"
	var IDS_WIN_INTLINKS_FEATURES = "width=450,height=500" + IDS_DEFAULT_OPEN_POSITION;
	var IDS_IEWIN_INTLINKS_FEATURES = "dialogWidth:450px;dialogHeight:500px;status:yes" + IDS_IE_DIALOG_DEFAULT_POSITION;
	// IE Modal/Modeless dialog will use this string
	var IDS_IE_DIALOG_DEFAULT_POSITION = ",dialogTop=50,dialogWidth=300"

	//  args = "ExistingTarget;Title;SubTitle"
	var aAttributes = new Array();
	aAttributes[0] = strExistingTarget;
	aAttributes[1] = strTitle;
	aAttributes[2] = strSubTitle;

	try
	{
		if(iDialogType >=0){}
		else
		iDialogType = '0'; // Default Value
	}
	catch(e){iDialogType = '0';} // Default Value
	// Call InternalLinks.aspx with "wbc_caller=IEModal" query string to indicate that
	// we called it with IE's showModalDialog() call instead of JavaScript window.open()
	// Also, need to set NRMODE to Unpublished in order for the tree to display offline objects
	var strDlgRet = window.showModalDialog(strAppPath + "/CmsManagment/InternalLinks/InternalLinks.aspx" + "?NRMODE=Unpublished&wbc_caller=IEModal&DlgMode=" + iDialogType, 
												aAttributes, IDS_IEWIN_INTLINKS_FEATURES);
	if (strDlgRet != "Cancel")
	{
		return strDlgRet;
	}
}