function Display_Subnav(obj) {
	switch( obj ) {
		case 1:
			document.getElementById( 'Intro_SN' ).style.visibility = 'visible';
			break;
			
		case 2:
			document.getElementById( 'RD_SN' ).style.visibility = 'visible';
			break;
	}
}

function Hide_Subnav(obj) {
	switch( obj ) {
		case 1:
			document.getElementById( 'Intro_SN' ).style.visibility = 'hidden';
			break;
			
		case 2:
			document.getElementById( 'RD_SN' ).style.visibility = 'hidden';
			break;
	}
}

function Update_Content(id) {
	var DISPLAY;
	var OUTPUT;
	var HTML;

	switch( id ) {
		case 1:
			/* Homepage */
			DISPLAY 	 = 	'none';
			OUTPUT 		 = 	'Welcome to the Website.  Please use the navigation at the top and bottom of the page to navigate through the site.';
			HEADER 		 = 	'Hi there, how are you?';

			HTML 	 	 = 	'<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">';
			HTML		+=	'<tr><td style=\"background-color: #676b98; height: 34px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #f8b911; height: 9px;\"></td></tr>';			
			HTML		+=	'<tr><td style=\"background-color: #ffffff; height: 9px;\" class=\"Right_Col\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #d5e800; height: 9px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #fe6c09; height: 9px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #d5e800; height: 17px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #ffcc00; height: 9px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #2d2c48; height: 96px;\"></td></tr>';
			HTML		+=	'<tr><td><img src=\"images/introduction/time_l.jpg\" border=\"0\" /></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #595866; height: 2px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #2d2c48; height: 11px;\"></td></tr>';
			HTML		+=	'<tr><td><img src=\"images/introduction/design_l.jpg\" border=\"0\" /></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #2d2c48; height: 33px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #ffcc00; height: 9px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #a5359b; height: 34px;\"></td></tr>';
			HTML		+=	'<tr><td><img id=\"General_Right_1\" src=\"images/introduction/right_1.jpg\" border="0" /></td></tr>';
			HTML		+=	'<tr><td><img id=\"General_Right_2\" src=\"images/introduction/right_2.jpg\" border="0" /></td></tr>';
			HTML 		+=	'</table>';
			
			break;
			
		case 2:
			/* Introduction to Design */
			DISPLAY 	 = 	'block';
			OUTPUT 		 = 	'Almost everything we see, touch, use and experience in our daily lives is affected by man-made design.<br /><br />Interior design is the practice of taking ideas about space, shape, light, colour and texture, combined with functional, ergonomic and economic needs within a built environment. These ideas are then translated into a graphic form of communication - for the client and contractor, but as importantly, as a means of clarifying ideas for the designer.<br /><br />In recent years, the role of the interior designer has expanded to meet the needs and desires of an increasingly complex society, creating a variety of environments that are both beautiful and functional - homes, galleries, offices, retail environments, entertainment venues, hotels, etc., - in fact, any environment in which people live, work and play.<br /><br />With the emphasis on design rather than detail, the interior designer is equipped to execute small scale alterations and additions. Students acquire a knowledge of building services, the design and construction of fittings and fixtures, furniture design and manufacture, and the final design of the new interior.<br /><br />The means of communicating all of these fields of information would typically be via drawings - from simple pen-on-paper concept sketches to detailed technical drawings, and from beautifully rendered perspective drawings to precise, annotated contract drawings, but as importantly, as a means of clarifying the ideas of the designer.<br /><br />';
			HEADER		 =	'Introduction to Design';
			
			HTML 	 	 = 	'<table border="0" cellpadding="0" cellspacing="0">';
			HTML		+=	'<tr><td style=\"background-color: #676b98; height: 34px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #f8b911; height: 9px;\"></td></tr>';			
			HTML		+=	'<tr><td style=\"background-color: #ffffff; height: 9px;\" class=\"Right_Col\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #d5e800; height: 9px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #fe6c09; height: 9px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #d5e800; height: 17px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #ffcc00; height: 9px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #2d2c48; height: 96px;\"></td></tr>';
			HTML		+=	'<tr><td><img src=\"images/introduction/time_l.jpg\" border=\"0\" /></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #595866; height: 2px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #2d2c48; height: 11px;\"></td></tr>';
			HTML		+=	'<tr><td><img src=\"images/introduction/design_l.jpg\" border=\"0\" /></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #2d2c48; height: 33px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #ffcc00; height: 9px;\"></td></tr>';
			HTML		+=	'<tr><td style=\"background-color: #a5359b; height: 34px;\"></td></tr>';
			HTML		+=	'<tr><td><img id=\"General_Right_1\" src=\"images/introduction/right_1.jpg\" border=\"0\" /></td></tr>';
			HTML		+=	'<tr><td><img id=\"General_Right_2\" src=\"images/introduction/right_2.jpg\" border=\"0\" /></td></tr>';
			HTML		+= 	'<tr id=\"General_TR_Right_3\"><td><img id=\"General_Right_3\" src=\"images/introduction/right_3.jpg\" border="0" /></td></tr>';
			HTML		+=	'<tr id=\"General_TR_Right_4\"><td><img id=\"General_Right_4\" src=\"images/introduction/right_4.jpg\" border=\"0\" /></td></tr>';
			HTML		+= 	'<tr><td style=\"background-color: #676b98; height: 13px;\"></td></tr>';			
			HTML 		+=	'</table>';
			
			break; 
	}
	
	document.getElementById( 'General_Content' ).innerHTML 			 = 	OUTPUT;
	document.getElementById( 'General_Header' ).innerHTML 			 = 	HEADER;
	document.getElementById( 'General_Image_1' ).style.display 		 = 	DISPLAY;
	document.getElementById( 'General_Image_2' ).style.display 		 = 	DISPLAY;
	document.getElementById( 'TD_C' ).innerHTML = HTML;
}

