/*  
	Java script libary by : M. Karr
	www: http://www.x11media.com 
*/

// ------------------------------------------------------------------
// for bluring links 
// ------------------------------------------------------------------
var browserName = navigator.appName;
var browserVer = parseInt(navigator.appVersion);
var version = "";
var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);

if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName=="Opera") {version = "n3";} else {version = "n2";}
    // Blurring links:
    function blurLink(theObject)	{	//
	if (msie4)	{theObject.blur();}
}
		
// ------------------------------------------------------------------

// ------------------------------------------------------------------
// javacript to change ccs style class 
// ------------------------------------------------------------------
// Works only on ellement with defined (id="somename") 
// Call like the element : 
// onMouseOut="change('this', 'def_class'); onMouseOver="change('this', 'over_class');

	function change(id, newClass)
	{
		identity=document.getElementById(id);
		identity.className=newClass;
	}
// ------------------------------------------------------------------

// ------------------------------------------------------------------
// function for popups 	
// ------------------------------------------------------------------
// Addon width/height, normaly should be 0 
// but if you want add some pixxels to all popups (IE and other Browsers)
	var Add_std_Width 	= 0;
	var Add_std_Height	= 0;
	
	var Add_ie_Width 	= 0;
	var Add_ie_Height		= 20;
// value if popup height greater than 500 px ( ie shit.... ,nobody nows why)
	var Add_ie_Height_gt_498	 = 0;	
// end config -----------------------------------	
// ---------------------------------------------------


// popup window name	
	var	DocName = 'smartypopup';
	var doc_win 		= 0;
	var Closeinfo 	= 1;

	function pop_up(doc,w,h)
	{
		if (doc_win.closed == true) {Closeinfo = 1;}
		if (navigator.appName == "Netscape")
		{
			w_sub = Add_std_Width; 
			h_sub = Add_std_Height;
		}
		else
		{
			w_sub = 	Add_std_Width 	+ Add_ie_Width;
			if ( h > 498 )
			{
				h_sub =  Add_std_Height + Add_ie_Height_gt_498;
			}	
			else
			{
				h_sub =  Add_std_Height + Add_ie_Height	;
			}
		}
		w = w + w_sub;
		h = h + h_sub;
	  	doc_win = window.open(doc+'&nomv=1', DocName , 'location=no,menubar=no,toolbar=no,status=no,scrollbars=no,width='+ w +', height=' + h + ',resizable=no');

// test if URL param $nomv=1 is set
// if so, the popup is open, we navigate thru the popup-page and moving should stop now :-)	
// Closeinfo 0  means the popup is open and the user click onother popup in mainpage 
// result is: move only if popup is a new popup window;
		var expr = /(nomv\=1)/g;
		if (!expr.test(document.URL) &&  Closeinfo == 1 )
		{
			MvValueFromLeft = screen.width / 2 - (w / 2) + w_sub;
			MvValueFromTop = screen.height / 2  - ( h / 2) + h_sub;		
			doc_win.moveTo( MvValueFromLeft , MvValueFromTop );		
			Closeinfo 	= 0;
		}
	doc_win.focus();
	}

// -------------------------------------------------------
