/* this function opens a popup window named popupName that displays popupFile with height popupHeight and width popupWidth */

function openPopup(popupName,popupFile,windowFeatures)
{
	var w = window.open(popupFile, popupName, windowFeatures);
 	w.focus();
}

/* this function sets a cookie with name cookieName and value cookieValue
  the cookie will expire in x years
  to delete the cookie, set x to a negative number such as -1 */

function clickit(eleId){
	    var evt = document.createEvent("HTMLEvents");
		evt.initEvent("click", true, true);
	    document.getElementById("vidlink").dispatchEvent(evt);
        return false;
}
function setCookie(cookieName,cookieValue,x,cookieDomain,cookiePath)
{
	var today = new Date();
	var expYear = today.getFullYear() + x;
	var todayExpYear = new Date(expYear, today.getMonth(), today.getDate(), 0, 0, 0, 0);
	var cookieString = "";
	cookieString = cookieName + "=" + escape(cookieValue) + "; expires=" + todayExpYear.toGMTString();
        // just hardcode domain and path to website
	//cookieString += "; domain=.jewishpartisans.org";
	cookieString += "; path=/";
	/*
	if (cookieDomain.length)
	{
		cookieString += "; domain=" + cookieDomain;
	}
	if (cookiePath.length)
	{
		cookieString += "; path=" + cookiePath;
	}
	*/
	document.cookie = cookieString;
}

/* this function sets a cookie with name cookieName */
function readCookie(cookieName)
{
	var allCookies = "" + document.cookie;
	var cookiePosition = allCookies.indexOf(cookieName);
	if (cookiePosition == -1 || cookieName == "")
	{
		return "";
	}
	else
	{
		var cookieValueStart = cookiePosition + cookieName.length + 1;
		var cookieValueEnd = allCookies.indexOf(';',cookieValueStart);
		if (cookieValueEnd == -1)
		{
			cookieValueEnd = allCookies.length;
		}
		return unescape(allCookies.substring(cookieValueStart, cookieValueEnd));
	}
}

function Lvl_P2P(url,closeIt,delay){ //ver1.0 4LevelWebs
 			opener.location.href = url;
	if (closeIt == true)setTimeout('self.close()',delay);
}

// <<<<<<< video.js 
// Microsoft workaround
function qtVideoObj (screenWidth, screenHeight, movieURL, pluginType) {
 var txt="<object id='qtmovie' name='qtmovie' width=" + screenWidth + " height=" + screenHeight +
         " classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' " +
         " codebase='http://www.apple.com/qtactivex/qtplugin.cab'> " +
         " <param name='src' value=" + movieURL + " /> " +
         " <param name='autoplay' value='true' /> " +
         " <param name='controller' value='true' /> " +
         " <embed id='qtmovie' name='qtmovie' src=" + movieURL + " width=" + screenWidth + " height=" + screenHeight + " autoplay='true' controller='true' bgcolor='000000' pluginspage='http://www.apple.com/quicktime/download/' > " +
         " </embed> " +
         " <noembed> " +
         "  You do not have the appropriate player installed to view this.<br /> " + 
         "  <a href='javascript:\;' onClick=\"Lvl_P2P('http://www.apple.com/quicktime/download/',true,0500)\"> " +
         "    <img src='/images/get-qt.gif' alt='Get QuickTime' width='88' height='31' border='0' /> " +
         "  </a> " +
         " </noembed> " +
         " </object> "
	 ;
 //return txt;
 document.write(txt);
}
//=======
// Microsoft workaround
function qtVideoObj (screenWidth, screenHeight, movieURL, pluginType) {
 var txt="<object id='qtmovie' name='qtmovie' width=" + screenWidth + " height=" + screenHeight +
         " classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' " +
         " codebase='http://www.apple.com/qtactivex/qtplugin.cab'> " +
         " <param name='src' value=" + movieURL + " /> " +
         " <param name='autoplay' value='true' /> " +
         " <param name='controller' value='true' /> " +
         " <embed id='qtmovie' name='qtmovie' src=" + movieURL + " width=" + screenWidth + " height=" + screenHeight + " autoplay='true' controller='true' bgcolor='000000' pluginspage='http://www.apple.com/quicktime/download/' > " +
         " </embed> " +
         " <noembed> " +
         "  You do not have the appropriate player installed to view this.<br /> " + 
         "  <a href='javascript:\;' onClick=\"Lvl_P2P('http://www.apple.com/quicktime/download/',true,0500)\"> " +
         "    <img src='/images/get-qt.gif' alt='Get QuickTime' width='88' height='31' border='0' /> " +
         "  </a> " +
         " </noembed> " +
         " </object> "
	 ;
 //return txt;
 document.write(txt);
}

function wmvVideoObj (screenWidth, screenHeight, movieURL, pluginType) {
 var txt="<object id='wmvmovie' name='wmvmovie' width=" + screenWidth + " height=" + screenHeight +
         " classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' " +
         " codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'> " +
         " <param name='src' value=" + movieURL + " /> " + 
         " <param name='autostart' value='true' /> " +
         " <param name='controller' value='true' /> " +
         " <embed id='wmvmovie' name='wmvmovie' src=" + movieURL + " width=" + screenWidth + " height=" + screenHeight + " autostart='true' controller='true' bgcolor='#5568AA' pluginspage='http://www.microsoft.com/windows/windowsmedia/'>" +
         " </embed> " +
         " <noembed> " +
         " You do not have the appropriate player installed to view this.  <br /> " +
         " <a href='javascript:\;' onClick=\"Lvl_P2P('http://www.microsoft.com/windows/windowsmedia/download/',true,0500)\"> " +
         "   <img src='/images/wmf.gif' alt='Get Windows Media Player' width='120' height='32' border='0' /> " +
         " </a> " +
         " </noembed> " +
         " </object> "
      ;
   document.write(txt);
}
// Microsoft workaround
function zemQtVideoObj (cameraPosition,width) {
var txt="<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='" + width + "' height='288' codebase='http://www.apple.com/qtactivex/qtplugin.cab'> " +
	"  <param name='SRC' value='qtvr/pos" + cameraPosition + ".mov' /> "  +
	"  <param name='AUTOPLAY' value='true' /> <param name='CONTROLLER' value='true' /> " + 
	"  <embed src='qtvr/pos" + cameraPosition + ".mov' width='" + width + "' height='288' autoplay='true' controller='true' pluginspage='http://www.apple.com/quicktime/download/'> </embed> </object>";
 //return txt;
 document.write(txt);
}

//>>>>>>> 1.4
