function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openPopWindow(num) {
	if (num == 1) {
		window.open('prev/pssbio.html','pssbio','menubar=yes,resizable=yes,width=455,height=440');
	}
	if (num == 2) {
		window.open('samples/thornhill.html','thorn','menubar=yes,resizable=yes,width=393,height=484');
	}
	if (num == 3) {
		window.open('http://www.tjmcomputers.com/ncaa2003/intro.htm','matrix','menubar=yes,resizable=yes,width=800,height=600');
	}
	if (num == 4) {
		window.open('samples/pb2000/probiz2.html','solectronar','menubar=yes,resizable=yes,width=800,height=600');
	}
	if (num == 5) {
		window.open('samples/factorama.html','loth','menubar=yes,resizable=yes,width=1060,height=410');
	}
	if (num ==6) {
		window.open('prev/main.html','mainwin','menubar=yes,resizable=yes,width=650,height=460');
	}
	if (num ==7) {
		window.open('samples/alza2000/index_flash.htm','noflashver','width=790,height=480');
	}
	if (num ==8) {
		window.open('fusion.html','fusionwin','width=800,height=600');
	}
	if (num ==9) {
		window.open('samples/aradigm2003/introduction.php','','menubar=yes,scrollbars=yes,resizable=yes,width=800,height=650');
	}
	if (num ==10) {
		window.open('samples/slcbanners.html','','menubar=yes,scrollbars=yes,resizable=yes,width=700,height=500');
	}
	if (num ==11) {
		window.open('flash_samples/gelco_intro.html','','menubar=yes,scrollbars=yes,resizable=yes,width=840,height=590');
	}
	if (num ==12) {
		window.open('flash_samples/haas.html','','menubar=yes,scrollbars=yes,resizable=yes,width=720,height=720');
	}
	if (num ==13) {
		window.open('samples/slc_compare.php?pg=1','','menubar=yes,scrollbars=yes,resizable=yes,width=800,height=490');
	}
	if (num ==14) {
	window.open('samples/slc_compare.php?pg=2','','menubar=yes,scrollbars=yes,resizable=yes,width=800,height=490');
	}
	if (num ==15) {
	window.open('samples/slc_compare.php?pg=3','','menubar=yes,scrollbars=yes,resizable=yes,width=800,height=490');
	}
	if (num ==16) {
	window.open('samples/slc_compare.php?pg=4','','menubar=yes,scrollbars=yes,resizable=yes,width=800,height=490');
	}
	if (num ==17) {
	window.open('samples/slc_designs.php','','menubar=yes,scrollbars=yes,resizable=yes,width=800,height=490');
	}
	if (num ==18) {
	window.open('/samples/chiron2001_ar/flashintro.html','','menubar=yes,scrollbars=yes,resizable=yes,width=780,height=590');
	}
	if (num ==19) {
	window.open('/samples/thornhill.html','','menubar=yes,scrollbars=yes,resizable=yes,width=780,height=490');
	}
	if (num ==20) {
	window.open('/samples/aradigm2003_ar/introduction.php','','menubar=yes,scrollbars=yes,resizable=yes,width=780,height=590');
	}
	if (num ==21) { //width=767,height=580
	window.open('/samples/slr2002_ar/intro.html','','menubar=yes,scrollbars=yes,resizable=yes,width=767,height=580');
	}
	if (num ==22) {
	window.open('/samples/majorwork_spring2010.html','','menubar=yes,scrollbars=yes,resizable=yes,width=575,height=672');
	}
	if (num ==23) {
	window.open('/samples/majorwork_winter2010.html','','menubar=yes,scrollbars=yes,resizable=yes,width=830,height=450');
	}
	if (num == 24) {
		window.open('samples/hn_carousels.html','carou','menubar=yes,resizable=yes,width=730,height=550');
	}
	if (num == 25) {
		window.open('samples/hn_projects/YIR_2009/index.html','carou','menubar=yes,scrollbars=yes,resizable=yes,width=1000,height=550');
	}
	if (num == 26) {
		window.open('samples/hn_projects/YIR_2010/index.html','carou','menubar=yes,scrollbars=yes,resizable=yes,width=1000,height=550');
	}
	if (num == 27) {
	window.open('/samples/majorwork_spring2009.html','','menubar=yes,scrollbars=yes,resizable=yes,width=595,height=777');
	}
	if (num == 28) {
	window.open('/samples/majorwork_spring2011.html','','menubar=yes,scrollbars=yes,resizable=yes,width=791,height=526');
	}
		if (num == 29) {
	window.open('/samples/majorwork_winter2011.html','','menubar=yes,scrollbars=yes,resizable=yes,width=720,height=570');
	}
		if (num ==30) {
	window.open('samples/soq_design_set.php','','menubar=yes,scrollbars=yes,resizable=yes,width=680,height=490');
	}
}

