   
var win ={};

//jQuery(document).ready(function(){
//  jQuery(window).bind('resize', function(){
//	  console.log('--');
//  });
//});



GB_aldShow = function(caption, url, /* optional */ height, width, callback_fn) {
    var options = {
        caption: '',
        height: height || ald_getClientBHeight(),
        width: width || 908,
        fullscreen: false,
        show_loading: false,
        center_win : false,
        show_close_img: true,
        overlay: {offsetWidth: 150},
        /* Methode wird beim schliessen des modalen Fensters ausgeführt*/
        callback_fn: callback_fn
    };
    
    win = new GB_Window(options);
    winret =  win.show(url);

    //console.dir(win);
    return winret;
};

/* schliesst das Modal Window */
function fe_trigger_closeModalWindow(){
    //win.hide();
}

function ald_getClientBHeight(){
	return window.document.body.clientHeight - 50;
}

/**
 * 
 */
function fe_trigger_resize(obj){}

/* Iframe Resizer */
function ald_reSize(div_cont) {}

var fe_popups = new Array();

function fe_openNew(url,name,width,height) {
	var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no";

	fe_popups[name] = window.open(url, name, options);
	window.self.name = "main";
	fe_popups[name].focus();
}

function fe_openNewWS(url,name,width,height) {
	var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no";

	fe_popups[name] = window.open(url, name, options);
	window.self.name = "main";
	fe_popups[name].focus();
}

/*Karriere-Popup oeffnen*/
function fe_openKarriere(url,name,width,height) {
	try {
		var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";
		
		//url = 'http://test.tr.dev/test-js-bewerberportal.html';
		//url = 'http://staging.cms-test.aldi-nord.de/test-js-bewerberportal.html';
		
		if(!fe_popups[name] || fe_popups[name].closed==true){
			fe_popups[name] = window.open(url, name, options);
			window.self.name = "main";
			fe_popups[name].focus();
		}
		else{
			fe_popups[name].focus();		
		}
	} catch (e){}
}


function img_popup(pic){
        var temp = new Image();
        temp.src = pic;
        var head = "<html><head></head><body leftmargin='0' marginwidth='0' topmargin='0' marginheight='0'>";
        var foot = "</body></html>";
        
        var newWindow = window.open('#','headline_img','height='+(temp.height)+'px, width='+(temp.width)+'px');
        with(newWindow.document){
          open();
          write(head+'<img src="'+pic+'">'+foot);
          close();
        }
}


//-----------------------------------------
//
//-----------------------------------------
function getObj(id){

if (document.getElementById)
	if(document.getElementById(id))
	return document.getElementById(id);
	else
	return false;
 else if (document.all)
	if(document.all[id])
	return document.all[id];
	else
	return false;
 else if (document.layers)
	if(document.layers[id])
	return document.layers[id];
	else
	return false;
 else
	return false;
}
