$(document).ready(function(){
// fixing extarnal links
$("a[href^=http]").each(function(){
var hreft=$(this).attr('href');
if(hreft.replace(/perfectum/g,"")==hreft)
$(this).attr('target','_blank');
});
if($("#photos img").attr('src')){
// get list of photos
var photos=[];
$("#photos img").each(function(){
var img=$(this).attr('src');//
img=img.replace('_mini','');
img=img.replace('_images','img');
$(this).parent().attr('href',img);
photos.push(img);});
$('#photos a').lightBox();
/* var imgframe='';
for (var key in photos) {imgframe+='
 | ';}
$("#photos").after('');
var maxheight=$(".imgframe").height();
$(".frameholder").css('height',maxheight);
$(".imgframe").wrap('');
$(".la").append('');
var fwidth=$(".imgframe").width();
var fwid=intval($(".imgframe td").width());
// move by buttons
$(".la1").click(function(){
var sleft=intval($(".imgframe").css('left'));
var nleft=sleft*1 + fwid*1;
if(nleft*(-1) < 0) nleft=0;
$(".imgframe").animate({left:nleft},500);
var right=1;
});
$(".ra").click(function(){
var sleft=intval($(".imgframe").css('left'));
var nleft=sleft*1 - fwid*1;
if(nleft*(-1) > (fwidth-fwid)) nleft=0;
$(".imgframe").animate({left:nleft},500);
});
// $("#photos").hide();*/
}
});
$(window).load(function(){
/*// fix image sizes
$(".imgframe img").each(function(){
var pw=$(this).parent().parent().parent().parent().parent().width();
var ph=$(this).parent().parent().parent().parent().parent().height();
var sw=$(this).width();
var sh=$(this).height();
var dif=sw/sh;
if(sh>ph) {
var nw=ph*dif; // Math.round( )
var pad=(pw-nw)/2; // Math.round( )
$(this).css('height',ph);
$(this).css('width',nw);
$(this).css('margin','0 '+pad);
}
});*/
});
function intval( mixed_var, base ) { // Get the integer value of a variable
//
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
var tmp;
if( typeof( mixed_var ) == 'string' ){
tmp = parseInt(mixed_var);
if(isNaN(tmp)){
return 0;
} else{
return tmp.toString(base || 10);
}
} else if( typeof( mixed_var ) == 'number' ){
return Math.floor(mixed_var);
} else{
return 0;
}
}