﻿function pp_open(url){
    h = 635;
    w = 935;
    x = 0;
    y = 0;
       
    if (screen) {
        if (screen.width && screen.height) {
            x = screen.width/2 - w/2;
            y = screen.height/2 - h/2;
        }
    }
    window.open(url,null,'width='+w+',height='+h+',scrollbars=0,resizable=0,toolbar=0,directories=0,location=0,menubar=0,status=0,top='+y+',left='+x);
}

function pp_open_big(url){
    h = 635;
    w = 935;
    x = 0;
    y = 0;
       
    if (screen) {
        if (screen.width && screen.height) {
            x = screen.width/2 - w/2;
            y = screen.height/2 - h/2;
        }
    }
    window.open(url,null,'width='+w+',height='+h+',scrollbars=1,resizable=1,toolbar=1,directories=1,location=1,menubar=1,status=1,top='+y+',left='+x);
}

function pp_open_new(url) {
    window.open(url);
}

function pp_over(img, url){
    if(!img.oldSrc) img.oldSrc=img.src;
    img.src = url;
}
function pp_out(img){
    if(img.oldSrc) img.src=img.oldSrc;
}

function pp_clip_text(el, height, chars) {
    if (el.scrollHeight > height) {
        var s = el.innerHTML;
        var a_s = s.split(' ');
        var n = 0;
        var k = 0;
        s = '';
        
		while (n < chars && k < a_s.length) {
			s += a_s[k] + ' ';
			k++;
			n = s.length;
		}		
		
		el.innerHTML = s.substr(0, s.length - 1) + '...';
    }
}
