// ASM SCROLLER 2.0 - (c) 2000 Brent Gustafson, vitaflo.com and assembler.org
//
// Feel free to hack around with this code for personal use, it's open source
// so do what ya want w/ it.  Though a link would be nice. ;)  While this code
// doesn't have a ton of documentation, please remember that I am a busy man,
// so support of this code will be very minimal.  Use at your own risk.
//
// Follow me into a solo, get in the FLO
// And you can picture like a photo
// Music mixed mellow maintains to make 
// Melodies for MC's motivates the breaks 
// I'm everlasting, I can go on for days and days 
// With rhyme displays that engrave deep as X-rays
//
// -Brent (brent@assembler.org)
// assembler.org || vitaflo.com

var w3c = (document.getElementById) ? 1:0
var ns4 = (document.layers) ? 1:0
var ie4 = (document.all) ? 1:0

var range = "";
var cap = "";
var mutex = 0;
var yplace = 0;
var ymax = 0;
var ymin = 0;
var xplace = 0;
var newsHeight = 0;

/** The only code you should ever need to change here are the following 3 vars **/
var speed = 3;                         //speed at which the news scrolls
var newsId = "news";                   //name of the overall news div
var newsClipId = "newsClipping";       //name of the news clipping div

function redrawScreen() {
  location.reload();
  return false
}

function shiftTo(obj, x, y) {
  if (w3c) {
    obj.style.left = x + "px";
    obj.style.top = y + "px";
  }
  else if (ns4) {
	 obj.moveTo(x,y);
  } 
  else if (ie4) {
    obj.style.pixelLeft = x;
	obj.style.pixelTop = y;
  }
}

function getObject(obj) {
	var theObj = eval("document." + range + obj + cap);
	return theObj;
} 

function scrollUp() {
  if (mutex == 1){
    var theObj = getObject(newsId);
    if (yplace < ymax) {
      yplace = yplace + speed;
      if (yplace > ymax) yplace = ymax;
      shiftTo(theObj, xplace, yplace);
      setTimeout("scrollUp()",25);
    }
  }
}
  
function scrollDown() {
  if (mutex == 2){
    var theObj = getObject(newsId);
    if (yplace > ymin) {
      yplace = yplace - speed;
      if (yplace < ymin) yplace = ymin;
      shiftTo(theObj, xplace, yplace);
      setTimeout("scrollDown()",25);
    }
  }
}

function scrollIt(msg, dir) {
  window.status = msg; 
  mutex = dir;
  if (mutex == 1) scrollUp();
  else if (mutex == 2) scrollDown();
}

function init() {
  if (w3c) {
    range = "getElementById(\"";
    cap = "\")";
    theObj = getObject(newsClipId);
    newsHeight = parseInt(theObj.offsetHeight);
    theObj = getObject(newsId);
    ymin = (parseInt(theObj.offsetHeight) - newsHeight) * -1;
  }
  else if (ns4) {
    window.captureEvents(Event.RESIZE);
    window.onresize = redrawScreen;
    theObj = getObject(newsClipId);
    newsHeight = theObj.clip.height;
    newsId = newsClipId + ".document." + newsId;
    theObj = getObject(newsId);
    ymin = (theObj.clip.height - newsHeight) * -1;
  }
  else if (ie4) {
    range = "all.";
    theObj = getObject(newsClipId);
    newsHeight = theObj.offsetHeight;
    theObj = getObject(newsId);
    ymin = (theObj.offsetHeight - newsHeight) * -1;
  }
}

// END OF LINE



// BEGIN LAYER ON/OFF FUNCTIONS


window.onerror = null;

var netscape = 0;

var goodIE = 0;

browserName = navigator.appName.substring(0,8);

browserVer = parseFloat(navigator.appVersion);

if (browserName == "Netscape" && browserVer >= 3)

{ netscape = 1; }

if (browserName == "Microsof" && browserVer >= 4)

{ goodIE = 1; }

// end error trapping code





function layer_on_off (layerID, status) {

if (netscape || goodIE) {

        layer = document.getElementById(layerID);
        layer.style.visibility = status;


}}

function change_pic_button (buttonID, newpicture) {

if (netscape || goodIE) {

        typeimage = document.getElementById(buttonID);
      //  alert(typeimage.src);
        typeimage.src = newpicture;


}}






