function writeDate(){

var month_long_german      = new Array("Januar", "Februar", "März", "April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
var weekday_long_german    = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");

var dateobj = new Date();

var day     = dateobj.getDate();
var weekday = dateobj.getDay();
var month   = dateobj.getMonth();
var year    = dateobj.getFullYear();

var datestring = weekday_long_german[weekday] + ", " + day + ". " + month_long_german[month] + " " + year;

document.write(datestring);
//document.write("Hello world");
//document.write(year);


}



function daysBetween(yr, mo, dy) {

var SECOND = 1000; // the number of milliseconds in a second
var MINUTE = SECOND * 60; // the number of milliseconds in a minute
var HOUR = MINUTE * 60; // the number of milliseconds in an hour
var DAY = HOUR * 24; // the number of milliseconds in a day
var WEEK = DAY * 7; // the number of milliseconds in a week

  var nDate = new Date(); // current date (local)
  var nTime = nDate.getTime(); // current time (UTC)
  var dTime = Date.UTC(yr, mo - 1, dy); // specified time (UTC)
  var bTime = Math.abs(nTime - dTime)  // time difference
  return Math.round(bTime / DAY);

}

// ### OPEN NEW WINDOW ###
var remote = null;
// javascript:detach('popup','http://',600,400)
function detach(n,u,w,h) {
remote = window.open(u, n, 'width=' + w + ',height=' + h +',resizable=yes,scrollbars=yes');
  if (remote != null) {
    if (remote.opener == null)
	remote.opener = self;
	window.name = 'scomnavbar';
	remote.location.href = u;
	}
}


//Macromediafunktionen

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.0
  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 && document.getElementById) x=document.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];}
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function gotoUrl(box) {

	val = box.options[box.selectedIndex].value;
	if(val==0){alert('Bitte Option waehlen !'); box.focus();return;}
	window.open (val,'_top');
	return true;
}

function mail(msg,rechnung) {
   url="/service/testleseraktionenform.html?act="+msg;
   if(rechnung){
   url+="&rechnung=1";
	}	
    window.open(url,'aktionen','width=620,height=450,resizable=yes,scrollbars=yes');

}

function mailalternative(msg) {
   url="/service/testleseraktionenform_wahl.html?act="+msg;
    window.open(url,'aktionen','width=620,height=450,resizable=yes,scrollbars=yes');
}

function sicherheit(msg) {
   url="/service/testleseraktionenform_sicherheit.html?act="+msg;
    window.open(url,'aktionen','width=620,height=450,resizable=yes,scrollbars=yes');
}


function vignette(msg) {
   url="/service/testleseraktionenform_vignette.html?act="+msg;
    window.open(url,'aktionen','width=640,height=550,resizable=yes,scrollbars=yes');
}

function mozart(msg) {
   url="/service/testleseraktionenform_mozart.html?act="+msg;
    window.open(url,'aktionen','width=620,height=450,resizable=yes,scrollbars=yes');
}
       

function gewinn(spiel,adresse,termin,antwort,formular) {
    if(!termin){termin=''}	
    if(!antwort){antwort=''}	
    if(!formular){formular='gewinnmail.html'}	

	url="/kundenbindung/"+formular+"?act="+spiel+"&adr="+adresse+"&termin="+termin+"&antwort="+antwort;
    window.open(url,'gewinnspiel','width=620,height=400,resizable=yes,scrollbars=yes');
}

function jugendtoto(spiel,adresse) {
    url="/kundenbindung/jugendtotomail.html?act="+spiel+"&adr="+adresse;
    window.open(url,'gewinnspiel','width=600,height=450,resizable=yes,scrollbars=yes');
}

function bestell(spiel,adresse,termin,antwort) {
    if(!termin){termin=''}
    if(!antwort){antwort=''}
    url="/kundenbindung/bestellmail.html?act="+spiel+"&adr="+adresse+"&termin="+termin+"&antwort="+antwort;
    window.open(url,'gewinnspiel','width=620,height=400,resizable=yes,scrollbars=yes');
}
		
