

// Google Adwords
var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-4022428-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
// End Google Adwords  



jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};


function LoadImageCache() {

$.preLoadImages( 	"images/bckBanner01.png", 
					"images/bckBanner02.png", 
					"images/bckBanner03.png",
					"images/bckBanner04.png",
					"images/bckBanner05.png",
					"images/bckBanner06.png",					
					"images/bckSlide00.png",
					"images/bckSlide01.jpg",
					"images/bckSlide02.jpg",
					"images/bckSlide03.jpg",
					"images/bckSlide04.jpg",
					"images/bckSlide05.jpg"
				);
	
}


(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)


var framechild = "frmHome.html";
var languagePage = "index.html";

function LoadFramePage( name )
{	
	languagePage  = name;
	
	if  ( top.location.search != "" )
	{ 
		framechild = top.location.search; 
		framechild = framechild.substring( 1, framechild.length + 1 );	
		frames['homeContent'].location.href = framechild;		
	}
}

function LoadIntoHomePage()
{	
	var newchild;
	var myloc;
	var lang;
	
	if ( top.location == self.location ) 
	{	
		myloc =  top.location.href		
			
		if(  myloc.lastIndexOf("\\") != -1) {
			var idx =  myloc.lastIndexOf("/");
			newchild = myloc.substring( idx + 1, myloc.length );
			lang     = myloc.substring( idx - 2, idx ); 
			
			if    ( lang == "nl" ) languagePage = "..\\index.html";
			else  languagePage = "..\\indexEn.html";

			
		} else if( myloc.lastIndexOf("/") != -1) {
			var idx =  myloc.lastIndexOf("/");
			newchild = myloc.substring( idx + 1, myloc.length );
			lang     = myloc.substring( idx - 2, idx ); 
						
			if    ( lang == "nl" ) languagePage = "../index.html";
			else  languagePage = "../indexEn.html";


		} else
		{
			newchild = myloc;
		}
		
		self.location.replace( languagePage + "?" + lang + "/"+ newchild );	
	}
}




function LoadFrame( stripFilmName )
{	
	var imgName = stripFilmName.attr( "title" );
	var imgExt  =  imgName.substring(imgName.lastIndexOf(".")+1, imgName.length );

	LoadIntoHomePage();
		
	top.window.document.title = document.title;
	top.window.scrollTo( 0,0);		
	
	
	if ( top.imgCurrent != imgName )
	{	
		top.imgCurrent = imgName;

		if ( imgExt == 'jpg' )
		{	
			imgName = 'images/' + imgName;

			top.window.$( '#thePicture' ).hide();				
			top.window.$( '#theBack img').attr( { src : 'images/bckSlide00.png' } );	
			top.window.$( '#thePicture img' ).attr( { src : imgName } );
			
			top.window.$( '#thePicture img' ).css( { width : "auto" } );
			
			top.window.$( '#thePicture' ).animate({ width: 'show' }, 250, 'easeOutQuart' );
		}
		else
		{
			imgName = 'images/' + imgName;			
			top.window.$('#thePicture').fadeOut( 230 );	
			top.window.$('#theBack img').attr( { src : imgName } );				
		}					
	}		
}



function clearForm(form) 
{
    $(form).find(':input').each(function()  
    { 	
	     switch(this.type) {
            case 'password':
            case 'select-multiple':
            case 'select-one':
            case 'text':
            case 'textarea':
                $(this).val('');
                break;
            case 'checkbox':
            case 'radio':
                this.checked = false;
        }	
    }); 
}








function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function eraseCookie(name) {
	createCookie(name,"",-1);
}




/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

var clickmessage= "(c) 2010 Fine Art Photography - Willem van den Berg!";

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()



    

/* EOF */
