// Frame-Umleitung
//if ( (top.frames.length == 0) && (document.URL.indexOf('file:/') == -1) ) {
  
if (!noFrame) { var noFrame = 0; }
if (noFrame == 0 ) {
  if (top.frames.length == 0) {
    top.location.href = "jsframe.html?" + escape(document.URL) + '?&frame=' + escape(top.document.referrer);
  }
}

var paypalform = false;
var startpreis = 25.00;
var startpreisnetto = 21.01;
var volumenpreis = 350.00;
var volumenpreisnetto = 294.12;  

function startnormal() {
  paypalform = false;
  startpreis = 25.00;
  startpreisnetto = 21.01;
  volumenpreis = 350.00;
  volumenpreisnetto = 294.12;  
}  

function startpaypal() {
  paypalform = true;
  startpreis = 26.00; 
  startpreisnetto = 21.85;
  volumenpreis = 365.00;
  volumenpreisnetto = 306.72;  
}

function highlightCurrentPageLink(i) {
  var frameElements = parent.frames[2].document;
  var tag_a = frameElements.getElementsByTagName('td');
  for (var j=1; j <= tag_a.length - 1; j++) {
    element = tag_a[j];
    element.style.backgroundColor = '#FEE39E'; // C9EDA3';
    element.style.border = '1px solid #FEE39E';
    tag_a[j].className = 'meinecssklasseinaktiv';
  }
  tag_a[i].style.backgroundColor = '#FFFFFF';
  tag_a[i].style.border = '1px solid #C0C0C0';
  tag_a[i].className = 'meinecssklasseaktiv';

}

function showImage(img, description, x, y) {

 x = x + 22;
 y = y + 100;

 w = self.open("","Screenshot","resizable=yes,screenX=0,screenY=0,width=" + x + ",height=" + y);
 var filename = img.src;
 filename = filename.replace(/k_/,"_");
 with (w.document) {
   open();
   write('<html><head><meta http-equiv="Pragma" content="no-cache"><title>Screenshot</title></head>');
   write('<body bgcolor="#F0F0F0" ondragstart="return false" onselectstart="return false"; return true"><div align="center"><img src="' + filename + '" name="image_big"><p>');
   write('<font face="Verdana,Arial,Helvetica" size="2" color="#000000"><b>' + description + '</b></font><form>');
   write('<input type="image" src="img/popup_close.gif" name="closeBtn" onClick="self.close()">');
   write('</form></div></body></html>');
   close();
 }
 w.focus();
}

function checkEUCountry(selCountry, UID) {
  document.getElementById(UID).style.display = 'none';
  document.getElementById(UID).style.visibility = 'hidden';
  
  if (selCountry == 'DE'){
    if (paypalform == true) {
      startpaypal();      
      listpreispaypal();
    } else {
      startnormal();
      listpreis();
    }  
    document.getElementById('UStId').value ='';
    document.getElementById('mwst').innerHTML = "inkl.";
    return;
  }  

  countries = new Array;
  countries[0] = new Array("AT", "ATU");
  countries[1] = new Array("BE", "BE");
  countries[2] = new Array("BG", "BG"); 
  countries[3] = new Array("CY", "CY");
  countries[4] = new Array("CZ", "CZ");
  countries[5] = new Array("DK", "DK");
  countries[6] = new Array("EE", "EE");
  countries[7] = new Array("GR", "EL");
  countries[8] = new Array("ES", "ES");
  countries[9] = new Array("FI", "FI");
  countries[10] = new Array("FR", "FR");
  countries[11] = new Array("GB", "GB");
  countries[12] = new Array("HU", "HU");
  countries[13] = new Array("IE", "IE");
  countries[14] = new Array("IT", "IT");
  countries[15] = new Array("LT", "LT");
  countries[16] = new Array("LU", "LU");
  countries[17] = new Array("LV", "LV");
  countries[18] = new Array("MT", "MT");
  countries[19] = new Array("NL", "ML");
  countries[20] = new Array("PL", "PL");
  countries[21] = new Array("PT", "PT");
  countries[22] = new Array("RO", "RO");
  countries[23] = new Array("SE", "SE");
  countries[24] = new Array("SK", "SK");
  countries[25] = new Array("SI", "SI");
    
  for (var i = 0; i < countries.length; i++)
  {
     if (countries[i][0] == selCountry) {
        document.getElementById(UID).style.display = 'block';
        document.getElementById(UID).style.visibility = 'visible';
        document.getElementById('UStId').value = countries[i][1];
        break;
     }
  }

// für alle außer DE
  document.getElementById('mwst').innerHTML = "ohne";
  volumenpreis = volumenpreisnetto;
  startpreis = startpreisnetto;
  if (paypalform == true) {
    listpreispaypal();
  } else {
    listpreis();
  } 
  
  
}

// extended javascript-api-methods		:
// * jsApi-extension-name / file-name	: "jsApi.NumberString.flexibleConverting.js"
// * original download-location		: "http://www.pseliger.de/jsExtendedApi/jsApi.NumberString.flexibleConverting.js"
Number.prototype.fixedDigits = function(){var content=this;if(isNaN(content)){return content;}var separator="comma";var digits=-1;var comma="";var block="";for(var i=0;i<arguments.length;i++){if(arguments[i].constructor==Number){digits=Math.round(arguments[i]);}else if(arguments[i].constructor==String){if(separator=="comma"){comma=arguments[i];}else if(separator=="block"){block=arguments[i];}separator=((separator=="block")?("comma"):((separator=="comma")?("block"):("comma")));}}if(digits<0){digits=((content.toString().indexOf(".")>=0)?((content.toString().split("."))[1].length):(0));}if(comma===""){comma=".";}content=(Math.round(content*Math.pow(10,digits))/Math.pow(10,digits)).toString();if(digits>=1){content=content.split(".");}else{content=new Array(content);comma="";}content[content.length]="";var blockCounter=0;for(var i=content[0].length-1;i>=0;i--){content[content.length-1]=content[0].charAt(i)+content[content.length-1];blockCounter++;if(blockCounter==3){blockCounter=0;content[content.length-1]=block+content[content.length-1];}}content[0]=content[content.length-1];content.length=content.length-1;if(content.length==1){content[1]="";}for(var i=content[1].length;i<digits;i++){content[1]+="0";}content=new String(content[0]+comma+content[1]);if(content.charAt(0)==" "){content=content.substring(1);}return content;};



