
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


var docs = [
			['page1','title1'],
			['page2','title2'],
			['page3','title3'],
            ['page4','title4'],
            ['page5','title5'],
			['page6','title6'],
            ['page7','title7'],
			['page8','title8'],
			['page9','title9'],
			['page10','title10'],
	
		   ];
var currentDoc = 0; 
function prev(){
	if(currentDoc <= 0){
		
		//currentDoc = docs.length - 1;
	}else{
		currentDoc = currentDoc -1;
	}
	setCurrentLayer();
}
function next(){
	if(currentDoc >= docs.length -1){
		//currentDoc = 0;
	}else{
		currentDoc = currentDoc +1;
	}
	
	setCurrentLayer();
}

function jump(doc){
	currentDoc = doc - 1;
	setCurrentLayer();
}

function setCurrentLayer(){
	for( var i = 0; i < docs.length; i++ ) {
		if(i == currentDoc){
			toggleLayerSet(docs[i],'block');
		
			}else{
			toggleLayerSet(docs[i],'none');
		}
		
	}
}
function toggleLayerSet(arr,display){
			toggleLayer(arr[0],display);
			toggleLayer(arr[1],(display == 'block')?'inline':'none' );
}

function toggleLayer(whichLayer,display)
{

if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
//style2.display = style2.display? "none":"block";
style2.display = display;

//alert(style2.display);
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "none":"block";
style2.display = display;

}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "none":"block";
style2.display = display;

}
}	

///////////////////////////////////////
//                                   //
//        Wimpy Button Maker         //
//                                   //
//           ©2008 Plaino            //
//           Available at            //
//       www.wimpyplayer.com         //
//                                   //
///////////////////////////////////////

var wimpyUserAgent = navigator.appName.indexOf("Microsoft");
var wimpyButtonIDs = wimpyButtonIDs || Array();
function wimpyButtonStopOthers(myid_in){
	for(i=0; i<wimpyButtonIDs.length; i++){
		if(wimpyButtonIDs[i] != myid_in){
			if (wimpyUserAgent != -1) {
				window[wimpyButtonIDs[i]].js_wimpy_pause();
			} else {
				document[wimpyButtonIDs[i]].js_wimpy_pause();
			}
		}
	}
}
function writeWimpyButton(theFile, wimpyWidth, wimpyHeight, wimpyConfigs, backgroundColor){
	var wimpyReg = "N1pzOSUzQmpLNzIlODAlN0NGVFMlMkFtVWw0LXVKQXd5d1FWeGglNUUlM0R5";
	var defaultWidth = 35;
	var defaultHeight = 35;
	var defaultConfigs = "";
	var baseURL = "";
	var wimpySwf = "/themes/colincowie/wimpy_button.swf";
	var wimpyWidth = (wimpyWidth == null) ? defaultWidth : wimpyWidth;
	var wimpyHeight = (wimpyHeight == null) ? defaultHeight : wimpyHeight;
	var wimpyConfigs = (wimpyConfigs == null) ? defaultConfigs : wimpyConfigs;
	var backgroundColor = (backgroundColor == null) ? false : backgroundColor;
	var myid = "wimpybutton"+Math.round((Math.random()*1000)+1);
	wimpyButtonIDs[wimpyButtonIDs.length] = myid;
	var flashCode = "";
	var newlineChar = "\n";
	var backgroundColor = (backgroundColor == null) ? false : backgroundColor;
	if(typeof(backgroundColor) == "string"){
		var Astring = backgroundColor.split("");
		if(Astring[0] == "#"){
			Astring.shift();
			backgroundColor = Astring.join("");
		}
	}
	if(backgroundColor == false){
		tptParam = '<param name="wmode" value="transparent" />'+newlineChar;
		tptEmbed = ' wmode="transparent"';
	} else {
		tptParam = '<param name="bgcolor" value="#'+backgroundColor+'" />'+newlineChar;
		tptEmbed = ' bgcolor="#'+backgroundColor+'"';
	}
	flashCode += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+wimpyWidth+'" height="'+wimpyHeight+'" id="'+myid+'">'+newlineChar;
	flashCode += '<param name="movie" value="'+wimpySwf+'" />'+newlineChar;
	flashCode += '<param name="loop" value="false" />'+newlineChar;
	flashCode += '<param name="menu" value="false" />'+newlineChar;
	flashCode += '<param name="quality" value="high" />'+newlineChar;
	flashCode += '<param name="wmode" value="transparent" />'+newlineChar;
	flashCode += '<param name="flashvars" value="theFile='+baseURL+theFile+wimpyConfigs+'&wimpyReg='+wimpyReg+'&myid='+myid+'" />'+newlineChar;
	flashCode += '<embed src="'+wimpySwf+'" width="'+wimpyWidth+'" height="'+wimpyHeight+'" flashvars="theFile='+baseURL+theFile+wimpyConfigs+'&wimpyReg='+wimpyReg+'&myid='+myid+'"'+tptEmbed+' loop="false" menu="false" quality="high" name="'+myid+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'+newlineChar;
	//document.write('<br>'+myid+'<br><textarea name="textarea" cols="40" rows="3">'+flashCode+'</textarea><br>')+newlineChar;
	document.write(flashCode);
}

