﻿/* js basic load */

String.prototype.num = function(set) {
	return this.match(/[^0-9]/gi) == null ? ( this != '' ? this : set ) : set;
};

function expose_film( url , w , h ){

		var tyob = typeof Object();

		if( typeof ajax != tyob) return false;
		if( typeof film != tyob && typeof iframe != tyob){

			iframe = document.createElement('iframe');
			film = document.createElement('div');

				ajax.foundIt({

									zIndex : 99998 ,
									position : 'absolute' ,
									top : '0px' , 
									left : '0px' ,
									backgroundColor : '#000000' ,
									filter : 'Alpha(opacity=60)' ,
									opacity : 0.6
								} ,
								film.style
				);

				ajax.foundIt({

									zIndex : 99999 ,
									position : 'absolute' ,
									width : w + 'px' ,
									height : h + 'px' ,
									marginWidth : 0 ,
									marginHeight : 0 ,
									vspace : 0 ,
									hspace : 0 ,
									border : '3px solid #000000' ,
									background : '#FFFFFF'
							} ,
							iframe.style
				);

				film.onclick = function(){ window.iframe.style.display = this.style.display = 'none'; window.iframe.src = ''; }
				top.document.body.insertBefore( iframe , top.document.body.firstChild );
				if( navigator.appName.indexOf("Microsoft") > -1 ) top.document.body.insertBefore( film , top.document.body.firstChild );
				else top.document.documentElement.insertBefore( film , top.document.documentElement.firstChild );

		} else film.style.display = iframe.style.display = 'inline';

		var scrollSize = ajax.scrollSize();
		var offsetSize = ajax.offsetSize();

		film.style.width = Math.max( scrollSize.width , offsetSize.width ) + 'px';
		film.style.height = Math.max( scrollSize.height , offsetSize.height ) + 'px';
		iframe.style.top = parseInt(scrollSize.top + parseInt(( offsetSize.height - h) / 2)) + 'px';
		iframe.style.left = parseInt(scrollSize.left + parseInt(( offsetSize.width - w) / 2))+ 'px';
		iframe.src = url;

	return true;
}

function currentStyle( Element ) {

	if ( Element.currentStyle )
		return Element.currentStyle;
	else if ( window.getComputedStyle )
		return window.getComputedStyle( Element, null );
	else if ( document.defaultView && document.defaultView.getComputedStyle )
		return document.defaultView.getComputedStyle( Element , null );
	else
		return Element.style;
}
