/*
----------------------------------------------------------------------------------------
	Copyright: Element Electronic Media
	This Code May Not Be Duplicated Without
	The  Written Consent of Element Electronic Media
	info@element.co.za
-----------------------------------------------------------------------------------------
*/

function newZoomValue(zoomVal)
{
	oldzoom = parent.nav.theform.zoomVal.value;
//	alert(oldzoom);
	if (!parent.nav.theform)
	{
		gZoomValue = 1;
	}
	else
	{	
		if (!(parent.nav.theform.zoommenu.selectedIndex-zoomVal <0 || parent.nav.theform.zoommenu.selectedIndex-zoomVal >7))
			parent.nav.theform.zoommenu.selectedIndex-=zoomVal;
			parent.nav.theform.zoomVal.value = parent.nav.theform.zoommenu.options[parent.nav.theform.zoommenu.selectedIndex].value;	
		gZoomValue = (parent.nav.theform.zoomVal.value/oldzoom)
//		parent.nav.theform.zoomVal.value = gZoomValue *100;
	};
	zoom();
}



function zoom()

{

    var number;

    var el;

    var zoomVal = gZoomValue ;

    var mycss = new Array();

    var imgarr;

  //  totalzoom =  totalzoom * zoomVal;

   totalzoom =gZoomValue;

        // FRAME CHECK:

		if (!parent.main.document.styleSheets) return;

		

   	        if (parent.main.document.styleSheets[0].cssRules)      // MO

	   	    mycss = parent.main.document.styleSheets[0].cssRules;

	        else

	    	    mycss = parent.main.document.styleSheets[0].rules;  // IE



    for(x=0;x<mycss.length;x++){

		    if (x==0){

				mycss[x].style.width = '0px';

				mycss[x].style.height = '0px';

			} else {

				if (mycss[x].style.left != '') mycss[x].style.left = (parseFloat(mycss[x].style.left) * zoomVal) + 'px';

				if (mycss[x].style.width != '') mycss[x].style.width = (parseFloat(mycss[x].style.width) * zoomVal) + 'px';

				if (mycss[x].style.top != '') mycss[x].style.top = (parseFloat(mycss[x].style.top) * zoomVal) + 'px';

				if (mycss[x].style.fontSize != '')  mycss[x].style.fontSize = (parseFloat(mycss[x].style.fontSize) * zoomVal+0.5) + 'px';

			}

    }







	// FRAME CHECK:

	imgarr = parent.main.document.getElementsByTagName("IMG");

	      

      for (var i = 0; i < imgarr.length; i++) {

        if (imgarr[i].name == "") {

        imgarr[i].height = imgarr[i].height * zoomVal;

        imgarr[i].width = imgarr[i].width * zoomVal;

        }

      }
}

function checkfile()
{
	t = '3'+parent.main.location;
	t = String (t);
	var	firstPos = t.indexOf(parent.nav.filename);
	if (firstPos != -1)
	{
		firstPos += parent.nav.filename.length;
		var z = t.length;
		t = t.substring(firstPos,z);
		var	lastPos =  t.indexOf(parent.nav.fileext);	
		t = t.substring(0,lastPos);
		if (t !='' &&  t != parent.nav.activefile)
		{
			parent.nav.activefile = t;
		}	
	}
}