function chkFormular_medical() {

if (document.contactform_medical.medical_naam.value=='')
    {alert("NAME MISSING");
document.contactform_medical.medical_naam.focus();
return false;}

if (document.contactform_medical.medical_mail.value=='')
    {alert ("EMAIL MISSING");
document.contactform_medical.medical_mail.focus();
return false;}

if (document.contactform_medical.medical_mail.value.indexOf('@') == -1 || document.contactform_medical.medical_mail.value.indexOf('.') == -1)
    {alert ("EMAIL WRONG");
document.contactform_medical.medical_mail.focus();
return false;
}
if (document.contactform_medical.medical_onderwerp.value=='')
{
alert(unescape("SUBJECT MISSING"));
document.contactform_medical.medical_onderwerp.focus();
return false;
}
if (document.contactform_medical.medical_bericht.value=='')
{
alert(unescape("BERICHT MISSING"));
document.contactform_medical.medical_bericht.focus();
return false;
}


}




function chkFormular_mobility() {

if (document.contactform_mobility.mobility_naam.value=='')
    {alert("NAME MISSING");
document.contactform_mobility.mobility_naam.focus();
return false;}

if (document.contactform_mobility.mobility_mail.value=='')
    {alert ("EMAIL MISSING");
document.contactform_mobility.mobility_mail.focus();
return false;}

if (document.contactform_mobility.mobility_mail.value.indexOf('@') == -1 || document.contactform_mobility.mobility_mail.value.indexOf('.') == -1)
    {alert ("EMAIL WRONG");
document.contactform_mobility.mobility_mail.focus();
return false;
}
if (document.contactform_mobility.mobility_onderwerp.value=='')
{
alert(unescape("SUBJECT MISSING"));
document.contactform_mobility.mobility_onderwerp.focus();
return false;
}
if (document.contactform_mobility.mobility_bericht.value=='')
{
alert(unescape("BERICHT MISSING"));
document.contactform_mobility.mobility_bericht.focus();
return false;
}


}



function chkFormular_products() {

if (document.contactform_products.products_naam.value=='')
    {alert("NAME MISSING");
document.contactform_products.products_naam.focus();
return false;}

if (document.contactform_products.products_mail.value=='')
    {alert ("EMAIL MISSING");
document.contactform_products.products_mail.focus();
return false;}

if (document.contactform_products.products_mail.value.indexOf('@') == -1 || document.contactform_products.products_mail.value.indexOf('.') == -1)
    {alert ("EMAIL WRONG");
document.contactform_products.products_mail.focus();
return false;
}
if (document.contactform_products.products_onderwerp.value=='')
{
alert(unescape("SUBJECT MISSING"));
document.contactform_products.products_onderwerp.focus();
return false;
}
if (document.contactform_products.products_bericht.value=='')
{
alert(unescape("BERICHT MISSING"));
document.contactform_products.products_bericht.focus();
return false;
}


}




function chkFormular_obesicare() {

if (document.contactform_obesicare.obesicare_naam.value=='')
    {alert("NAME MISSING");
document.contactform_obesicare.obesicare_naam.focus();
return false;}

if (document.contactform_obesicare.obesicare_mail.value=='')
    {alert ("EMAIL MISSING");
document.contactform_obesicare.obesicare_mail.focus();
return false;}

if (document.contactform_obesicare.obesicare_mail.value.indexOf('@') == -1 || document.contactform_obesicare.obesicare_mail.value.indexOf('.') == -1)
    {alert ("EMAIL WRONG");
document.contactform_obesicare.obesicare_mail.focus();
return false;
}
if (document.contactform_obesicare.obesicare_onderwerp.value=='')
{
alert(unescape("SUBJECT MISSING"));
document.contactform_obesicare.obesicare_onderwerp.focus();
return false;
}
if (document.contactform_obesicare.obesicare_bericht.value=='')
{
alert(unescape("BERICHT MISSING"));
document.contactform_obesicare.obesicare_bericht.focus();
return false;
}


}


function chkFormular_venocare() {

if (document.contactform_venocare.venocare_naam.value=='')
    {alert("NAME MISSING");
document.contactform_venocare.venocare_naam.focus();
return false;}

if (document.contactform_venocare.venocare_mail.value=='')
    {alert ("EMAIL MISSING");
document.contactform_venocare.venocare_mail.focus();
return false;}

if (document.contactform_venocare.venocare_mail.value.indexOf('@') == -1 || document.contactform_venocare.venocare_mail.value.indexOf('.') == -1)
    {alert ("EMAIL WRONG");
document.contactform_venocare.venocare_mail.focus();
return false;
}
if (document.contactform_venocare.venocare_onderwerp.value=='')
{
alert(unescape("SUBJECT MISSING"));
document.contactform_venocare.venocare_onderwerp.focus();
return false;
}
if (document.contactform_venocare.venocare_bericht.value=='')
{
alert(unescape("BERICHT MISSING"));
document.contactform_venocare.venocare_bericht.focus();
return false;
}


}

