/*

	JavaScript (c) 2000 Elin Tjerngren, Artopod. 
	elin@artopod.se
	
	v 1.0
	
*/
if (navigator.userAgent.indexOf("Opera") != -1) { // alla opera blir ie	
		var ie=true;
} else if (parseInt(navigator.appVersion)==4) {
		var ns=(navigator.appName=="Netscape");
		var ie=(navigator.appName=="Microsoft Internet Explorer");
}
else if (parseInt(navigator.appVersion)>=5) {
	var moz=true;
}	
else {
	var ns=false;
	var moz=false;
	var ie=false;
}
var win=(navigator.userAgent.indexOf("Win") != -1);
var mac=(navigator.userAgent.indexOf("Mac") != -1);
var styleEnd="";
var gt = unescape("%3E");
if (moz) {
	styleEnd="_moz.css"; 
} else if ((ns)&&(win||mac)) { 
	if (win) styleEnd="_pns.css";
	else if (mac) styleEnd="_mns.css";
} else if ((ie)&&(win||mac)) { 
	if (win) styleEnd="_pie.css";
	else if (mac) styleEnd="_mie.css";
} else {
	styleEnd="_oth.css"; 
}
document.write('<link rel="stylesheet" href="'+url+stylePrefix+styleEnd+'" type="text/css" /'+gt);

// -------- Netscape resize problem
//ns reload bugfix (c) elin@artopod.com
if (ns) {
	window.captureEvents(Event.RESIZE);
	window.onresize=fixNs;
	window.pageW=window.innerWidth;
	window.pageH=window.innerHeight;
}

function fixNs() {
	var noResize = ((window.pageW==window.innerWidth)&&(window.pageH==window.innerHeight));
	if (!noResize) {
		window.pageW=window.innerWidth;
		window.pageH=window.innerHeight;
		location.reload();
		return false;
	}
}

var tWidth='562px';                  // width (in pixels)
var tHeight='16px';                  // height (in pixels)
var moStop=true;                     // pause on mouseover (true or false)
var tSpeed=3;                        // scroll speed (1 = slow, 5 = fast)
// Simple Marquee / Ticker Script
// copyright 3rd January 2006, Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the below code in this script (including this
// comment) is used without any alteration
var cps=tSpeed; var aw, mq; var fsz = parseInt(tHeight) - 4; function startticker(){if (document.getElementById) {var tick = '<div style="position:relative;width:'+tWidth+';height:'+tHeight+';overflow:hidden;"'; if (moStop) tick += ' onmouseover="cps=0" onmouseout="cps=tSpeed"'; tick +='><div id="mq" style="position:absolute;left:0px;top:0px;white-space:nowrap;"><\/div><\/div>'; document.getElementById('ticker').innerHTML = tick; mq = document.getElementById("mq"); mq.style.left="0px"; mq.innerHTML='<span id="tx">'+content+'<\/span>'; aw = document.getElementById("tx").offsetWidth; lefttime=setInterval("scrollticker()",50);}} function scrollticker(){mq.style.left = (parseInt(mq.style.left)>(-10 - aw)) ?parseInt(mq.style.left)-cps+"px" : parseInt(tWidth)+10+"px";} 

function activatePlaceholders() {
var detect = navigator.userAgent.toLowerCase(); 
if (detect.indexOf("safari") > 0) return false;
var inputs = document.getElementsByTagName("input");
for (var i=0;i<inputs.length;i++) {
  if (inputs[i].getAttribute("type") == "text" || inputs[i].getAttribute("type") == "password") {
   if (inputs[i].getAttribute("placeholder") && inputs[i].getAttribute("placeholder").length > 0) {
    inputs[i].value = inputs[i].getAttribute("placeholder");
    inputs[i].onfocus = function() {
     if (this.value == this.getAttribute("placeholder")) {
      this.value = "";
     }
     return false;
    }
    inputs[i].onblur = function() {
     if (this.value.length < 1) {
      this.value = this.getAttribute("placeholder");
     }
    }
   }
  }
}
}

function init() {
	activatePlaceholders();
}

window.onload=init;

