function TestJS()
{
	document.title = "Now I've changed it";  
}

// couldnt find out how to get css to check existing class info so use a global variable to store state of magnification
var MagnifyState=false;

function ClickThumbnail(DivClicked)
{
    var Div=$(DivClicked);			// get div details via prototype
    var Img = Div.getElementsByTagName("img")[0];		// assumes only 1 img (can't navigate any better than this
    var Text = Div.getElementsByClassName("ScreenText")[0];	
    var NewSrc;
    
	    if(!MagnifyState){
		    NewSrc=Img.src.replace("122x91","243x182");
	    }
        else{
		    NewSrc=Img.src.replace("122x91","500x375");
	    }

	$('MainImg').src = NewSrc;				// set the img
	$('MainText').innerHTML = Text.innerHTML;
}


function MagnifyMainScreen()
{
	if(!MagnifyState){
		$('MainScreenshotOuter').addClassName('ScreenEnlargedDivMagnify');
		$('MainScreenshotInner').addClassName('ScreenImageEnlargedMagnify');

		// added by Taz 02/08
//                $('Magnify').addClassName('EnlargedMagnifyGlass');

		// added by Taz 03/08
//                $('Main').addClassName('MainMagnify');

		$('AllScreenShots').addClassName('AllScreenShotsMagnify');		// fixes position of all screen shots
		var NewSrc=document.getElementById('MainImg').src.replace("243x182","500x375");
		var NewSrc=NewSrc.replace("122x91","500x375");		/* just in case*/
		$('MainImg').src = NewSrc;				// set the img
		MagnifyState=true;			
	}
    else{
		$('MainScreenshotOuter').removeClassName('ScreenEnlargedDivMagnify');
		$('MainScreenshotInner').removeClassName('ScreenImageEnlargedMagnify');

		// added by Taz 02/08
//                $('Magnify').removeClassName('EnlargedMagnifyGlass');

//                $('Main').removeClassName('MainMagnify');
		
		$('AllScreenShots').removeClassName('AllScreenShotsMagnify');	
		var NewSrc=document.getElementById('MainImg').src.replace("500x375","243x182");
		$('MainImg').src = NewSrc;				// set the img
		MagnifyState=false;
	}
}

// blogs etc - magnify inline image
// now passing in three variables, outer, inner and the image.
// they are required to make sure each image enlarges separately
function MagnifyInlineScreen(outer, inner, image, text)
{

//stores the image element 
var Src=$(image).src;


	// indexOf() method returns the position of the first occurrence
	// of a specified string value in a string.
	// using this instead of using a global variable Magnify State.
	// method returns -1 if the string value to search never occurs


	// if its >=0 then it is small 
	if(Src.indexOf("243x182") >= 0){
		// adds a new class name, take new properties
		// ScreenEnlargedDivMagnify and ScreenImageEnlargedMagnify
		// are in the CSS with addtional properties.

		$(outer).addClassName('ArticleScreenEnlargedDivMagnify');
		$(inner).addClassName('ArticleScreenImageEnlargedMagnify');
		
		// $ = document.getElementById
		// changing the image size, size element
		var NewSrc=$(image).src.replace("243x182","500x375");
		//var NewSrc=NewSrc.replace("122x91","500x375");		/* just in case*/

		$(image).src = NewSrc;				// set the img
		//$(outer).style.marginRight=0; // eg of correcting some formatting


		$(text).innerHTML="Click to Reduce";		
	}
	// making smaller
    else{
		// removing the properties to take the image back to its original state
		$(outer).removeClassName('ArticleScreenEnlargedDivMagnify');
		$(inner).removeClassName('ArticleScreenImageEnlargedMagnify');
		var NewSrc=$(image).src.replace("500x375","243x182");
		$(image).src = NewSrc;				// set the img

		$(text).innerHTML="Click to Enlarge";
	}
}


function expandcollapse (abstract, expand, link) 
{
	small = $(abstract);
	enlarged = $(expand);
        
	if (small.className=="AbstractPostShown whitetext") 
      { 
           small.className="AbstractPostHidden whitetext"; 
           enlarged.className="ArticleBodyBodyShow whitetext";
           $(link).innerHTML="[-] Click here to collapse tutorial";
      }
      else 
      { 
           small.className="AbstractPostShown whitetext";
           enlarged.className="ArticleBodyBodyHidden whitetext"; 
           $(link).innerHTML="[+] Click here to expand tutorial";
      }
}

function FP_changeProp() {//v1.0
    // args is an array storing all the paremeters passed in
    var args = arguments;
    // d is a local variable storing the whole document
    var d = document;
    var id = args[0];
    // calling for the function FP_getObjectByID and passing in the ID(which is the image)
    var o = FP_getObjectByID(id);
    var i,j,s,ao,v,x; 
 
    d.$cpe = new Array(); 
 
    if(o){ 
        for(i = 2; i < args.length; i+=2){ 
            v = args[i+1]; 
            s = "o"; 
            ao = args[i].split("."); 
            
            for(j = 0; j < ao.length; j++) { 
                s+="."+ao[j]; 
                if(null == eval(s)) { 
                    s = null; 
                    break; 
                } 
            }
  
            x = new Object; 
            x.o = o; 
            x.n = new Array(); 
            x.v = new Array();
            x.n[x.n.length]=s;
            // calling for eval function from prototype.js file 
            eval("x.v[x.v.length]="+s); 
            d.$cpe[d.$cpe.length] = x;
 
            if(s) {
                // calling for eval function from prototype.js file
                eval(s+"=v");
            } 
       } // end main for loop
    }
}


function FP_getObjectByID(id,o) {//v1.0
    var c,el,els,f,m,n; 
    
    if(!o){
        o = document;
    } 
    
    if(o.getElementById) {
        el = o.getElementById(id);
    }
    else if(o.layers){ 
        c = o.layers;
    }
    else if(o.all){
        el = o.all[id]; 
    }    
    
    if(el) {
        return el;
    }
 
    if(o.id == id || o.name == id){
        return o;
    }
    
    if(o.childNodes){
        c = o.childNodes;
    } 
 
    if(c){
        for(n = 0; n < c.length; n++) { 
            el = FP_getObjectByID(id,c[n]); 
            if(el) {
                return el;
            } 
        }
    }
 
    f = o.forms; 
 
    if(f){ 
        for(n = 0; n < f.length; n++) { 
            els = f[n].elements;
            for(m = 0; m < els.length; m++){ 
                el = FP_getObjectByID(id,els[n]); 
                if(el) {
                    return el;
                } 
            } 
        }
    }
    return null;
}


function FP_changePropRestore() {//v1.0
    // d is a local variable storing the whole document 
    var d = document;
    var x; 
 
    if(d.$cpe) { 
        for(i = 0; i < d.$cpe.length; i++) { 
            x = d.$cpe[i];
            if(x.v == "") {
                x.v = ""; 
            }
            // calling for eval function from prototype.js file    
            eval("x."+x.n+"=String(x.v)");
        } 
        d.$cpe=null; 
    }
}

	