function createIt() {
	var nom1 = "mai";
	var nom = "lto:contactme";
	var ser = "eyegravity.com";
	document.write('<a href="' + nom1 + nom + '@' + ser + '">Contact Me</a> by email');
}

var $ = jQuery.noConflict();

jQuery(function( $ ){

	var bigLeft, smallLeft;

	if($.client.browser=="Firefox") {
		bigLeft=560;
		smallLeft=90;
		
	} else {
		bigLeft=510;
		smallLeft=40;
	}
	//alert($.client.os);
	
	$(".sampleblock > a").each(function() {
		$(this).mouseenter(function() {
			
			if ($(this).parent().index()>5) { //if a block is on the right side, move message leftward
				leftOffSet = bigLeft;
				$("#eyegrav_detail_text").css("background-image","url(images/overlay_main_right.png)");
			} else {
				leftOffSet = smallLeft;
				$("#eyegrav_detail_text").css("background-image","url(images/overlay_main.png)");
			}
			//alert($(this).parent().parent().count());
			if ($(this).parent().parent().index()>=3) { //we're in the last row of samples
				if ($(this).parent().index()>5) {
					$("#eyegrav_detail_botrow_bot").css("background-image","url(images/overlay_bottom_bot_right.png)");
					} else {
					$("#eyegrav_detail_botrow_bot").css("background-image","url(images/overlay_bottom_bot.png)");
				}	
				$("#eyegrav_detail_botrow_text > p").html($(this).parent().find('p').html());
				topOffSet = -($("#eyegrav_detail_botrow").height()+10);
				$("#eyegrav_detail_botrow").css({'left' : $(this).offset().left-leftOffSet, 'top' : $(this).offset().top+topOffSet,'display':'block'});
			} else {
				topOffSet = 60;
				$("#eyegrav_detail_text > p").html($(this).parent().find('p').html());
				$("#eyegrav_detail").css({'left' : $(this).offset().left-leftOffSet, 'top' : $(this).offset().top+topOffSet,'display':'block'});
			}
			
			//alert($(this).parent().index());
		});

		$(this).mouseleave(function() {
			$("#eyegrav_detail, #eyegrav_detail_botrow").css({'left' : '-9000', 'top' : '-9000','display':'none'});
			$("#eyegrav_detail_text > p, #eyegrav_detail_botrow_text > p").html('');
		});
		
	});
	
	
	//better to do this with an array: class name followed by color, to make it easier to light all of them
	$("#leadtext a, #samples p:first a").each(function() {
		$(this).click(function(){ //the clicked value is something other than 'all'
			var colorToUse = "";
			var the_mult = 0;
			var theClassName = $(this).attr('className');
			
			if ($(this).attr('className')=="all") { //assign all the colors
				$(".sampleblock").each(function() {
					for (p=0;p<topicList.length;p++) {
						if ($(this).hasClass(topicList[p]+'-type')) {
							the_mult++;
							$(this).delay(the_mult*90).animate({backgroundColor: colorList[p]}, 250 );
						}
					}
				});
			} else {  //just one type, so look for a match
				for (z=0;z<topicList.length;z++) {
					if ($(this).attr('className') == topicList[z]) {
						colorToUse = colorList[z];
					}
				}
				$(".sampleblock").delay($(".sampleblock").length*10).each(function() {
					$(this).hasClass(theClassName+'-type') ? backColor =colorToUse : backColor ="#444444";
					the_mult++;
					$(this).delay(the_mult*90).animate({backgroundColor: backColor}, 250 );
				});
			}
		});
	});
			
});

var colorList = new Array("#326496","#92151E","#453FAA","#CAA839");
var topicList = new Array("web","webdev","both","other");


