//-----------------------------------------------------------------------------
// Function to preload images for preview pane
//-----------------------------------------------------------------------------
function MM_preloadImages() { //v3.0
 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];
		}
  }
}
//-----------------------------------------------------------------------------
// Browsercheck (needed)
//-----------------------------------------------------------------------------
function lib_bwcheck(){ 
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck();

//-----------------------------------------------------------------------------
// Function to load images for preview pane as the background image
// for the preview DIV
//-----------------------------------------------------------------------------
var state;
var number;
function loadimage(state){
	if(state==1){
		//preview.style.backgroundImage='url(../images/preview.gif)';
		cv_zip.style.color='#FFFFCC';
		cv_pdf.style.color='#FFFFCC';
		cv_doc.style.color='#FFFFCC';
		paarlskool_map.style.color='#FFFFCC';
		brightideas_map.style.color='#FFFFCC';
		martech_map.style.color='#FFFFCC';
		albatross_map.style.color='#FFFFCC';
		apd_map.style.color='#FFFFCC';
		paarlskool_site.style.color='#FFFFCC';
		brightideas_site.style.color='#FFFFCC';
		martech_site.style.color='#FFFFCC';
		albatross_site.style.color='#FFFFCC';
		apd_site.style.color='#FFFFCC';
		paarlskool_pledge.style.color='#FFFFCC';
		yachttech_site.style.color='#FFFFCC';
		yachttech_map.style.color='#FFFFCC';
		taalmuseum_site.style.color='#FFFFCC';
		taalmuseum_map.style.color='#FFFFCC';		
	}
	else if(state==2){
		preview.style.backgroundImage='url(../images/cv_pdf.gif)';
		cv_pdf.style.color='dc143c';
		cv_pdf.style.cursor='hand';
	}
	else if(state==3){
		preview.style.backgroundImage='url(../images/paarlskool_site.gif)';
		paarlskool_site.style.color='dc143c';
		paarlskool_site.style.cursor='hand';
	}
	else if(state==4){
		preview.style.backgroundImage='url(../images/paarlskool_map.gif)';
		paarlskool_map.style.color='dc143c';
		paarlskool_map.style.cursor='hand';
	}
	else if(state==41){
		preview.style.backgroundImage='url(../images/paarlskool_pledge.gif)';
		paarlskool_pledge.style.color='dc143c';
		paarlskool_pledge.style.cursor='hand';
	}
	else if(state==5){
		preview.style.backgroundImage='url(../images/brightideas_site.gif)';
		brightideas_site.style.color='dc143c';
		brightideas_site.style.cursor='hand';
	}
	else if(state==6){
		preview.style.backgroundImage='url(../images/brightideas_map.gif)';
		brightideas_map.style.color='dc143c';
		brightideas_map.style.cursor='hand';
	}
	else if(state==7){
		preview.style.backgroundImage='url(../images/martech_site.gif)';
		martech_site.style.color='dc143c';
		martech_site.style.cursor='hand';
	}
	else if(state==8){
		preview.style.backgroundImage='url(../images/martech_map.gif)';
		martech_map.style.color='dc143c';
		martech_map.style.cursor='hand';
	}
	else if(state==9){
		preview.style.backgroundImage='url(../images/albatross_site.gif)';
		albatross_site.style.color='dc143c';
		albatross_site.style.cursor='hand';
	}
	else if(state==10){
		preview.style.backgroundImage='url(../images/albatross_map.gif)';
		albatross_map.style.color='dc143c';
		albatross_map.style.cursor='hand';
	}
	else if(state==11){
		preview.style.backgroundImage='url(../images/apd_site.gif)';
		apd_site.style.color='dc143c';
		apd_site.style.cursor='hand';
	}
	else if(state==12){
		preview.style.backgroundImage='url(../images/apd_map.gif)';
		apd_map.style.color='dc143c';
		apd_map.style.cursor='hand';
	}
	else if(state==13){
		preview.style.backgroundImage='url(../images/cv_doc.gif)';
		cv_doc.style.color='dc143c';
		cv_doc.style.cursor='hand';
	}
	else if(state==14){
		preview.style.backgroundImage='url(../images/cv_zip.gif)';
		cv_zip.style.color='dc143c';
		cv_zip.style.cursor='hand';
	}
	else if(state==15){
		preview.style.backgroundImage='url(../images/yachttech_site.gif)';
		yachttech_site.style.color='dc143c';
		yachttech_site.style.cursor='hand';
	}
	else if(state==16){
		preview.style.backgroundImage='url(../images/yachttech_map.gif)';
		yachttech_map.style.color='dc143c';
		yachttech_map.style.cursor='hand';
	}
	else if(state==17){
		preview.style.backgroundImage='url(../images/taalmuseum_site.gif)';
		yachttech_site.style.color='dc143c';
		yachttech_site.style.cursor='hand';
	}
	else if(state==18){
		preview.style.backgroundImage='url(../images/taalmuseum_map.gif)';
		yachttech_map.style.color='dc143c';
		yachttech_map.style.cursor='hand';
	}}
//-----------------------------------------------------------------------------
//Function only used once to open CV in PDF from onclick event on photograph
//-----------------------------------------------------------------------------
function openpdf()
{
	window.open('cv/corne_cv.pdf', null, 'fullscreen=yes, channelmode=yes');
}
//-----------------------------------------------------------------------------
//Function to display hand next to links and to underline text of hyperlinks
//-----------------------------------------------------------------------------
function choose(objID, objID2, event)//objID is link's ID & event is 1 for onmouseover and 0 for onmouseout.
{
	if(event==1)
	{
		objID.style.textDecorationUnderline=true;
		objID2.style.display="inline";
	}
	else
	{
		objID.style.textDecorationUnderline=false;
		objID2.style.display="none";
	}						
}
/*************************************************************************
Popup text for portfolio & bio pages
*************************************************************************/
popupText = new Array()

//------- Bio --------//
str1 = "BORDER-RIGHT: medium none;PADDING-RIGHT: 0px;BORDER-TOP: medium none;PADDING-LEFT: 0px;FONT-WEIGHT: bold;FONT-SIZE: 9px;PADDING-BOTTOM: 0px;MARGIN: 0px;BORDER-LEFT: medium none;WIDTH: 100%;COLOR: #ffffcc;PADDING-TOP: 0px;BORDER-BOTTOM: medium none;FONT-FAMILY: Verdana;HEIGHT: 100%";
// Paarl Skool
popupText[0]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE<BR>EXTRAS</TD><TD align=left STYLE=\"padding-left:5px\">www.paarlskool.org.za<BR>paarl-school for neurally disabled children<BR>interdev/photoshop/fireworks<BR>design/development/maintenance<br>flash intro & online photo album of events</TD></TR></TABLE>"
popupText[1]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">www.paarlskool.org.za<BR>paarl-school for neurally disabled children<BR>ms visio 2000/acrobat<BR>conceptualising/design</TD></TR></TABLE>"
popupText[16]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right valign=top style=\"padding-top: 5px\" width=60px>PROJECT<BR>CLIENT<BR>TECH USED<BR>MY ROLE<BR>EXTRAS</TD><TD align=left STYLE=\"padding-left:5px\">pledge application<BR>paarl-school for neurally disabled children<BR>fireworks/flash<BR>theme/design/development<br>schoolbus moves proportionally on map with every amount pledged closer to the school</TD></TR></TABLE>"
// Bright Ideas
popupText[2]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">corne.keystroke.info<BR>bright ideas<BR>interdev/photoshop/fireworks/dreamweaver<BR>design/development</TD></TR></TABLE>"
popupText[3]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">corne.keystroke.info<BR>bright ideas<BR>ms visio 2000/acrobat<BR>conceptualising/design</TD></TR></TABLE>"
// Marine Technology
popupText[4]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE<BR>EXTRAS</TD><TD align=left STYLE=\"padding-left:5px\">www.martech.co.za<BR>marine technology<BR>interdev/photoshop/fireworks/acrobat/dreamweaver<BR>design/development/maintenance<br>white paper downloads</TD></TR></TABLE>"
popupText[5]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">www.martech.co.za<BR>marine technology<BR>ms visio 2000/acrobat<BR>conceptualising/design</TD></TR></TABLE>"
// Albatross Guesthouse
popupText[6]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE<BR>EXTRAS</TD><TD align=left STYLE=\"padding-left:5px\">www.housealbatross.co.za<BR>albatross guesthouse<BR>interdev/photoshop/fireworks/word/dreamweaver<BR>design/development/maintenance<br>currency converter & online photo album of rooms</TD></TR></TABLE>"
popupText[7]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">www.housealbatross.co.za<BR>albatross guesthouse<BR>ms visio 2000/acrobat<BR>conceptualising/design</TD></TR></TABLE>"
// APD Western Cape
popupText[8]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right valign=top style=\"padding-top: 10px\" width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE<BR>EXTRAS</TD><TD align=left STYLE=\"padding-left:5px\">www.apd-wc.org.za<BR>w/cape association for persons with physical disabilities<BR>interdev/photoshop/fireworks/acrobat/dreamweaver<BR>co-design/development<br>admin module to update frequently changing pages,<br>online discussion forum, document downloads,<br>workshop catalogues and orders per branch</TD></TR></TABLE>"
popupText[9]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">www.apd-wc.org.za<BR>w/cape association for persons with physical disabilities<BR>ms visio 2000/acrobat<BR>conceptualising/co-design</TD></TR></TABLE>"
// Yacht Technology
popupText[14]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right valign=top style=\"padding-top: 10px\" width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE<BR>EXTRAS</TD><TD align=left STYLE=\"padding-left:5px\">www.yachttech.co.za<BR>yacht technology<BR>interdev/photoshop/fireworks/acrobat<BR>design/development/maintenance<br>CDONTS email<br>site loads fast because of frames<br>hosting & domain arranged & set up online</TD></TR></TABLE>"
popupText[15]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">www.yachttech.co.za<BR>yacht technology<BR>ms visio 2000/acrobat<BR>conceptualising/co-design</TD></TR></TABLE>"
// Taalmuseum
popupText[17]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right valign=top style=\"padding-top: 10px\" width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE<BR>EXTRAS</TD><TD align=left STYLE=\"padding-left:5px; padding-top: 10px\" valign=top>www.taalmuseum.co.za<BR>afrikaans language museum<BR>interdev/photoshop/fireworks/acrobat/quicktime vr<BR>design/development/maintenance/support<br>relative positioned images<br>bilingual site, language specific content loaded dynamically<br>virtual reality panoramas of rooms<br>CDONTS email & admin module<br>dynamic mouse pointers</TD></TR></TABLE>"
popupText[18]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">www.taalmuseum.co.za<BR>afrikaans language museum<BR>ms visio 2000/acrobat<BR>conceptualising/design</TD></TR></TABLE>"
popupText[19]="<TABLE CELLSPACING=0 STYLE=\"" + str1 + "\"><TR><TD align=right width=60px>SITE<BR>CLIENT<BR>TECH USED<BR>MY ROLE</TD><TD align=left STYLE=\"padding-left:5px\">www.taalmuseum.co.za<BR>afrikaans language museum<BR>ms visio 2000/acrobat<BR>conceptualising/design</TD></TR></TABLE>"
//Start at 20

//------- Education --------//
str2 = "PADDING-RIGHT: 0px;PADDING-LEFT: 5px;FONT-WEIGHT: bold;FONT-SIZE: 9px;PADDING-BOTTOM: 5px;WIDTH: 100%;COLOR: #ffffcc;PADDING-TOP: 5px;FONT-FAMILY: Verdana;HEIGHT: 100%";
// Fairland
popupText[10]="<DIV STYLE=\"" + str2 + "\">139 Mark Street, Fairland<BR>P.O. Box 77252, Fontainebleau, 2032<BR>Tel: +27(11)678-4591<BR>Fax: +27(11)678-9012</DIV>"
// Randburg
popupText[11]="<DIV STYLE=\"" + str2 + "\">Hans Strijdomweg, Fontainebleau<BR>P.O. Box 77252, Fontainebleau, 2032<BR>Tel: +27(11)782-6226/7/8<BR>Fax: +27(11)888-3697</DIV>"
// TWR
popupText[12]="<DIV STYLE=\"" + str2 + "\">37 Nind street, Doornfontein<BR>P.O. Box 17011, Doornfontein<BR>Tel: +27(11)402-0475<BR>Fax: +27(11)402-0475</DIV>"
// CTI
popupText[13]="<DIV STYLE=\"" + str2 + "\">Head Office<BR>Tutor Place<BR>Turnberry Office Park<BR>48 Grosvenor Road, Bryanston<BR>P.O. Box 1398, Randburg, 2125<BR>Tel: +27(11)463-1898<BR>Fax: +27(11)463-1899</DIV>"


var oPopup = window.createPopup();
var oPopBody = oPopup.document.body;
function ShowPopup(x_coor, y_coor, iwidth, iheight, trigger, num)
{
	oPopBody.style.backgroundColor = "#000084";
	oPopBody.style.border = "solid black 1px";
	oPopBody.style.fontFamily = "Verdana";
	oPopBody.style.marginLeft = "3px";
	oPopBody.style.marginTop = "0px";
	oPopBody.style.marginRight = "3px";
	oPopBody.style.marginBottom = "3px";
	oPopBody.style.overflow = "auto";
	oPopBody.style.fontSize = "10px";
	oPopBody.style.cursor = "auto";
	oPopBody.innerHTML = popupText[num];
    oPopup.show(x_coor, y_coor, iwidth, iheight, trigger);
}
//-----------------------------------------------------------------------------
//Function to swap up and down images onmouseevents
//-----------------------------------------------------------------------------
function change_src(trigger, action)
{
//trigger is either the up(1) or down(0) image
//action is either onmouseover(1) or onmouseout(0)
	if ((trigger==1) && (action==1))
	//if up and onmouseover
		up.src="../images/scroll_up_over.gif";
	else if ((trigger==1) && (action==0))
	//if up and onmouseout
		up.src="../images/scroll_up.gif";
	else if ((trigger==0) && (action==1))
	//if down & onmouseover
		down.src="../images/scroll_down_over.gif";
	else down.src="../images/scroll_down.gif";
}
