$(document).ready( function() {


	$("#categoryBox").hide();
	$("#categoryButton").toggle(
	function(){ $("#categoryBox").slideDown('slow') },
	function(){ $("#categoryBox").slideUp('slow') }
	);

	$("#loginCnt").hide();


	$("#loginCntButton").click(function () {
		$("#headerOptionsCnt").hide();
		$("#loginCnt").slideDown('slow');
	});


	$("#loginCntButton2").click(function () {
		$("#headerOptionsCnt").hide();
		$("#loginCnt").slideDown('slow');
	});

	$("#passwordCnt").hide();


	$("#passwordCntButton").click(function () {
		$("#headerOptionsCnt").hide();
		$("#passwordCnt").slideDown('slow');
	});

	$("#passwordCntButton2").click(function () {
		$("#headerOptionsCnt").hide();
		$("#passwordCnt").slideDown('slow');
	});


	/**** pornstar.php ****/
	$("#pornstarPictures").hide();
	$("#pornstarMovies").hide();
	$("#tab1").css({ background: "white" });


	$("#pornstarPictureBtn").click(function () {
		$("#pornstarBio").hide();
		$("#pornstarMovies").hide();
		$("#pornstarPictures").slideDown('slow');
		$("#tab3").css({ background: "white" });
		$("#tab2").css({ background: "#cccccc" });
		$("#tab1").css({ background: "#cccccc" });
	});


	$("#pornstarBioBtn").click(function () {
		$("#pornstarPictures").hide();
		$("#pornstarMovies").hide();
		$("#pornstarBio").slideDown('slow');
		$("#tab1").css({ background: "white" });
		$("#tab2").css({ background: "#cccccc" });
		$("#tab3").css({ background: "#cccccc" });
	});

	$("#pornstarMoviesBtn").click(function () {
		$("#pornstarPictures").hide();
		$("#pornstarBio").hide();
		$("#pornstarMovies").slideDown('slow');
		$("#tab1").css({ background: "#cccccc" });
		$("#tab2").css({ background: "white" });
		$("#tab3").css({ background: "#cccccc" });
	});

	
	$("select[name='affiliate_type']").change(function () {

		var affiliate_type			 		= $("select[name='affiliate_type']").val()
		if(affiliate_type == "0"){

			$("#business_container").slideUp('slow');
		}
		if(affiliate_type == "1"){

			$("#business_container").slideDown('slow');
		}

	});

	$("select[name='count']").change(function () {

		var count			 		= $("select[name='count']").val()
		var cat_id			 	= $("input[name='cat_id']").val()
		var page			 		= $("input[name='page']").val()
		var mode			 		= $("input[name='mode']").val()
		var scriptname		= $("input[name='scriptname']").val()
		var catname			 	= $("input[name='catname']").val();

		if(catname!="")	catname = catname+"-";

		var pagetype 			= "";

		if(scriptname=="/movies.php") pagetype = "sexfilms";
		if(scriptname=="/picturesets.php") pagetype = "sexplaatjes";
		if(scriptname=="/sexstories.php") pagetype = "sexverhalen";
		if(scriptname=="/websites.php") pagetype = "sexsites";
		if(scriptname=="/pornstars.php") pagetype = "pornosterren";

		window.location.href 	= 'http://www.pornasa.nl/'+pagetype+'/'+cat_id+'/1/'+mode+'/'+count+'/'+catname+pagetype+'.html'

	} )

});





function FullScreenWebsite(url) {
	var window_height = screen.availHeight - 30;
	var window_width = screen.availWidth - 6;
	var window_top = (screen.availHeight-window_height)/2-10;
	var window_left = (screen.availWidth-window_width)/2-5;
	nw = window.open('','newwindoes','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',features=toolbar=no,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,maximize=yes,minimize=yes');
	if(!nw) nw = top;
	nw.location.href = url;
	return false;
}

function copyit(theField) {
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()
	therange=tempval.createTextRange()
	therange.execCommand("Copy")
}




