//Copyright 1999-2002 by Adib Fricke: The Word Company. Alle Rechte vorbehalten./All rights reservered.
//twc blog, image zoom, 060329

//-------------------------------------------------------------------------------twc.js MAIN
//color(rback, rlink, rtext, lBack, llink, ltext)
inhCol = new Array('#ffffff','#000099','#000000');
ctcCol = new Array('#ccff00','#000099','#000000');

curCol = new Array('#336666','#ccff00','#ffffff');
prjCol = new Array('#003366','#ccff00','#ffffff'); //336666
txtCol = new Array('#99cc00','#000099','#000000'); 
rdsCol = new Array('#666633','#ccff00','#ffffff'); //336699 : ccff00
morCol = new Array('#cccc00','#000099','#000000');
ranCol = new Array('#333333','#ff9900','#ffffff');
edtCol = new Array('#666666','#99ff00','#ffffff');

defCol = new Array('#99cc00','#000099','#000000','#666666','#cc9900','#000000');
nbkCol = new Array('#000066','#99ff00','#ffffff','#669999','#99ff00','#ffffff');
dnwCol = new Array('#99cc00','#000099','#000000','#333333','#99cc00','#ffffff');
rtmCol = new Array('#333333','#ff9900','#ffffff','#cc0000','#ccff00','#ffffff');
rtfCol = rtmCol;
gbwCol = new Array('#666666','#ffffff','#ffffff','#ff9900','#000099','#000000');
trwCol = new Array('#666666','#ffffff','#ffffff','#ff9900','#000099','#000000');
citCol = gbwCol;
worCol = gbwCol;
dblCol = new Array('#666666','#99ff00','#ffffff','#ff6600','#99ff00','#ffffff');
fmtCol = new Array('#ccff00','#ffffff','#ffffff','#000066','#66ccff','#ffffff');
lacCol = new Array('#666633','#ccff00','#ffffff','#cc6600','#ccff00','#ffffff'); //99ff99 : cc3300
ontCol = new Array('#000066','#ccff00','#ffffff','#cccc00','#000099','#000000');
yemCol = new Array('#006699','#999933','#ffffff','#333333','#66ff00','#ffffff');
brmCol = new Array('#99cc00','#000099','#000000','#000066','#cc9900','#ffffff');
tlkCol = new Array('#cccc99','#000099','#000000','#336666','#99ff00','#ffffff');
tl2Col = tlkCol;
iotCol = new Array('#333333','#ff9900','#ffffff','#99cc00','#000066','#000000');
pluCol = new Array('#336666','#ffcc00','#ffffff','#000033','#ff9900','#ffffff');
logCol = new Array('#333333','#ff9900','#ffffff','#cc3300','#ccff00','#ffffff'); //333333 : 336699
quoCol = new Array('#cc6600','#cc9900','#ffffff','#990000','#ff9900','#ffffff');
wifCol = new Array('#000033','#ffcc00','#ffffff','#009900','#ffcc00','#ffffff'); //ff6600 : 009900
swkCol = new Array('#cc3300','#ffcc00','#ffffff','#333333','#ffcc00','#ffffff');
quiCol = new Array('#cc0000','#ccff00','#ffffff','#009900','#ffffff','#000000');
urtCol = new Array('#99CC00','#000099','#000000','#333333','#99cc00','#ffffff');
shjCol = new Array('#336666','#ccff00','#ffffff','#333333','#99cc00','#ffffff');
mamCol = new Array('#333333','#ccff00','#ffffff','#990000','#cc9900','#ffffff');
igfCol = new Array('#666699','#99cc00','#ffffff','#99cc00','#cc0000','#000000');
cifCol = new Array('#999999','#333366','#000000','#333333','#cc9900','#ffffff');
hawCol = new Array('#999999','#333366','#000000','#333333','#cc9900','#ffffff');

function setColor(){thisCol = eval((myTWC.substring(0,3)) +'Col'); if(thisCol[0]==''){thisCol = 'defCol';}}



//-------------------------------------------------------------------------------doku -- modified!! - 060222
function pic_body(){
	setColor();
	document.write('<body bgcolor="' + thisCol[0] + '" link="' + thisCol[1] + '" vlink="' + thisCol[1] + '" alink="' + thisCol[1] +'" text="'+ thisCol[2] +'" leftmargin="2" topmargin="2" marginwidth="2" marginheight="2">');}

