var j = jQuery.noConflict();

j(document).ready(function(){ 
	j(document).pngFix(); 
	j('.toolbar .tools img').tipTip({maxWidth: "auto", edgeOffset: 10});
	j('.thumb a').tipTip({maxWidth: "auto", edgeOffset: -50, defaultPosition: 'top'});
	j('#downloadcv').click(function(e){
		post("/getpdf", {html: escape(j("#page").html()), css: "assets/templates/max/css/pdf.css"});
		e.preventDefault();
	})
	j('#print').click(function(e){
		print();
		e.preventDefault();
	})
	if(j("a#viewphoto").html()!=null) {
		j("#viewphoto").fancybox({
			'speedIn':	0, 
			'speedOut':	0
		});
	}
});
function post(URL, PARAMS) {
	var temp=document.createElement("form");
	temp.action=URL;
	temp.method="POST";
	temp.style.display="none";
	for(var x in PARAMS) {
		var opt=document.createElement("textarea");
		opt.name=x;
		opt.value=PARAMS[x];
		temp.appendChild(opt);
	}
	document.body.appendChild(temp);
	temp.submit();
	return temp;
}

