//browser detection
var isNav=false;
var isIE=false;
var coll;
var style;

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

if( parseInt(navigator.appVersion) >= 4){
	if(navigator.appName == "Netscape" || navigator.appName == "Opera"){
		isNav = true;
		coll = "document";
		style = "";
	} else {
		isIE = true;
		coll="document.all";
		style = ".style";
	}
}

function Picture_Preload()
{
    document.Vorladen = new Array();
    if(document.images)
    {
        for(var i = 0; i < Picture_Preload.arguments.length; i++)
        {
            document.Vorladen[i] = new Image();
            document.Vorladen[i].src = Picture_Preload.arguments[i];
        }
    }
}

function Start_Preload()
{
Picture_Preload('../../Bilder/Main/fruit.jpg','../../Bilder/Main/fresh_fruit01.jpg','../../Bilder/Main/right.jpg','../../Bilder/Main/MenuUp/company.jpg','../../Bilder/Main/MenuUp/contact.jpg','../../Bilder/Main/MenuUp/partners.jpg','../../Bilder/Main/MenuUp/products.jpg','../../Bilder/Main/MenuUp/transport.jpg');
}


function setStatusBar(msgStr) { self.status = msgStr; } 

function init() {
		if (isNav) {document.captureEvents(Event.MOUSEUP);} 
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function setObjects_Nav(par)
{
 	if (isNav)
	{
		switch (par) {
  			case "grapefruit_pack":
				window.document.getElementById("Text01").style.top = 190-7;
				window.document.getElementById("Text01").style.height = 19+7;
				window.document.getElementById("Text01").style.left = 156+10;
				window.document.getElementById("Text01").style.width = 642-10;
				window.document.getElementById("Text02").style.top = 218-7;
				window.document.getElementById("Text02").style.height = 42+14;
				window.document.getElementById("Text02").style.left = 156+10;
				window.document.getElementById("Text02").style.width = 642-10;
				window.document.getElementById("Text03").style.top = 508-7;
				window.document.getElementById("Text03").style.height = 19+19;
				window.document.getElementById("Text04").style.top = 548-7;
				window.document.getElementById("Text04").style.height = 19+26;
 				break;
  			case "lemons_pack":
				window.document.getElementById("Text01").style.top = 190-7;
				window.document.getElementById("Text01").style.height = 19+7;
				window.document.getElementById("Text02").style.top = 218-7;
				window.document.getElementById("Text02").style.height = 42+8;
				window.document.getElementById("Text03").style.top = 490-7;
				window.document.getElementById("Text03").style.height = 19+19;
				window.document.getElementById("Text04").style.top = 530-7;
				window.document.getElementById("Text04").style.height = 19+45;
    				break;
  			case "mandoras_pack":
				window.document.getElementById("Text01").style.top = 190-7;
				window.document.getElementById("Text01").style.height = 19+4;
				window.document.getElementById("Text01").style.left = 156+10;
				window.document.getElementById("Text01").style.width = 642-10;
				window.document.getElementById("Text02").style.top = 214-6;
				window.document.getElementById("Text02").style.height = 42+9;
				window.document.getElementById("Text02").style.left = 156+10;
				window.document.getElementById("Text02").style.width = 642-10;
				window.document.getElementById("Text03").style.top = 473-7;
				window.document.getElementById("Text03").style.height = 19+19;
				window.document.getElementById("Text04").style.top = 512-6;
				window.document.getElementById("Text04").style.height = 19+66;
    				break;
  			case "oranges_pack":
				window.document.getElementById("Text01").style.top = 190-7;
				window.document.getElementById("Text01").style.height = 19+4;
				window.document.getElementById("Text01").style.left = 156+10;
				window.document.getElementById("Text01").style.width = 642-10;
				window.document.getElementById("Text02").style.top = 214-6;
				window.document.getElementById("Text02").style.height = 42+9;
				window.document.getElementById("Text02").style.left = 156+10;
				window.document.getElementById("Text02").style.width = 642-10;
				window.document.getElementById("Text03").style.top = 508-7;
				window.document.getElementById("Text03").style.height = 19+19;
				window.document.getElementById("Text04").style.top = 548-7;
				window.document.getElementById("Text04").style.height = 19+26;
    				break;

		}
	}

}

function showMainStart(par)
{
	//init_Page();
	showMain();
	
}

function showMain() {

  	setStatusBar("Cyprofresh");
	init();
	window.document.getElementById ("Main").style.visibility = "visible";
	window.document.getElementById ("Main").style.left = (top.screen.availWidth/2)-(800/2)-12;
}


function init_Page()
{
	top.window.moveTo(0,0); 
	if (document.all) 
   	{ top.window.resizeTo(screen.availWidth,screen.availHeight); } 
	else if 
   	(document.layers || document.getElementById) 
   	{ 
   	if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
     	{ top.window.outerHeight = top.screen.availHeight; 
       	top.window.outerWidth = top.screen.availWidth; } 
   	} 
}

if (document.layers){
window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
window.onmousedown=rightclick;
window.onmouseup=rightclick;
function rightclick(e) {
if (e.which == 3) {
alert('Benutzen Sie bitte die linke Maustaste !');
return false;
}
else {
return true;
}
}
}
if (document.all){
function click() {
if (event.button==2) {
alert('Please use the left mouse button !')
}
if (event.button==3) {
alert('Please use the left mouse button !')
}
}
document.onmousedown=click
}
document.oncontextmenu= new Function("return false");

MM_reloadPage(true);