function listpreis() {
  
  liz=parseInt(document.OnlineReg_Form.Lizenzen.value);
  prozent = 100;

  if (!liz) {liz=1;}
  if (liz == 0) {liz=1;}

  if ((liz >= 3) && (liz <=4)) {
    prozent = 95; }

  if ((liz >= 5) && (liz <=7)) {
    prozent = 85; }

  if ((liz >= 8) && (liz <=10)) {
    prozent = 75; }

  if ((liz >= 11) && (liz <=15)) {
    prozent = 65; }

  if (liz >= 16) {
    prozent = 50; }
    
  endpreis = startpreis * prozent / 100;   

  berechnung =  liz * endpreis;
  if (liz >= 27) {
    berechnung = volumenpreis;
    endpreis = berechnung / liz;
  }
  document.OnlineReg_Form.Preis.value= berechnung.fixedDigits(2) + " EUR";
  document.OnlineReg_Form.PreisProLizenz.value= endpreis.fixedDigits(2) + " EUR";
}


function listpreispaypal() {
  liz=parseInt(document.OnlineReg_Form.Lizenzen.value);
  prozent = 100;

  if (!liz) {liz=1;}
  if (liz == 0) {liz=1;}

  if ((liz >= 3) && (liz <=4)) {
    prozent = 95.1923; }

  if ((liz >= 5) && (liz <=7)) {
    prozent = 85.5769; }

  if ((liz >= 8) && (liz <=10)) {
    prozent = 75.9615; }

  if ((liz >= 11) && (liz <=15)) {
    prozent = 66.3462; }

  if (liz >= 16) {
    prozent = 51.9231; }

  endpreis = startpreis * prozent / 100;
  
  berechnung =  liz * endpreis;
  if (liz >= 26) {
    berechnung = volumenpreis;
    endpreis = berechnung / liz;
  }
  document.OnlineReg_Form.Preis.value= berechnung.fixedDigits(2) + " EUR";
  document.OnlineReg_Form.PreisProLizenz.value= endpreis.fixedDigits(2) + " EUR";
}

function openwin(lfile, x, y) {
  open(lfile,"Rabattstaffel","resizable=yes,screenX=0,screenY=0,width=" + x + ",height=" + y);
}


/* -----------------------------------------------
   POWER PHLOGGER - v.2.2.2a
   (c) 2000-2002 www.phpee.com
   contact: webmaster@phpee.com
  ------------------------------------------------ */

// ----------------------------------------------------------
// SETTINGS:
// here should be your username you received from www.superscripte.de
// Do not edit this file manually!! Use the one you got in your
// confirmation-email or the one from PowerPhlogger's settings
// section.
   id = "mobackup";
// If you're using a frameset and are not getting correct
// referrers, please uncomment the following line:
    pp_frames = true;
// ----------------------------------------------------------


// define some defaults -------------------------------------
//if(showme==null) var showme='n';
//if(st==null)     var st='js';    // st means show-type :)
var showme='n';
var st='js';    // st means show-type :)

// get the user agent name ----------------------------------
v = navigator.appName;

// get the screen resolution --------------------------------
c=0;
if (v != "Netscape") c = screen.colorDepth;
else c = screen.pixelDepth;

// get the screen size --------------------------------------
s = screen.width+"x"+screen.height;

// get the document's title ---------------------------------
t = escape(document.title);

// get the document's referrer -------------------------------
var f = "";

// if pp_frames is true then try getting the framed referral (without error checking)
if (typeof(pp_frames) != "undefined")
	if (pp_frames)
		f = top.document.referrer;

// get the referral for non-multi-domained-framed sites using a Netscape browser
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	if (document["parent"] != null)
		if (parent["document"] != null) // ACCESS ERROR HERE!
			if (parent.document["referrer"] != null)
				if (typeof(parent.document) == "object")
					f = parent.document.referrer;

// get the referral for the current document if a framed referral wasn't found
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	if (document["referrer"] != null)
		f = document.referrer;

// convert all the unknown's into blank
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	f = "";

// escape the referral
f = escape(f);

// getting data ready to send -------------------------------
r="?id="+id+"&referer="+f+"&r="+s+"&c="+c+"&showme="+showme+"&st="+st+"&title="+t;

// adding logid if called by st='phpjs'
if(jslogid==null) var jslogid = 0;
else r = r + "&jslogid="+jslogid;


if (st=='js') { // calling PowerPhlogger by JavaScript-tag
	if (v != "Microsoft Internet Explorer") {
		r = r+"&url="+document.URL; // $HTTP_REFERER problem with NS,...
	}
	document.open();
	document.write("<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://www.oebackup.de/pphlogger/pphlogger.php"+r+"\"></script>");
	document.close();
} else { // calling PowerPhlogger by IMG-tag
	rand = Math.round(1000*Math.random());
	r = r+"&b="+rand;  //force the page to load the IMG
	document.open();
	document.write("<img src=\"http://www.oebackup.de/pphlogger/pphlogger.php"+r+"\" alt=\"\" border=\"0\">");
	document.close();
}
