﻿var gloBlank = new Image();
gloBlank.src = httpRoot + 'media/graphics/blank.gif';
function fixPng(png) {
	var src = png.src;
	if (!png.style.width) { png.style.width = $(png).width(); }
	if (!png.style.height) { png.style.height = $(png).height(); }
	png.onload = function() { };
	png.src = gloBlank.src;
	png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
}
function printPreview0(target) {
    var f = "width=640px, height=480px, scrollbars=1";
    var w = window.open(target + '?target=' + httpRoot + httpSelf + '.' + httpLang + '.php', '_blank', f, false);
//    var w = window.open(target + '?target=' + httpRoot + 'default.php', '_blank', f, false);
	w.moveTo(10, 10);
	$(w.document).ready(function() {
	    w.focus();
    })
    return false;
}
function printPreview(target) {
    var f = "width=640px, height=480px, scrollbars=1";
    var w = window.open(target + '?target=' + document.location , '_blank', f, false);
	w.moveTo(10, 10);
	$(w.document).ready(function() {
	    w.focus();
    })
    return false;
}
function emailPageLink(el) {
	var s = String(document.title);
	if (s.indexOf('PARSA :: ') !== 0) {
		s = 'PARSA :: '+s;
	}
	var l = String(document.location);
	if (l.indexOf('#') !== -1) {
		l = l.substring(0, l.indexOf('#'));
	}	
	if (l.indexOf('?') !== -1) {
		l = l.substring(0, l.indexOf('?'));
	}
	b = s + "%0A%0A" + l + "%0A%0A"  
	$(el).attr('href', 'mailto:?subject=' + s + '&body=' + b);
}
function limit_text(limitField, limitCount, limitNum) {
    if (limitField.value.length > limitNum) {
        limitField.value = limitField.value.substring(0, limitNum);
    } else {
        limitCount.value = limitNum - limitField.value.length + " characters remaining";
    }
}
if (window.self != window.top) {
	window.top.location = window.self.location;
}
$.preload(['glossy', 'glossy2', 'glossy3', 'arrow-d', 'arrow-l', 'arrow-r', 'more-n', 'more-h', 'more-p'], {
	base: httpRoot + 'media/preload/',
	ext:'.gif'
});