// with this test document.cookie.indexOf( name + "=" ); function Get_Action_Cookie( check_name ) { // first we'll split this cookie up into name/value pairs // note: document.cookie only returns name=value, not the other components var a_all_cookies = document.cookie.split( ';' ); var a_temp_cookie = ''; var cookie_name = ''; var cookie_value = ''; var b_cookie_found = false; // set boolean t/f default f for ( i = 0; i < a_all_cookies.length; i++ ) { // now we'll split apart each name=value pair a_temp_cookie = a_all_cookies[i].split( '=' ); // and trim left/right whitespace while we're at it cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, ''); // if the extracted name matches passed check_name if ( cookie_name == check_name ) { b_cookie_found = true; // we need to handle case where cookie has no value but exists (no = sign, that is): if ( a_temp_cookie.length > 1 ) { cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') ); } // note that in cases where cookie is initialized but no value, null is returned return cookie_value; break; } a_temp_cookie = null; cookie_name = ''; } if ( !b_cookie_found ) { return null; } } $(document).ready(function(){ var newsHomeON = 1; function gotoFirst(){ if (Get_Action_Cookie('taal')=='engels'){ //document.getElementById('firsttabTitle').innerHTML = 'In the news >>'; document.getElementById('firsttabTitle').innerHTML = ''; document.getElementById('secondtabTitle').innerHTML = 'Gentlemen >>'; } else{ // document.getElementById('firsttabTitle').innerHTML = 'In het nieuws >> '; document.getElementById('firsttabTitle').innerHTML = ''; document.getElementById('secondtabTitle').innerHTML = 'Gentlemen >> '; }; document.getElementById('thirdtabTitle').innerHTML = ''; document.getElementById("homebtn").style.color = "#000000"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#ffffff"; document.getElementById("officebtn").style.color = "#ffffff"; document.getElementById("firsttab").style.width = "703px"; document.getElementById("tabtop1").style.width = "703px"; document.getElementById("firsttabTop").style.width = "680px"; document.getElementById("secondtab").style.width = "220px"; document.getElementById("secondtab").style.marginLeft = "727px"; document.getElementById("tabtop2").style.width = "220px"; document.getElementById("tabtop2").style.marginLeft = "727px"; document.getElementById("secondtabTop").style.width = "201px"; document.getElementById("thirdtab").style.width = "461px"; document.getElementById("thirdtab").style.marginLeft = "1000px"; document.getElementById("thirdtabTop").style.width = "442px"; document.getElementById("tabtop3").style.width = "461px"; document.getElementById("tabtop3").style.marginLeft = "1000px"; $("#firsttab").load('/admin/pages/home1.php'); $("#secondtab").load('/admin/pages/home2.php'); $("#thirdtab").load('/admin/pages/home3.php'); } $(".homebtn").click(function () {gotoHome();}); function gotoHome(){ if (Get_Action_Cookie('taal')=='engels'){ //document.getElementById('firsttabTitle').innerHTML = 'In the news >>'; document.getElementById('firsttabTitle').innerHTML = ''; document.getElementById('secondtabTitle').innerHTML = 'Gentlemen >>'; } else{ //document.getElementById('firsttabTitle').innerHTML = 'In het nieuws >> '; document.getElementById('firsttabTitle').innerHTML = ''; document.getElementById('secondtabTitle').innerHTML = 'Gentlemen >> '; }; document.getElementById('thirdtabTitle').innerHTML = ''; document.getElementById("homebtn").style.color = "#000000"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#ffffff"; document.getElementById("officebtn").style.color = "#ffffff"; $("#firsttab").animate({ width: "703px" }, 700 ); $("#tabtop1").animate({ width: "703px" }, 700 ); $("#firsttabTop").animate({ width: "680px" }, 700 ); $("#secondtab").animate({ width: "220px", marginLeft: "727px" }, 700 ); $("#secondtabTop").animate({ width: "201px" }, 700 ); $("#tabtop2").animate({ width: "220px", marginLeft: "727px" }, 700 ); $("#thirdtab").animate({ width: "461px", marginLeft: "1000px" }, 700 ); $("#thirdtabTop").animate({ width: "442px" }, 700 ); $("#tabtop3").animate({ width: "461px", marginLeft: "1000px" }, 700); $(".forFade1").fadeOut(700, function () {loadHome();}); } $("#newsbtn").click(function () {gotoNews();}); function gotoNews(){ $("#firsttab").animate({ width: "461px" }, 700 ); $("#tabtop1").animate({ width: "461px" }, 700 ); $("#firsttabTop").animate({ width: "442px" }, 700 ); $("#secondtab").animate({ width: "220px", marginLeft: "485px" }, 700 ); $("#tabtop2").animate({ width: "220px", marginLeft: "485px" }, 700 ); $("#secondtabTop").animate({ width: "201px" }, 700 ); $("#thirdtab").animate({ width: "220px", marginLeft: "729px" }, 700 ); $("#thirdtabTop").animate({ width: "201px" }, 700 ); $("#tabtop3").animate({ width: "220px", marginLeft: "729px" }, 700); if (Get_Action_Cookie('taal')=='engels'){ document.getElementById('firsttabTitle').innerHTML = 'Gentlemen news >'; document.getElementById('secondtabTitle').innerHTML = 'Gentlemen Related >'; document.getElementById('thirdtabTitle').innerHTML = 'Dossier'; } else{ document.getElementById('firsttabTitle').innerHTML = 'Gentlemen nieuws >'; document.getElementById('secondtabTitle').innerHTML = 'Gentlemen Related > '; document.getElementById('thirdtabTitle').innerHTML = 'Dossier'; }; document.getElementById("homebtn").style.color = "#ffffff"; document.getElementById("newsbtn").style.color = "#000000"; document.getElementById("projectsbtn").style.color = "#ffffff"; document.getElementById("officebtn").style.color = "#ffffff"; $(".forFade1").fadeOut(700, function () {loadNews();}); } $("#projectsbtn").click(function () {gotoProjects();}); function gotoProjects(){ document.getElementById('firsttabTitle').innerHTML = 'Projects >'; document.getElementById('secondtabTitle').innerHTML = 'All >'; document.getElementById("homebtn").style.color = "#ffffff"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#000000"; document.getElementById("officebtn").style.color = "#ffffff"; $("#firsttab").animate({ width: "219px" }, 700 ); $("#tabtop1").animate({ width: "219px" }, 700 ); $("#firsttabTop").animate({ width: "200px" }, 700 ); $("#secondtab").animate({ width: "704px", marginLeft: "244px" }, 700 ); $("#tabtop2").animate({ width: "704px", marginLeft: "244px" }, 700 ); $("#secondtabTop").animate({ width: "685px" }, 700 ); $("#thirdtab").animate({ width: "461px", marginLeft: "1000px" }, 700 ); $("#thirdtabTop").animate({ width: "442px" }, 700 ); $("#tabtop3").animate({ width: "461px", marginLeft: "1000px" }, 700); $(".forFade1").fadeOut(700, function () {loadProjects();}); } function gotoProject(section,id){ inputSection=section; inputID=id; document.getElementById('firsttabTitle').innerHTML = 'Projects >'; document.getElementById('secondtabTitle').innerHTML = ''; document.getElementById('thirdtabTitle').innerHTML = ''; document.getElementById("homebtn").style.color = "#ffffff"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#000000"; document.getElementById("officebtn").style.color = "#ffffff"; document.getElementById("firsttab").style.width = "219px"; document.getElementById("tabtop1").style.width = "219px"; document.getElementById("firsttabTop").style.width = "200px"; document.getElementById("secondtab").style.width = "704px"; document.getElementById("secondtab").style.marginLeft = "244px"; document.getElementById("tabtop2").style.width = "704px"; document.getElementById("tabtop2").style.marginLeft = "244px"; document.getElementById("secondtabTop").style.width = "685px"; document.getElementById("thirdtab").style.width = "461px"; document.getElementById("thirdtab").style.marginLeft = "1000px"; document.getElementById("thirdtabTop").style.width = "442px"; document.getElementById("tabtop3").style.width = "461px"; document.getElementById("tabtop3").style.marginLeft = "1000px"; $("#firsttab").load('/admin/pages/projects1.php'); $('#secondtab').load('/admin/projects/project.php?section='+inputSection+'&id='+inputID); $("#thirdtab").load('/admin/pages/projects3.php'); } function gotosubProject(input){ document.getElementById('firsttabTitle').innerHTML = 'Projects >'; document.getElementById('secondtabTitle').innerHTML = ''; document.getElementById('thirdtabTitle').innerHTML = ''; document.getElementById("homebtn").style.color = "#ffffff"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#000000"; document.getElementById("officebtn").style.color = "#ffffff"; document.getElementById("firsttab").style.width = "219px"; document.getElementById("tabtop1").style.width = "219px"; document.getElementById("firsttabTop").style.width = "200px"; document.getElementById("secondtab").style.width = "704px"; document.getElementById("secondtab").style.marginLeft = "244px"; document.getElementById("tabtop2").style.width = "704px"; document.getElementById("tabtop2").style.marginLeft = "244px"; document.getElementById("secondtabTop").style.width = "685px"; document.getElementById("thirdtab").style.width = "461px"; document.getElementById("thirdtab").style.marginLeft = "1000px"; document.getElementById("thirdtabTop").style.width = "442px"; document.getElementById("tabtop3").style.width = "461px"; document.getElementById("tabtop3").style.marginLeft = "1000px"; if (input=="all"){ document.getElementById('secondtabTitle').innerHTML = 'All >'; $(".forFade1").fadeOut(700, function () {loadProjects();}); } if (input=="arch"){ document.getElementById('secondtabTitle').innerHTML = 'Architecture >'; $(".forFade1").fadeOut(700, function () {loadArchs();}); } if (input=="real"){ document.getElementById('secondtabTitle').innerHTML = 'Real Estate >'; $(".forFade1").fadeOut(700, function () {loadReals();}); } if (input=="theory"){ document.getElementById('secondtabTitle').innerHTML = 'Theory >'; $(".forFade1").fadeOut(700, function () {loadTheory();}); } } $("#officebtn").click(function () {gotoOffice();}); function gotoOffice(){ if (Get_Action_Cookie('taal')=='engels'){ document.getElementById('secondtabTitle').innerHTML = 'About Gentlemen >'; } else{ document.getElementById('secondtabTitle').innerHTML = 'Over Gentlemen > '; }; document.getElementById('firsttabTitle').innerHTML = 'Office >'; document.getElementById('thirdtabTitle').innerHTML = ''; document.getElementById("homebtn").style.color = "#ffffff"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#ffffff"; document.getElementById("officebtn").style.color = "#000000"; $("#firsttab").animate({ width: "219px" }, 700 ); $("#tabtop1").animate({ width: "219px" }, 700 ); $("#firsttabTop").animate({ width: "200px" }, 700 ); $("#secondtab").animate({ width: "461px", marginLeft: "244px" }, 700 ); $("#tabtop2").animate({ width: "461px", marginLeft: "244px" }, 700 ); $("#secondtabTop").animate({ width: "442px" }, 700 ); $("#thirdtab").animate({ width: "220px", marginLeft: "730px" }, 700 ); $("#thirdtabTop").animate({ width: "201px" }, 700 ); $("#tabtop3").animate({ width: "220px", marginLeft: "730px" }, 700); $(".forFade1").fadeOut(700, function () {loadOffice();}); } (function(){ // Import GET Vars document.$_GET = []; var urlHalves = String(document.location).split('?'); if(urlHalves[1]){ var urlVars = urlHalves[1].split('&'); for(var i=0; i<=(urlVars.length); i++){ if(urlVars[i]){ var urlVarPair = urlVars[i].split('='); document.$_GET[urlVarPair[0]] = urlVarPair[1]; } } } })(); $('.projectPage').jScrollPane({animateTo:true,arrowSize:15}); checkHash(); function checkHash(){ var hash = window.location.hash; switch(hash) { case "#main": gotoFirst(); break; case "#home": gotoHome(); break; case "#news": gotoNews(); break; case "#pros": gotosubProject("all"); break; case "#prosarch": gotosubProject("arch"); break; case "#prosreal": gotosubProject("real"); break; case "#prostheory": gotosubProject("theory"); break; case "#proj": var sectionIn = document.$_GET['section']; var idIn = document.$_GET['id']; gotoProject(sectionIn, idIn); break; case "#offi": gotoOffice(); break; case "#contact": gotoContact("main"); break; case "#contactform": gotoContact("form"); break; case "#contactreply": gotoContact("response"); break; case "#medewerkers": gotoContact2("medewerkers"); break; case "#vacatures": gotoContact("vacatures"); break; case "#stages": gotoContact("stages"); break; case "#presskit": gotoContact2("presskit"); break; case "#pressall": gotoContact2("presskit"); break; case "#pressarch": gotoContact2("presskit"); break; case "#pressreal": gotoContact2("presskit"); break; case "#presstheory": gotoContact2("presskit"); break; default: } } function gotoContact(input){ switch(input) { case "main": $("#firsttab").load('/admin/pages/office1.php'); $("#secondtab").load('/admin/pages/contact2.php'); $("#thirdtab").load('/admin/pages/contact3.php'); if (Get_Action_Cookie('taal')=='engels'){ } else{ }; break; case "form": $("#firsttab").load('/admin/pages/office1.php', {limit: 25}); $("#secondtab").load('/admin/pages/contact2.php', {limit: 25}); $("#thirdtab").load('/admin/pages/contactform.php', {limit: 25}); if (Get_Action_Cookie('taal')=='engels'){ document.getElementById('thirdtabTitle').innerHTML = 'Street address, route >'; } else{ document.getElementById('thirdtabTitle').innerHTML = 'Bezoekadres, route > '; }; break; case "response": $("#firsttab").load('/admin/pages/office1.php', {limit: 25}); $("#secondtab").load('/admin/pages/contact2.php', {limit: 25}); $("#thirdtab").load('/admin/pages/contactreply.php', {limit: 25}); if (Get_Action_Cookie('taal')=='engels'){ document.getElementById('thirdtabTitle').innerHTML = 'Street address, route >'; } else{ document.getElementById('thirdtabTitle').innerHTML = 'Bezoekadres, route > '; }; break; case "vacatures": $("#firsttab").load('/admin/pages/office1.php', {limit: 25}); $("#secondtab").load('/admin/pages/contact2.php', {limit: 25}); $("#thirdtab").load('/admin/pages/vacatures.php', {limit: 25}); document.getElementById('thirdtabTitle').innerHTML = 'Vacatures >'; break; case "stages": $("#firsttab").load('/admin/pages/office1.php', {limit: 25}); $("#secondtab").load('/admin/pages/contact2.php', {limit: 25}); $("#thirdtab").load('/admin/pages/stages.php', {limit: 25}); document.getElementById('thirdtabTitle').innerHTML = 'Stages >'; break; default: } document.getElementById('firsttabTitle').innerHTML = 'Office >'; if (Get_Action_Cookie('taal')=='engels'){ document.getElementById('secondtabTitle').innerHTML = 'About Gentlemen >'; } else{ document.getElementById('secondtabTitle').innerHTML = 'Over Gentlemen > '; }; document.getElementById("homebtn").style.color = "#ffffff"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#ffffff"; document.getElementById("officebtn").style.color = "#000000"; document.getElementById("firsttab").style.width = "219px"; document.getElementById("tabtop1").style.width = "219px"; document.getElementById("firsttabTop").style.width = "200px"; document.getElementById("secondtab").style.width = "219px"; document.getElementById("secondtab").style.marginLeft = "244px"; document.getElementById("tabtop2").style.width = "219px"; document.getElementById("tabtop2").style.marginLeft = "244px"; document.getElementById("secondtabTop").style.width = "200px"; document.getElementById("thirdtab").style.width = "460px"; document.getElementById("thirdtab").style.marginLeft = "488px"; document.getElementById("thirdtabTop").style.width = "441px"; document.getElementById("tabtop3").style.width = "460px"; document.getElementById("tabtop3").style.marginLeft = "488px"; } function gotoContact2(input){ switch(input) { case "medewerkers": $("#firsttab").load('/admin/pages/office1.php', {limit: 25}); $("#secondtab").load('/admin/pages/medewerkers.php', {limit: 25}); $("#thirdtab").load('/admin/pages/contact3.php', {limit: 25}); document.getElementById('secondtabTitle').innerHTML = 'Medewerkers >'; break; case "presskit": $("#firsttab").load('/admin/pages/office1.php', {limit: 25}); $("#secondtab").load('/admin/pages/presskitPass.php', {limit: 25}); $("#thirdtab").load('/admin/pages/contactform.php', {limit: 25}); document.getElementById('secondtabTitle').innerHTML = 'Presskit >'; break; default: } document.getElementById('firsttabTitle').innerHTML = 'Office >'; document.getElementById('thirdtabTitle').innerHTML = ''; document.getElementById("homebtn").style.color = "#ffffff"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#ffffff"; document.getElementById("officebtn").style.color = "#000000"; document.getElementById("firsttab").style.width = "219px"; document.getElementById("tabtop1").style.width = "219px"; document.getElementById("firsttabTop").style.width = "200px"; document.getElementById("secondtab").style.width = "704px"; document.getElementById("secondtab").style.marginLeft = "244px"; document.getElementById("tabtop2").style.width = "704px"; document.getElementById("tabtop2").style.marginLeft = "244px"; document.getElementById("secondtabTop").style.width = "685px"; document.getElementById("thirdtab").style.width = "461px"; document.getElementById("thirdtab").style.marginLeft = "1000px"; document.getElementById("thirdtabTop").style.width = "442px"; document.getElementById("tabtop3").style.width = "461px"; document.getElementById("tabtop3").style.marginLeft = "1000px"; } function loadHome(){ $("#firsttab").load('/admin/pages/home1.php', {limit: 25}); $("#secondtab").load('/admin/pages/home2.php', {limit: 25}); $("#thirdtab").load('/admin/pages/home3.php', {limit: 25}); } function loadNews(){ $("#firsttab").load('/admin/news/main.php', {limit: 25}); $("#secondtab").load('/admin/news/news2.php', {limit: 25}); $("#thirdtab").load('/admin/news/news3.php', {limit: 25}); } function loadProjects(){ $("#firsttab").load('/admin/pages/projects1.php'); $("#secondtab").load('/admin/projects/allprojects.php'); $("#thirdtab").load('/admin/pages/projects3.php'); } function loadArchs(){ $("#firsttab").load('/admin/pages/projects1.php'); $("#secondtab").load('/admin/projects/architecture.php'); $("#thirdtab").load('/admin/pages/projects3.php'); } function loadReals(){ $("#firsttab").load('/admin/pages/projects1.php'); $("#secondtab").load('/admin/projects/real_estate.php'); $("#thirdtab").load('/admin/pages/projects3.php'); } function loadTheory(){ $("#firsttab").load('/admin/pages/projects1.php'); $("#secondtab").load('/admin/projects/theory.php'); $("#thirdtab").load('/admin/pages/projects3.php'); } function loadOffice (){ $("#firsttab").load('/admin/pages/office1.php'); $("#secondtab").load('/admin/pages/office2.php'); $("#thirdtab").load('/admin/pages/office3.php'); } function gotopressAll (){ document.getElementById("firsttab").style.width = "219px"; document.getElementById("tabtop1").style.width = "219px"; document.getElementById("firsttabTop").style.width = "200px"; document.getElementById("secondtab").style.width = "704px"; document.getElementById("secondtab").style.marginLeft = "244px"; document.getElementById("tabtop2").style.width = "704px"; document.getElementById("tabtop2").style.marginLeft = "244px"; document.getElementById("secondtabTop").style.width = "685px"; document.getElementById("thirdtab").style.width = "461px"; document.getElementById("thirdtab").style.marginLeft = "1000px"; document.getElementById("thirdtabTop").style.width = "442px"; document.getElementById("tabtop3").style.width = "461px"; document.getElementById("tabtop3").style.marginLeft = "1000px"; $(".forFade1").fadeOut(700, function () {loadPressall();}); document.getElementById('secondtabTitle').innerHTML = 'Presskit >'; document.getElementById('thirdtabTitle').innerHTML = ''; document.getElementById("homebtn").style.color = "#ffffff"; document.getElementById("newsbtn").style.color = "#ffffff"; document.getElementById("projectsbtn").style.color = "#ffffff"; document.getElementById("officebtn").style.color = "#000000"; } function loadPressall(){ $("#firsttab").load('/admin/presskit/presskitleft.php'); $("#secondtab").load('/admin/presskit/allpresskits.php'); $("#thirdtab").load('/admin/pages/projects3.php'); document.getElementById("pressall").style.fontWeight = "bold"; document.getElementById("pressarch").style.fontWeight = "normal"; document.getElementById("pressrealestate").style.fontWeight = "normal"; document.getElementById("presstheory").style.fontWeight = "normal"; } function gotopressArch (){ document.getElementById('secondtabTitle').innerHTML = '_Architecture '; document.getElementById('thirdtabTitle').innerHTML = ''; $("#secondtab").load('/admin/presskit/pkarchitecture.php'); document.getElementById("pressall").style.fontWeight = "normal"; document.getElementById("pressarch").style.fontWeight = "bold"; document.getElementById("pressrealestate").style.fontWeight = "normal"; document.getElementById("presstheory").style.fontWeight = "normal"; } function gotopressReal (){ document.getElementById('secondtabTitle').innerHTML = '_Real Estate'; document.getElementById('thirdtabTitle').innerHTML = ''; $("#secondtab").load('/admin/presskit/pkreal_estate.php'); document.getElementById("pressall").style.fontWeight = "normal"; document.getElementById("pressarch").style.fontWeight = "normal"; document.getElementById("pressrealestate").style.fontWeight = "bold"; document.getElementById("presstheory").style.fontWeight = "normal"; } function gotopressTheory (){ document.getElementById('secondtabTitle').innerHTML = '_Theory'; document.getElementById('thirdtabTitle').innerHTML = ''; $("#secondtab").load('/admin/presskit/pktheory.php'); document.getElementById("pressall").style.fontWeight = "normal"; document.getElementById("pressarch").style.fontWeight = "normal"; document.getElementById("pressrealestate").style.fontWeight = "normal"; document.getElementById("presstheory").style.fontWeight = "bold"; } $("#enTranslate").click(function () {translateEnglish();}); $("#nlTranslate").click(function () {translateDutch();}); function translateEnglish (){ document.cookie="taal=engels; path=/"; checkHash(); } function translateDutch (){ document.cookie="taal=nederlands; path=/"; checkHash(); } });