var w = 1;
var h = 1;
var r;

//DEZE FUNCTIE GEBRUIKT DE INDEXPAGINA OM EVENTUEEL DOOR TE VERWIJZEN NAAR DE MOBIEL-PAGINA
function checkSize() {
	w = Math.round(document.body.clientWidth);
	h = Math.round(document.body.clientHeight);
	if(w<500||h<500){window.location = "http://www.meresankh.nl/mobiel/";}
	else{window.location = "http://www.meresankh.nl/home.html";}
}


//DIT ZIJN DE LOCATIES VAN HET MENU
function loc(i){
	if(i==1){window.location.href="home.html";}
	if(i==2){window.location.href="wie_ben_ik.html";}
	if(i==3){window.location.href="meresankh.html";}
	if(i==4){window.location.href="wat_is_astrologie.html";}
	if(i==5){window.location.href="astrologisch_consult.html";}
	if(i==6){window.location.href="vriendinnenavond.html";}
	if(i==7){window.location.href="horoscoop_baby.html";}
	if(i==8){window.location.href="esoterische_astrologie.html";}
	if(i==9){window.location.href="maya_astrologie.html";}
	if(i==10){window.location.href="cursus_maya_astrologie.html";}
	if(i==11){window.location.href="astro_party.html";}
	if(i==12){window.location.href="tarieven.html";}
	if(i==13){window.location.href="benodigd.html";}
	if(i==14){window.location.href="actueel.php";}
	if(i==15){window.location.href="contact.html";}
	if(i==16){window.location.href="links.html";}
}

//DEZE FUNCTIE GEEFT VORM AAN DE PAGINA
function sizebody(){

	w = Math.round(document.body.clientWidth);
	h = Math.round(document.body.clientHeight);
	//if(w<600||h<588){window.location = "http://www.meresankh.nl/mobiel/";}

//DIT DEEL ZORGT ERVOOR DAT DE STYLESHEET VERANDERT NAAR Kstyle.css WELKE HET MENU EN LETTERTYPEN KLEINER MAAKT
	if(w<990||h<750){
		if(document.styleSheets){
			for (var StyleSheetIterator = 0; StyleSheetIterator < document.styleSheets.length; StyleSheetIterator++){
				if(document.styleSheets[StyleSheetIterator].title == "groot"){
					document.styleSheets[StyleSheetIterator].disabled = true;
				}
				if(document.styleSheets[StyleSheetIterator].title == "klein"){
					document.styleSheets[StyleSheetIterator].disabled = false;
				}
			}
		}
		var K = document.getElementById('h2');
		K.innerHTML = "Praktijk voor Westerse astrologie<br/>en Maya-astrologie";
	}


	var topbDiv = document.getElementById('topborder').style;
	var contentDiv = document.getElementById('content').style;
	var textDiv = document.getElementById('text').style;
	var cr1Div = document.getElementById('contright1').style;
	var cr2Div = document.getElementById('contright2').style;
		topbDiv.width = w-150;
		contentDiv.height = h-200;
		contentDiv.width = w;
		cr1Div.left = w-150;
		cr2Div.left = w-200;
		textDiv.width = w-450;
			if(w<990||h<750){textDiv.width = w-400;}

	checkResize(w,h);

//HAAL DE VIER SLASHES HIERONDER WEG ALS JE DE HOOGTE EN BREEDTE VAN DE WEBSITE-WINDOW IN BEELD WILT HEBBEN
//			var dispSize= document.getElementById('h2');
//			dispSize.innerHTML = "width: " + w + ",&nbsp;height: " + h;

}

//DEZE FUNCTIE CONTROLEERD OF DE WINDOW IS GERESIZED EN HERLAAD DE PAGINA ZO NODIG  (IVM EVT VERANDERING STYLESHEET)
function checkResize(){
	var wTemp = Math.round(document.body.clientWidth);
	var hTemp = Math.round(document.body.clientHeight);
		if(w!=wTemp){clearTimeout(r); window.location.reload();}
		else if(h!=hTemp){clearTimeout(r); window.location.reload();}

	else{r = setTimeout("checkResize()",1000);}
}

//DEZE FUNCTIE WORDT OPGEROEPEN BIJ HET LADEN VAN ELKE IN-TEKST FOTO EN BEPAALD HET FORMAAT
//  obj= this   size= breedte tov pagina (%)   pos= horizontale positie
function imgSize(obj,size){

	var wImg = Math.round(document.body.clientWidth);
	var imgWidth = Math.round((wImg-350)*(size/100)-10);

//DE REGEL HIERONDER BESCHERMT DE IMG TEGEN GROTER WORDEN DAN HET ZELF IS
	if(obj.width<=imgWidth){return;}

	obj.style.width = imgWidth;
}

//DEZELFDE FUNCTIE ZONDER BESCHERMING
function imgSize2(obj,size){

	var wImg = Math.round(document.body.clientWidth);
	var imgWidth = Math.round((wImg-350)*(size/100)-10);

	obj.style.width = imgWidth;
}

//DE FUNCTIES HIERONDER VERANDERT DE CURSOR BOVEN EEN PLAATJE DAT KAN WORDEN INGEZOOMD
function cursor(obj){
	obj.style.cursor = "url('_img/_cursors/enlarge.cur')";
}


//DE FUNCTIES HIERONDER VERANDEREN HET ACHTERGRONDIMAGE BIJ HOVERING EN MAAKT OOK ONDERSCHEID TUSSEN GROTE OF KLEINE MODUS
function menuHover(obj){
	if(w<990||h<750){obj.style.backgroundImage = "url('_img/Kbuttonh.png')";}
	else{obj.style.backgroundImage = "url('_img/buttonh.png')";}
}

function menuOut(obj){
	if(w<990||h<750){obj.style.backgroundImage = "url('_img/Kbuttonl.png')";}
	else{obj.style.backgroundImage = "url('_img/buttonl.png')";}
}