/*
	standaard.js
*/

$(document).ready(function() 
    {
    	if ( $("#projectholder").length > 0 ) {
        	$("#projectholder").tablesorter(); 
        }
        
        if ( $("p.slideshow").length > 0 ) {
        	$('.slideshow').cycle({
				fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			});
		}
    } 
); 
    

function redirect()
{
	window.history.go(-1);
}


function confirmDelete(id)
{
	//alert('hello!');
	
	if (document.getElementById) {
		var elToHide = $('delete_' + id);
		var elToShow = $('confirm_' + id);
		
		elToHide.style.display = 'none';
  		elToShow.style.display = 'inline';
	}
}

function deleteRecord(id)
{
	var url = 'main.php?action=deleteRecord&id=' + id;
	document.location = url;
}


function cancelAction()
{
	var url = 'main.php';
	document.location = url;
}


function cancelDelete(id)
{
	if (document.getElementById) {
		var elToHide = $('confirm_' + id);
		var elToShow = $('delete_' + id);
		
		elToHide.style.display = 'none';
  		elToShow.style.display = 'inline';
	}
}

/*
	General
*/

function printPage()
{
	window.print();
}


function closeWindow()
{
	window.close();
}


function doPopUp()
{
	window.open("popup.htm","fieldpage","width=800,height=600,toolbar=0,status=0,location=0,menubar=0,scrollbars=0,resizable=0");
}


function setFocus() {
	/* use names, not id's! */
	//document.mainform.name.focus();
}


function openWin(name, nameWin ,h ,w) 
{
	var scw = screen.availWidth
	var sch = screen.availHeight
	aawindow = window.open(name, nameWin,"left="+((scw/2)-(w/2))+",top="+((sch/2)-(h/2))+",width="+w+",height="+h+",scrollbars=no");
}


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


function noSpam(user, domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}


/*
	load function 
*/
function tablesubmit (id)
{
//	alert(id);
	var url = '/nl/referenties/'+id+'/';
	//var url = 'main.php?page=referencies&id='+id+'&getRecord';
	document.location = url;
}