function aquagewinn(spiel,adresse,termin,antwort) {
    if(!termin){termin=''}
    if(!antwort){antwort=''}
    url="/kundenbindung/aquamail.html?act="+spiel+"&adr="+adresse+"&termin="+termin+"&antwort="+antwort;
    window.open(url,'gewinnspiel','width=640, height=640,,resizable=yes,scrollbars=yes');
}

function skitag(spiel,adresse){
    url="/kundenbindung/skitagmail.html?act="+spiel+"&adr="+adresse;
    window.open(url,'gewinnspiel','width=600,height=450,resizable=yes,scrollbars=yes');
}


function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muss eine Email Addresse beinhalten.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' muss eine Nummer beinhalten.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' ist ein Mussfeld.\n'; }
  }

 if (errors) alert('Folgende Fehler sind aufgetreten:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function initAbo() {

        var _href;
        var _pos;
        var _val;
        _href = parent.location.href;
        _pos=_href.indexOf("?");

   if (_pos > 0 )
     {
         if (_href.substring(_pos+1)=='subscribe') {
            document.mail.newsalert[0].checked=true;
                 } 
		 else if (_href.substring(_pos+1)=='delete'){
            document.mail.newsalert[1].checked=true;
                 }
		 else if (_href.substring(_pos+1)=='recommend'){
            document.mail.newsalert[2].checked=true;
                 }
 		 else if (_href.substring(_pos+1)=='weeksubscribe'){
            document.weekly.news[0].checked=true;
                 }
		 else if (_href.substring(_pos+1)=='weekdelete'){
            document.weekly.news[1].checked=true;
                 }

      }
}

function setHP()
{
document.all.test.style.behavior='url(#default#Homepage)';
document.all.test.setHomepage('http://www.salzburg.com/');
}


function zoom(url,titel){


mypic=new Image();
mypic.src = url;


if(mypic.width == 0){mypic.width=600};
if(mypic.height == 0){mypic.height=350};

pic = eval( "open('','pic', 'width=" + mypic.width +  " height=" +  mypic.height + " resizable')" );


pic.document.write('<title>',titel ,'</title> <body onLoad="window.focus();" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><img onClick="window.close()" src="', url, '">');

pic.document.close();

}

function goGeiz(param){
var url="http://www.salzburg.com/nwas/service/geizhals.html?url=http://geizhals.salzburg.com/?such=" + param;
top.location = url;
}


function ladeFrame(){
  if(location.search.substring(1)){
     content.location=location.search.substring(1);
  }
}
	  

function openPowerwinning()
{
	var pid=null;
	var tmp01=unescape(document.location.href); //unescape necessary for netscape

	if((tmp01 != null)&&(tmp01 != 'undefined')&&(tmp01 != ''))
	{
		if(tmp01.indexOf('?') != -1)
		{
			var tmp02=tmp01.split('?');
			if(tmp02[1].indexOf('pid=') != -1)
			{
				tmp02=tmp02[1].split('=');
				if(tmp02[1] != '')
				{
					if(tmp02[1].indexOf('&') != -1) // more than one parameter
					{
						tmp02=tmp02[1].split('&');
						pid=tmp02[0];
					}
					else pid=tmp02[1];

					if((pid!=null)&&(pid!=''))
						parent.powerwinning.location.href="http://premiumpromotions.salzburg.com/index_ap.jsp?quelle=sana&pid="+pid;
					else parent.powerwinning.location.href="http://premiumpromotions.salzburg.com/index_ap.jsp?quelle=sana";
				}
				else parent.powerwinning.location.href="http://premiumpromotions.salzburg.com/index_ap.jsp?quelle=sana";
			}
			else parent.powerwinning.location.href="http://premiumpromotions.salzburg.com/index_ap.jsp?quelle=sana";
		}
		else parent.powerwinning.location.href="http://premiumpromotions.salzburg.com/index_ap.jsp?quelle=sana";
	}
	else parent.powerwinning.location.href="http://premiumpromotions.salzburg.com/index_ap.jsp?quelle=sana";
}