function doku1(head, subhead, style, img_w, spc_w){
	with(document) {
	//outer table for positioning
	write('<table border="0" cellpadding="0" cellspacing="0" width="98%" height="100%" align="center" valign="middle"><tr><td align="center" valign="middle">');
	//inner table for image
	write('<table height="480" width="' + (img_w+spc_w) + '" border="0" cellspacing="0" cellpadding="0">');
	//row 1 - with spacer for left side
	write('<tr><td width="' + spc_w + '"><img src="spc.gif" width="1" height="1"></td>');
	//row 2 with image
	write('<td width="' + img_w + '" align="left" valign="top">');
	
	//img position
}}
function doku2(img_w, spc_w, myMenu, myText, myTWC){
	with(document) {
 	//close img td
 	write('</td></tr>');
 	//menu row
 	write('<tr><td width="' + spc_w + '"><img src="spc.gif" width="1" height="27"></td><td>');
 	write('<p class="m2">&gt; <a href="javascript:prevIMG()" class="m2">prev</a> | &gt; <a href="javascript:nextIMG()" class="m2">next</a> | &gt; <a href="javascript:window.close()" class="m2">exit</a></div>');
 	//close inner table
 	write('</td></tr></table> ');
 	//close outer table
 	write('</td></tr></table>');
	write('</body>');
}}

//---------------------------------------------------------------------------img arrays -- only for twc blog
haw = new Array('wordgarden_method.gif','wordgarden_time.gif','wordgarden_environment.gif','wordgarden_prediction.gif', 'wordgarden_fish.gif', 'wordgarden_structure.gif', 'wordgarden_raincoat.gif', 'wordgarden_exhibition.gif', 'wordgarden_idea.gif');

function selectArray(){
	myPict = eval(myTWC);
	if (myPict == '' || myPict.length == 1 ){myPict = 0; alert("Sorry, right now no other images are available!");}
}

//---------------------------------------------------------------------------img flipper
var counter= 0;
function nextIMG(){
	selectArray();
	if(myPict != 0){
	var pictMax= myPict.length;
	counter = counter+1;
		if (counter == pictMax) {counter=0;} 
	imageURL= myPath+myPict[counter]; 
	document.images[1].src = imageURL;
	//alert('ballo');
}}
function prevIMG() {
	selectArray();
	if(myPict != 0){
	var pictMax= myPict.length;
		if (counter == 0){counter=pictMax;}
	counter = counter-1;
	imageURL= myPath+myPict[counter]; 
	document.images[1].src = imageURL;
}}


//---------------------------------------------------------------------------display window (twc_opener.js)

function testme(){alert('OK');}

	var theName=window.navigator.appName.toLowerCase();
	var thePlatform = navigator.appVersion.toLowerCase();
	
function getPage(page){
	var thisURL = "";
	
	switch(page){
		case "wordgarden":
			page = "http://www.thewordcompany.de/media/img/wordgarden.htm"
			break;
		case "":
			page = "http://www.thewordcompany.de/";
			break;
	}
	
	var setHeight = 0
	var setWidth = 0
	
	if( thePlatform.lastIndexOf('win')!= -1){
		//win
		if ( theName.indexOf("microsoft")!= -1 ){
				setWidth = 10;
				setHeight = 30;
		}
		else{
			if (theName.indexOf("netscape")!= -1){
				if(navigator.appVersion.substring(0,1) == "4"){
					setWidth = 10;
					setHeight = 28;
				}else{
					setWidth = 6;
					setHeight = 26;
				}
			}
			else{
				setWidth = 10;
				setHeight = 30;
			}
		}
	}
	else{
		if (thePlatform.lastIndexOf('mac') != -1) {
				//MAC				
			if ( theName.indexOf("microsoft")!= -1 ){
				setWidth = 32;
				setHeight = 80;
			}else{
				setWidth = 10;
				setHeight = 30;
			}
	
		}else{
				//others
				setWidth = 10; 
				setHeight = 30; 
		}
	}

	var winWidth = screen.availWidth - setWidth;
	var winHeight = screen.availHeight - setHeight;
	var winSize = 'width=' + winWidth + ',height=' + winHeight;
	
	nWin = window.open(page,"randomWin", winSize);
	if (  (thePlatform.lastIndexOf('mac') != -1) && (theName.indexOf("microsoft")!= -1)  ) {
		nWin.moveTo(10,20);
	}else{
		nWin.moveTo(0,0);
	}
}