// JavaScript Document


var pic_width=320;
var pic_height=240;

var boolean = 0;
var numPics = 4;
var object = "proj0";
//var description;
var fuck = 0;


var imgName1 = 'pic1';
var imgName2 = 'pic2';
var imgName3 = 'pic3';
var imgName4 = 'pic4';



function popUp(strURL,strType,strHeight,strWidth) 
{
	var strOptions="";
	if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
	if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
	window.open(strURL, 'newWin', strOptions);
}

/*
var time = 3000;
var numofitems = 11;

var numofoptions = 30;
*/
//faqmenues
//menu constructor


function info(allitems,thisitem,startstate)
{
  callname= "faqop"+thisitem;
  divname="faq"+thisitem;
  this.numberofmenuitems = allitems;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
  this.thediv.style.visibility = startstate;
}


//menu methods
/*
function ehandler(event,theobj)
{
  for (var i=1; i<= theobj.numberofmenuitems; i++)
  {
    var shutdiv =eval( "faq"+i+".thediv");
    shutdiv.style.visibility="hidden";
  }
  theobj.thediv.style.visibility="visible";
}
*/
function closefaq(event)
{
  if ((event.clientY < 48)||(event.clientY > 107))
  {
    for (var i=1; i<= numofitems; i++)
	{
      var shutdiv =eval('faq'+i+'.thediv');
      shutdiv.style.visibility='hidden';
    }
  }
}
/*
//displayinfo

function info2(allitems,thisitem,startstate)
{
  callname= "subfaq"+thisitem;
  divname="opt"+thisitem;
  this.numberofmenuitems = allitems;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
  this.thediv.style.visibility = startstate;
}

function ehandler2(event,theobj)
{
  for (var i=1; i<= theobj.numberofmenuitems; i++)
  {
    var shutdiv =eval( "subfaq"+i+".thediv");
    shutdiv.style.visibility="hidden";
  }
  defaultFAQ.style.visibility="hidden";
  
  theobj.thediv.style.visibility="visible";
}
*/

pic1 = new Image(pic_width,pic_height);
pic2 = new Image(pic_width,pic_height);
pic3 = new Image(pic_width,pic_height);
pic4 = new Image(pic_width,pic_height);
	
function init()
{
	pic1.src = "../Projects/proj0/pic1.jpg";
	pic2.src = "../Projects/proj0/pic2.jpg";
	pic3.src = "../Projects/proj0/pic3.jpg";
	pic4.src = "../Projects/proj0/pic4.jpg";
	return Button_onclick(0);
	//boolean = 1;

}

/*
function ehandler(event, object, caller)
{
	var newval = caller;
	pic1.src = "../Projects/"+newval+"/pic1.jpg";
	pic2.src = "../Projects/"+newval+"/pic2.jpg";
	pic3.src = "../Projects/"+newval+"/pic3.jpg";
	pic4.src = "../Projects/"+newval+"/pic4.jpg";
}
*/


function display_stuff()
{
	if (boolean == 0)
	{
		init();
	}


	if(document.images)
	{
		document.write("<div id='projpic1'><img src='"+pic1.src+"' width='320' height='240' alt='' class='projpics' name='pic1' /></div>");
		document.write("<div id='projpic2'><img src='"+pic2.src+"' width='320' height='240' alt='' class='projpics' name='pic2' /></div>");
		document.write("<div id='projpic3'><img src='"+pic3.src+"' width='320' height='240' alt='' class='projpics' name='pic3' /></div>");
		document.write("<div id='projpic4'><img src='"+pic4.src+"' width='320' height='240' alt='' class='projpics' name='pic4' /></div>");
	}

}

function refresh_display(val)
{
	document[imgName1].src="../Projects/proj"+val+"/pic1.jpg";
	document[imgName2].src="../Projects/proj"+val+"/pic2.jpg";
	document[imgName3].src="../Projects/proj"+val+"/pic3.jpg";
	document[imgName4].src="../Projects/proj"+val+"/pic4.jpg";
	document.getElementById("projectName").style.visibility="visible";
	return Button_onclick(val);

}


function ShowWebSite(val,val2)
{
      document.getElementById("projectDescription").src=val;
	  document.getElementById("projectName").src=val2;
      //document.all.projectDescription.style.visibility="visible";
}

function Button_onclick(value)
{
	//var v = document.all("txtWebSite").value;
	var v ="../Projects/proj"+value+"/description.htm";
	var v2 ="../Projects/proj"+value+"/name.htm";
	ShowWebSite(v,v2);
}


function preload_content(val)
{
		
	
	
}


function get_effect()
{
	
	
	
}




//###########################################
//desc: picks the transition to apply to the images
function GetTrans() {
	//si=document.slideshow.trans.selectedIndex;

		if((document.slideshow.trans && document.slideshow.trans.selectedIndex == 0) || (!document.slideshow.trans && dotrans==0)){
		dotrans=0;
	}
	else if ((document.slideshow.trans && document.slideshow.trans.selectedIndex == 1) || (!document.slideshow.trans && transtype == 'blendTrans')){
		dotrans=1;
		transtype='blendTrans';
		document.imgslide.style.filter = "blendTrans(duration=1,transition=1)";
	}else{
		dotrans=1;
		transtype='revealtrans';
		if(document.slideshow.trans) transattributes=document.slideshow.trans[document.slideshow.trans.selectedIndex].value;
		document.imgslide.style.filter = "revealTrans(duration=1,transition=" +transattributes+ ")";
	}

}


