
//**************************************//
//**** Innerhalb Frame laden   *********//
//**************************************//

//Hier die Weiterleitungs URL angeben
var url = "http://www.cameron.de/com/";
//Gehört die aufgerufene Seite in ein frameset ?
// y oder n
	frameEnforcer("y");
	function frameEnforcer(frames) {
	if (frames == 'y'){
		if (self.parent.frames.length == 0){
			self.parent.location = url;
		}
	}
	else if (frames == 'n'){
	if (self.parent.frames.length != 0){	
	self.parent.location=url;
		}
	}
}

//**************************//
//* Cookie fuer Newsletter *//
//*************************//

var expDays = 2; 
// Anzahl der Tage, die das Cookie gültig sein soll
var page = "newsletter.html";
// Seite, die aufgerufen wird
var windowprops = "width=500,height=400,left=250,top=250,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";
// Angabe über die neue Seite: Breite, Höhe, Ort, Aussehen

//Cookie bekommen:
function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
		return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	}  
	return null;
}

// Cookie setzen:
function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}

// Cookie löschen:
function DeleteCookie (name) {  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

// Überprüfung, ob Cookie schon da ist:
function amt(){
	var count = GetCookie('count')
	if(count == null) {
		SetCookie('count','1')
		return 1
	}
	else {
		var newcount = parseInt(count) + 1;
		DeleteCookie('count')
		SetCookie('count',newcount,exp)
		return count
    }
}

// Cookie-Wert auslesen: 
function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

// Überprüfung, ob Cookie gesetzt:
function checkCount() {
	var count = GetCookie('count');
	// Wenn der Zähler Null ist, wird er auf 1 gesetzt,
	// das Cookie gesetzt und das neue Fenster geöffnet:
	if (count == null) {
		count=1;
		SetCookie('count', count, exp);
		window.open(page, "", windowprops);
	}
	// Anderenfalls wird nur der Zähler erhöht
	// und das Cookie überschrieben.
	else {
		count++;
		SetCookie('count', count, exp);
	}
}

//**************************//
//*       World Timer      *//
//*************************//




var hours
var shifthours
var minutes
var seconds
var localhours
var pause=2000
var thisplace
var i_worldtime=0
var timer

var worldtime = new Array()

worldtime[0]="Berlin,2"
worldtime[1]="Azores,-1"
worldtime[2]="Baghdad,4"
worldtime[3]="Buenos Aires,-3"
worldtime[4]="Chicago,-5"
worldtime[5]="Denver,-6"
worldtime[6]="Hong Kong,8"
worldtime[7]="Honolulu,-10"
worldtime[8]="Johannesburg,2"
worldtime[9]="Kairo,3"
worldtime[10]="Lima,-5"
worldtime[11]="London,1"
worldtime[12]="Los Angeles,-7"
worldtime[13]="Mexico City,-5"
worldtime[14]="Moscow,4"
worldtime[15]="New York,-4"
worldtime[16]="Paris,2"
worldtime[17]="Perth,8"
worldtime[18]="Sao Paulo,-3"
worldtime[19]="Sydney,10"
worldtime[20]="Tokyo,9"

function showtime() {
if (document.all) {
	thisplace=worldtime[i_worldtime].split(",")
	thistime= new Date()
	hours=thistime.getUTCHours()
	hours=eval(hours)
	shifthours=eval(thisplace[1])
	localhours=eval(shifthours+hours)
	if (localhours <0) {localhours=24+localhours}
	if (localhours >=24) {localhours=localhours-24}
	
	minutes=thistime.getUTCMinutes()
	seconds=thistime.getUTCSeconds()
	
	if (thisplace[0]=='Delhi') {
		minutes=eval(minutes+30)
		if (minutes>=60) {
			minutes=eval(minutes-60)
			localhours=eval(localhours+1)
		}
	}
	if (eval(minutes) < 10) {minutes="0"+minutes}
	if (eval(seconds) < 10) {seconds="0"+seconds}
	if (eval(localhours) < 10) {localhours="0"+localhours}
	thistime = localhours+":"+minutes+":"+seconds
	document.title=" ------ "+thistime+" --- >>> "+thisplace[0]+" <<< ---------------------------------"
	i_worldtime++
	if (i_worldtime>=worldtime.length) {
		i_worldtime=0
	}
	timer =setTimeout("showtime()",pause)
	}
}

if (document.all) {
	window.onload=showtime
}


//**************************//
//*   Newsletter Pop-up    *//
//*************************//

function neuesfenster() 
{
top.name = "main";
var popupURL = "newsletter.html";
var popup = window.open(popupURL,"neuesfenster",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=400,left=250,top=250,screenX=200,screenY=200');
// set the opener if it's not already set.  it's set automatically
// in netscape 3.0+ and ie 3.0+.
if( navigator.appName.substring(0,8) == "Netscape" )
{
popup.location = popupURL;
popup.opener = self;
}
}