function changeOpac(opacity, id) { 
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")";	 
}

function opacity(id, opacStart, opacEnd, millisec) { 
        changeInProgress = true;
        //speed for each frame 
        var speed = Math.round(millisec / 100); 
        var timer = 0; 

        //determine the direction for the blending, if start and end are the same nothing happens 
        if(opacStart >= opacEnd) { 
                for(var i = opacStart; i >= opacEnd; i--) { 
                setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
                timer++; 
                } 
        } else if(opacStart < opacEnd) { 
                for(var i = opacStart; i <= opacEnd; i++) { 
                        setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
                        timer++; 
                } 
        }
        
        setTimeout("changeInProgress = false;",(timer * speed));
} 

function opacity_back(id, opacStart, opacEnd, millisec) { 
        changeInProgress = true;
        //speed for each frame 
        var speed = Math.round(millisec / 100); 
        var timer = 0; 

        //determine the direction for the blending, if start and end are the same nothing happens 
        if(opacStart >= opacEnd) { 
                for(var i = opacStart; i >= opacEnd; i--) { 
                setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
                timer++; 
                } 
        } else if(opacStart < opacEnd) { 
                for(var i = opacStart; i <= opacEnd; i++) { 
                        setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
                        timer++; 
                } 
        }
        
        setTimeout("changeInProgress = false;",(timer * speed));
		is_changeble = 1;
} 

var is_changeble = 1;
function Change_Image( image ) {
	if( is_changeble == 1 ) {
		is_changeble = 0;
		setTimeout("opacity( 'main_image', 100, 0, 1000)", 500);
		setTimeout("Change('" +image+ "')", 2000);
	}
	
}

function Change( image ) {
	document.getElementById ('main_image').src = image;
	setTimeout("opacity_back('main_image', 0, 100, 1000)", 1000);
}

