var detect = navigator.userAgent.toLowerCase();
function checkIt(string) { return detect.indexOf(string) + 1; }

var opera  = (checkIt('opera')) ? true : false;
var dom    = (document.getElementById) ? true : false;
var ie     = (document.all) ? true : false;


function showHiLite()
{
   if (ie) {
      var oHI = document.all.hilight;

   } else if (dom) {
      var oHI = document.getElementById('hilight');
   }


   if(oHI.style.display=='inline')
   {
      oHI.style.display='none';
   }
   else oHI.style.display='inline';
} 


function MM_swapImgRestore() { 
	var i, x, a = document.MM_sr;
	for(i=0; a && i < a.length && (x=a[i] ) && x.oSrc; i++ )
		x.src=x.oSrc;
}

function MM_preloadImages() { 
	var d=document;
	if(d.images ) {
		if(! d.MM_p )
			d.MM_p=new Array();
		var i, j = d.MM_p.length, a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++ )
			if (a[i].indexOf("#")!=0 ) {
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
	}
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function popupWin(fileName,winWidth,winHeight)
{  
	if (popWin != null && !popWin.closed) { 
		popWin.close();
	}

	var popWin, popOptions = 'width='+winWidth+',height='+winHeight;
	popWin=open(fileName,'p',popOptions);
}


function popupArtistWin(fileName)
{  
	if (popWin != null && !popWin.closed) { 
		popWin.close();
	}

	var popWin, popOptions = 'width=530,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes';
	popWin=open(fileName,'p',popOptions);
}

function popupArtworkWin(fileName,winWidth,winHeight)
{  
	if (popWin != null && !popWin.closed) { 
		popWin.close();
	}

	var popWin, popOptions = 'width='+winWidth+',height='+winHeight+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes';
	popWin=open(fileName,'p',popOptions);
}



function HH_openPic(imgFile)
{
	open(imgFile,'p','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}


function catchClick(src)
{	
	if( document.images ) {
		(new Image()).src="http://www.hh-law.co.il/library/click.php?src="+escape(src);
	}
	return true;
} 


function monthTxt (monthNumber) {
	var Month=new Array();
	Month[1]="Jan";
	Month[2]="Feb";
	Month[3]="Mar";
	Month[4]="Apr";
	Month[5]="May";
	Month[6]="Jun";
	Month[7]="Jul";
	Month[8]="Aug";
	Month[9]="Sep";
	Month[10]="Oct";
	Month[11]="Nov";
	Month[12]="Dec";
	return Month[monthNumber];
}

function dayTxt (dayNumber) {
	var Day=new Array();
	Day[0]="Sun";
	Day[1]="Mon";
	Day[2]="Tue";
	Day[3]="Wed";
	Day[4]="Thu";
	Day[5]="Fri";
	Day[6]="Sat";
	return Day[dayNumber];
}

function writeDate(dayMonthClass,yearClass) {
	var dateObj = new Date();
	var thisDay 	= dateObj.getDay();
	var thisDate	= dateObj.getDate();
	var thisMonth	= dateObj.getMonth()+1;
	var thisYear	= dateObj.getFullYear();
	var dayName		= dayTxt(thisDay);
	var monthName	= monthTxt(thisMonth);
	var tempString = '<span class="' + dayMonthClass +'">' + monthName + '. ' + thisDate + '</span><br /><span class="' + yearClass +'">' + thisYear + '</span>';
	document.write(tempString);
}


/*
 * pops up centered window
 *
 * link example:	<a href="page.html" onClick="pop_win('page.html','','450', '250','resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no');return false;">
 * settings example: 'resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar,location,directories'
 */
var win = null;
function pop_win( mypage, myname, w, h, features )
{
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	
	if (winl < 0)
		winl = 0;
	
	if (wint < 0)
		wint = 0;
	
	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += features;

	win = window.open( mypage, myname, settings );
	win.window.focus();
}

function print_flash(width,height,fileName,noembed)
{
   document.write('<object style="position:relative;z-index:5;" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="'+height+'" width="'+width+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">\n');
   document.write('<param value="'+fileName+'" name="Movie" />\n');
   document.write('<param value="'+fileName+'" name="Src" />\n');
   document.write('<param value="transparent" name="WMode" />\n');
   document.write('<param value="-1" name="Play" />\n');
   document.write('<param value="-1" name="Loop" />\n');
   document.write('<param value="High" name="Quality" />\n');
   document.write('<param value="-1" name="Menu" />\n');
   document.write('<param value="always" name="AllowScriptAccess" />\n');
   document.write('<param value="ShowAll" name="Scale" />\n');
   document.write('<param value="0" name="DeviceFont" />\n');
   document.write('<param value="0" name="EmbedMovie" />\n');
   document.write('<param value="#ffffff" name="BGColor" />\n');
   document.write('<param value="1" name="SeamlessTabbing" />\n');
   document.write('<param value="0" name="Profile" />\n');
   document.write('<param value="0" name="ProfilePort" /><embed src="'+fileName+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"><noembed>'+noembed+'</noembed></embed></object>\n');
}

