/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: William Bontrager | http://www.bontragerconnection.com/ */
// Copyright 2006 Bontrager Connection, LLC
// This version of the script redirects automatically.
// The Web site has a few other methods for directing also:
// http://www.bontragerconnection.com/library/redirect_with_a_cookie.shtml

// Three items can be customized (values between quotation marks):
//
// 1. What URL shall the browser be redirected 
//    to if a cookie was previously set?

var RedirectURL = "index2.html";

// 2. How many days shall the cookie live in 
//    the visitor's browser (0 means remove 
//    cookie whenever browser closes)?

var DaysToLive = "365";

// 3. What name shall the cookie have (any 
//    sequence of alphabetical characters 
//    is okay, so long as the name doesn't 
//    conflict with any other cookies that 
//    this web page might be setting.)?

var CookieName = "HasSeenIntro";

// No other customization is required.

function Action() {
location.href = RedirectURL;
}

DaysToLive = parseInt(DaysToLive);
var Value = 'bypass page next time';

function GetCookie() {
var cookiecontent = '';
if(document.cookie.length > 0) {
   var cookiename = CookieName + '=';
   var cookiebegin = document.cookie.indexOf(cookiename);
   var cookieend = 0;
   if(cookiebegin > -1) {
      cookiebegin += cookiename.length;
      cookieend = document.cookie.indexOf(";",cookiebegin);
      if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
      cookiecontent = document.cookie.substring(cookiebegin,cookieend);
      }
   }
if(cookiecontent.length > 0) { return true; }
return false;
}

function SetCookie() {
var exp = '';
if(DaysToLive > 0) {
   var now = new Date();
   then = now.getTime() + (DaysToLive * 24 * 60 * 60 * 1000);
   now.setTime(then);
   exp = '; expires=' + now.toGMTString();
   }
document.cookie = CookieName + '=' + Value + exp;
return true;
}










function setOpacity(level) {
  var element = document.getElementById("pageimage");
  element.style.opacity = level;
  element.style.MozOpacity = level;
  element.style.KhtmlOpacity = level;
  element.style.filter = "alpha(opacity=" + (level * 100) + ");";
}



function fadein(){
	
	var duration = 1000;  /* 1000 millisecond fade = 1 sec */
var steps = 20;       /* number of opacity intervals   */
var delay = 5000;     /* 5 sec delay before fading out */
  for (i = 0; i <= 1; i += (1 / steps)) {
    setTimeout("setOpacity(" + i + ")", i * duration);
  }

}



function fadein_prod(){
	
	var duration = 1000;  /* 1000 millisecond fade = 1 sec */
var steps = 20;       /* number of opacity intervals   */
var delay = 5000;     /* 5 sec delay before fading out */

  for (i = 0; i <= 1; i += (1 / steps)) {
    setTimeout("setOpacity_prod(" + i + ")", i * duration);
  }

}

function setOpacity_prod(level) {
  var element = document.getElementById("pageimage_prod");
  element.style.opacity = level;
  element.style.MozOpacity = level;
  element.style.KhtmlOpacity = level;
  element.style.filter = "alpha(opacity=" + (level * 100) + ");";
}





function IECorrectIntro(){
	if(isOldIE()){
		var main = document.getElementById("mainintroarea");
		main.style.left = '54px';
		main.style.top = '111px';
		
		
		//correct menu for about us
		var aboutusmen= document.getElementById("MainMenuContainer_aboutus");
		//l: 105
		//t: 108;
		aboutusmen.style.left= '107px';
		aboutusmen.style.top = '111px';
		
		var prodmen= document.getElementById("MainMenuContainer_prod");
		//l: 208
		//t: 108;
		prodmen.style.left= '211px';
		prodmen.style.top = '111px';
		
		var partmen= document.getElementById("MainMenuContainer_partners");
		//l: 385
		//t: 108;
		partmen.style.left= '388px';
		partmen.style.top = '111px';
		

		
		
		
	
	}
}


function IECorrect(footpos){
	if(isOldIE()){
		var main = document.getElementById("mainarea");
		main.style.left = '53px';
		main.style.top = '111px';
		
		var foot = document.getElementById("footerarea");
	
		foot.style.left='54px';
		var strtest= "'"+(footpos+3)+"px'";
	
		foot.style.top = (footpos+3)+"px";
		
		//correct menu for about us
		var aboutusmen= document.getElementById("MainMenuContainer_aboutus");
		//l: 105
		//t: 108;
		aboutusmen.style.left= '107px';
		aboutusmen.style.top = '111px';
		
		var prodmen= document.getElementById("MainMenuContainer_prod");
		//l: 208
		//t: 108;
		prodmen.style.left= '211px';
		prodmen.style.top = '111px';
		
		var partmen= document.getElementById("MainMenuContainer_partners");
		//l: 385
		//t: 108;
		partmen.style.left= '388px';
		partmen.style.top = '111px';
		
	
		
		
		
	
	}
}


function isOldIE(){
	var oldIE=false;
	//alert("in testing routine: "+navigator.appVersion.indexOf("MSIE"));
	if(!(navigator.appVersion.indexOf("MSIE")==-1)){
		
		var verind = (navigator.appVersion.indexOf("MSIE"))+5;
	
		var ver = parseInt(navigator.appVersion.charAt(verind));
	
		
		if(ver < 8){
			oldIE=true;
		}
	}	
	
	return oldIE;
}