function Show_Image_Title( ) {
	image_src = document.getElementById( 'main_image' ).src;
	//document.getElementById( 'ImageTitleDiv' ).innerHTML = image_src;
	image_src = image_src.substring(image_src.lastIndexOf('/')+1);
	var DisplayTitle = "";
	switch( image_src ) {
		case "01-Yolande.jpg":
		DisplayTitle = "YOLANDE MITTON<br />Interior Designer<br />Principal";
		break;
		
		case "02-Katherine.jpg":
			DisplayTitle = "KATHERINE MANN<br />Architect<br />Second Year Course Director";
			break;
			
		case "03-Anel.jpg":
			DisplayTitle = "ANEL BOTHA<br />Interior Designer<br />First Year Course Director";
			break;
			
		case "04-Michelle.JPG":
			DisplayTitle = "MICHELLE BUNCE<br />Interior Designer<br />Studio & I.T. Assistant";
			break;
		
		case "05-Greg.JPG":
			DisplayTitle = "GREGORY MANN<br />Architect<br />Course: Building Constuction";
			break;
			
		case "06-Inge.jpg":
			DisplayTitle = "INGE PRINCE<br />Photographer<br />Course: Photography";
			break;
			
			
		case "07-Cynthia.jpg":
			DisplayTitle = "CYNTHIE<br />House Keeping";
			break;
		
		case "08-Margie.jpg":
			DisplayTitle = "MARGIE<br />House Keeping";
			break;
			
			
		case "09-Christene.jpg":
			DisplayTitle = "CHRISTENE STRUTT<br />Attorney<br />Course: Patent Law";
			break;
			
		case "10-Sean.jpg":
			DisplayTitle = "SEAN RAPAPORT<br />Attorney<br />Course: Contractual Law";
			break;
		
		case "01-DesignTime-Front.jpg":
			DisplayTitle = "Design-Time Front";
			break;
		
		case "02-DesignTime-Entrance.jpg":
			DisplayTitle = "Design-Time Entrance";
			break;
		
		case "03-DesignTime-Courtyard.JPG":
		case "04-DesignTime-Courtyard.jpg":
		case "05-DesignTime-Courtyard.jpg":
		case "06-DesignTime-Courtyard.jpg":
			DisplayTitle = "Design-Time Courtyard";
			break;
		
		case "07-DesignTime-Courtyard.jpg":
			DisplayTitle = "Design-Time Students";
			break;
		
		case "01-welcomes-YOU!.JPG":
			DisplayTitle = "Design-Time Welcomes YOU!";
			break;
		
		case "02-the-journey-begins.JPG":
			DisplayTitle = "The Journey begins";
			break;
		
		case "03-DesignTime-Exhibitions.jpg":
			DisplayTitle = "Design-Time Exhibitions";
			break;
		
		case "04-Design-Time.JPG":
			DisplayTitle = "Design-Time";
			break;
			
		case "05-DesignTime-Tools.jpg":
			DisplayTitle = "Design-Time Tools";
			break;
		
		case "06-DesignTime.jpg":
			DisplayTitle = "Design-Time";
			break;
		
		case "08-Design-Time-Notice-Board.jpg":
			DisplayTitle = "Design-Time Notice Board";
			break;
			

			
		case "01-Story-board.jpg":
			DisplayTitle = "Design-Time Story Board";
			break;
			
		case "08-Elle-Solve-Weylandts.jpg":
			DisplayTitle = "Elle Solve Weylandts Competition";
			break;
			
			
		case "10-Youth-hostel.jpg":
			DisplayTitle = "Youth Hostel";
			break;
			
		case "03-Decorex.jpg":
			DisplayTitle = "Decorex";
			break;
			
		case "11-Fuel-coutyard.jpg":
			DisplayTitle = "Fuel Courtyard";
			break;
			
		case "12-Fuel-bar.jpg":
			DisplayTitle = "Fuel Bar";
			break;
			
		case "13-Fuel-restaurant.jpg":
			DisplayTitle = "Fuel Restaurant";
			break;
			
		case "09-House-Leisure-Woolworths.jpg":
			DisplayTitle = "House and Leisure Woolworths Competition";
			break;
			
		case "07-P.G.-BISON.jpg":
			DisplayTitle = "P.G. BISON";
			break;
			
		case "14-House-smith.jpg":
			DisplayTitle = "House Smith";
			break;
			
		case "19-Box-of-Miracles.jpg":
			DisplayTitle = "Box of Miracles";
			break;
			
		case "02-Mood-Board.jpg":
			DisplayTitle = "Mood Board";
			break;

			
		case "15-Lafarge-competition.jpg":
		case "16-Lafarge-Competition.jpg":
		case "17-Lafarge-Competition.jpg":
			DisplayTitle = "Lafarge Competition";
			break;
			
		case "18-Bar.jpg":
			DisplayTitle = "Bar";
			break;
			
		case "33-Decorex-installation.JPG":
			DisplayTitle = "Decorex installation";
			break;
			
		case "13-Europcar.jpg":
			DisplayTitle = "Europcar recycled furniture competion<br />Mentor Heath Nash";
			break;
	}
	
	if( document.getElementById( 'ImageTitleDiv' ).style.visibility == 'hidden' && DisplayTitle.length > 0 ) {
		document.getElementById( 'ImageTitleDiv' ).innerHTML = DisplayTitle;
		document.getElementById( 'ImageTitleDiv' ).style.visibility = 'visible';
	} else {
		document.getElementById( 'ImageTitleDiv' ).style.visibility = 'hidden';
	}
}

function Get_Gallery( gallery ) {
	url = "Gallery_Sections.php?Gallery=" + gallery;
		ajx = new Ajax.Request( url,
    		{		
				onSuccess: function(success) { 
					ReturnVal = success.responseText;
					document.getElementById('scrollingObj').style.width = ReturnVal.substring(0, ReturnVal.indexOf(",")) + "px";
					document.getElementById('scrollingObj').innerHTML = ReturnVal.substring(ReturnVal.indexOf(",")+1);
					document.getElementById('scrollingObj').style.left = '0px';
				},
				
	            onFailure: function(failure) {
					alert( failure.responseText );
				}
    	    }
		);
}

function MouseEffect( img, src ) {
	document.getElementById( img ).src = "images/" +src;
}

function OpenWindow(p) {
	// 1=Terms&Conditions, 2=PrivacyPolicy
	switch( p ) {
		case 1:
			window.open( 'terms.htm', '', 'width=400px, height=279px' );
			break;
			
		case 2:
			window.open( 'privacy.htm', '', 'width=400px, scrollbars=yes' );	
			break;
	}
}

