﻿/* ================================ +
           FONT RESIZER
 + ================================ */ 

$(document).ready(function() {
	$('p').fontResizer({minFont:10,maxFont:20,increment:1});
});

/* ================================ +
           FIRST LAST
 + ================================ */ 


 $(document).ready(function() {

    $("ul.subsub li:last").addClass("last");
    $("p:first").addClass("firstpara");
    $("p:last").addClass("lastpara");
    $(".homemenu:first").addClass("firsthomemenu");
    
  });
  
  /* ================================ +
           TICKER
 + ================================ */ 
 
$(function(){
  $("ul#ticker01").liScroll();
  $("ul#ticker02").liScroll({travelocity: 0.15});


});

  /* ================================ +
           om en om
 + ================================ */ 
$(document).ready(function(){

	 $("ul.newsticker li span:odd").css("color", "#ce003c");
	 $("ul.newsticker li span:even").css("color", "#000000");
	 
	});
	
  /* ================================ +
          TOOLTIP
 + ================================ */ 	
$(document).ready(function() {
	//Tooltips
	var tip;
	$(".tip_trigger").hover(function(){

		//Caching the tooltip and removing it from container; then appending it to the body
		tip = $(this).find('.tip').remove();
		$('body').append(tip);

		tip.show(); //Show tooltip

	}, function() {

		tip.hide().remove(); //Hide and remove tooltip appended to the body
		$(this).append(tip); //Return the tooltip to its original position

	}).mousemove(function(e) {
	//console.log(e.pageX)
		  var mousex = e.pageX + 20; //Get X coodrinates
		  var mousey = e.pageY + 20; //Get Y coordinates
		  var tipWidth = tip.width(); //Find width of tooltip
		  var tipHeight = tip.height(); //Find height of tooltip

		 //Distance of element from the right edge of viewport
		  var tipVisX = $(window).width() - (mousex + tipWidth);
		  var tipVisY = $(window).height() - (mousey + tipHeight);

		if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
			mousex = e.pageX - tipWidth - 20;
			$(this).find('.tip').css({  top: mousey, left: mousex });
		} if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
			mousey = e.pageY - tipHeight - 20;
			tip.css({  top: mousey, left: mousex });
		} else {
			tip.css({  top: mousey, left: mousex });
		}
	});

});


  /* ================================ +
          MAIL CHECK
 + ================================ */ 

 // a custom onComplete handler to prevent form submits for the demo
  function myOnComplete()
  {
    return true;
  } 
  
$(document).ready(function() {
  $(".begunstigers_aanmelden").RSV({
    onCompleteHandler: myOnComplete,
    displayType: "display-html",
    errorFieldClass: "errorFieldDemo2",
    rules: [
     "required,fld_con_input_aanhef,Uw aanhef a.u.b.",
     "required,fld_con_input_naam,Uw naam a.u.b.",
      "required,fld_con_input_adres,Uw adres a.u.b.",
"required,fld_con_input_postcode,Uw postcode a.u.b.",
"required,fld_con_input_plaats,Uw plaats a.u.b.",
"required,fld_con_input_telefoon,Uw telefoonnummer a.u.b.",
      "required,fld_con_input_email,Uw email a.u.b.",
      "valid_email,fld_con_input_email,Vul een geldig email a.u.b."

      ]
  });
}); 

  /* ================================ +
          MAIL CHECK EN
 + ================================ */ 

 // a custom onComplete handler to prevent form submits for the demo
  function myOnComplete()
  {
    return true;
  } 
  
$(document).ready(function() {
  $(".begunstigers_aanmelden_en").RSV({
    onCompleteHandler: myOnComplete,
    displayType: "display-html",
    errorFieldClass: "errorFieldDemo2",
    rules: [
     "required,fld_con_input_aanhef,Please enter your gender.",
     "required,fld_con_input_naam,Please enter your name.",
      "required,fld_con_input_adres,Please enter your address.",
"required,fld_con_input_postcode,Please enter your zip code.",
"required,fld_con_input_plaats,Please enter your city.",
"required,fld_con_input_telefoon,Please enter your phone number.",
      "required,fld_con_input_email,Please enter your email address.",
      "valid_email,fld_con_input_email,Please enter a valid email address."

      ]
  });
}); 

  /* ================================ +
          SUBWAYS PREMIERE CHECK 
 + ================================ */ 

 // a custom onComplete handler to prevent form submits for the demo
  function myOnComplete()
  {
    return true;
  } 
  
$(document).ready(function() {
  $(".form_subways_premiere").RSV({
    onCompleteHandler: myOnComplete,
    displayType: "display-html",
    errorFieldClass: "errorFieldDemo2",
    rules: [
      "required,fld_con_input_aanhef,Uw aanhef a.u.b.",
     "required,fld_con_input_naam,Uw naam a.u.b.",
"required,fld_con_input_telefoon,Uw telefoonnummer a.u.b.",
      "required,fld_con_input_email,Uw email a.u.b.",
      "valid_email,fld_con_input_email,Vul een geldig email a.u.b.",
      "required,fld_con_input_aantal,Kies aantal kaarten a.u.b."

      ]
  });
}); 
		

 /* ================================ +
         PRINT
 + ================================ */   
    
    function go()
{
var a = window. open('','','scrollbars=yes,width=600,height=600');

a.document.open("text/html");
a.document.write('<html><head><link rel="stylesheet" href="external/css/print.css" /></head><body>');
a.document.write(document.getElementById('cnt_content').innerHTML);
a.document.write('<b>Bron: Het International Danstheater</b> </body></html>');
a.document.close();
a.print();
}




