/* --------------------------------------------------------------------------- */
/* @copyright Copyright (c) 2001-2005 Telemobil. All Rights Reserved.          */
/* --------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------- */
/* @header default.js                                                          */
/* @abstract default javascript library                                        */
/* @discussion                                                                 */
/* --------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------- */
/* @function showPopupWindow                                                   */
/* @abstract This function will initialize a popup window                      */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */

function showPopupWindow(url, win_name, dim_w, dim_h, pos_x, pos_y, options) {
	var optiuni='';
	var wnd;

	// Ex. showPopupWindow('test.html', 'nb', '200', '100', '', '', 'resizable, status, scrollbars=0, location, toolbar');

	if (url && url!='' && url!='undefined') {
		if (win_name=='' || win_name=='undefined') {
			win_name = '_blank';
		}
		if (dim_w) {
			optiuni += 'width='+ dim_w +',';
		}
		if (dim_h) {
			optiuni += 'height='+dim_h+',';
		}
		if (options) {
			optiuni += options;
		}
		wnd = window.open(url, win_name, optiuni);
	} else {
		// if url is empty
		return false;
	}
	if (pos_x || pos_y) {
		if (pos_x=='undefined') {
			pos_x='';
		}
		if (pos_y=='undefined')	{
			pos_y='';
		}
		wnd.moveTo(pos_x, pos_y);
	}
	wnd.focus();
}

function showImage(url, win_name, dim_w, dim_h) {
	var options = '';
	
	if (url && url!='' && url!='undefined') {
		if (win_name=='' || win_name=='undefined') {
			win_name = '_blank';
		}
		if (dim_w) {
			options += 'width='+ dim_w +',';
		}
		if (dim_h) {
			options += 'height='+ dim_h +',';
		}
		wnd = window.open('', win_name, options);
	} else {
		// if url is empty
		return false;
	}
	wnd.document.open();
	wnd.document.write('<html>');
	wnd.document.write('<body bgcolor="#ffffff" text="#000000" link="#0000cc" vlink="#be002c" alink="#cc0000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
	wnd.document.write('<img src=' + url + '>');
	wnd.document.write('</body>');
	wnd.document.write('</html>');
	wnd.focus();
}

/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */


function show_Offer_Services_ZappMe_AppDemo_Wnd(applicationId, applicationName) {
	showPopupWindow('/media/flash/content/offer/services/zappme/application_demo_interface.jsp?applicationId='+applicationId+'&applicationName='+applicationName, 'wndZappMeDemo', 255, 320, 0, 0, 'scrollbars=0');
}



/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */


function show_Terminals_Z710i_Simulator_Wnd() {
	showPopupWindow('/media/flash/content/terminals/z710i/emulator/app.html', 'wndTerminalsZ710iSimulator', 500, 550, 0, 0, 'scrollbars=0');
}

/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */

function show_Terminals_Z110_Simulator_Wnd() {
	showPopupWindow('/media/flash/content/terminals/z110/emulator/interface.html', 'wndTerminalsZ110Simulator', 500, 550, 0, 0, 'scrollbars=0');
}

/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */

function show_OfferPromotionsZieWinners_Wnd() {
	showPopupWindow('/ssi/content/offer/promotions/zie/winners/details.html', 'wndOfferPromotionsZieWinners', 550, 450, 0, 0, 'scrollbars=1');
}

/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */

function show_OfferPromotionsZieRules_Wnd()
{
	showPopupWindow('/offer/promotions/zie/rules/', 'wndOfferPromotionsZieRules', 550, 450, 0, 0, 'scrollbars=1');
}

/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */

function OpenOfferServicesZappMe_ApplicationDemo(imageId) {
	showPopupWindow('/offer/services/zappme/demo/?imageId='+imageId, 'wndOfferServicesZappMeDemo', 400, 400, 0, 0, 'scrollbars=0');
}

/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */

function OpenOfferServicesZappMeGames_Demo() {
	var dim_w=510;
	var dim_h=517;
	var pos_x=0;
	var pos_y=0;
	var options="resizable=0, status=0, scrollbars=0, location=0, toolbar=0";
	showPopupWindow("/ssi/content/offer/services/zappme/demos/games_demo.html", "dragonislandpresentation", dim_w, dim_h, pos_x, pos_y, options);
}

/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */

function OpenOfferServicesZappMeMail_Demo() {
	var dim_w=510;
	var dim_h=517;
	var pos_x=0;
	var pos_y=0;
	var options="resizable=0, status=0, scrollbars=0, location=0, toolbar=0";
	showPopupWindow("/ssi/content/offer/services/zappme/demos/brew_mail_app.html", "mailPresentation", dim_w, dim_h, pos_x, pos_y, options);

}

/* --------------------------------------------------------------------------- */
/* @function                                                                   */
/* @abstract -                                                                 */
/* @param param1 type - Parameter type and description                         */
/* @result type - Result type and description                                  */
/* --------------------------------------------------------------------------- */

function OpenOfferServicesZappMeMeteo_Demo() {
	var dim_w=510;
	var dim_h=517;
	var pos_x=0;
	var pos_y=0;
	var options="resizable=0, status=0, scrollbars=0, location=0, toolbar=0";
	showPopupWindow("/ssi/content/offer/services/zappme/demos/brew_meteo_app.html", "meteoPresentation", dim_w, dim_h, pos_x, pos_y, options);
}

function show_HotspotZappInstructions_Wnd(locale)
{
	showPopupWindow('/offer/data/hotspot/instructions/index_' + locale + '.html', 'wndHotspotZappInstructions', 550, 450, 0, 0, 'scrollbars=1');
}

function show_HotspotZappFaq_Wnd(locale)
{
	showPopupWindow('/offer/data/hotspot/faq/index_' + locale + '.html', 'wndHotspotZappIFaq', 550, 450, 0, 0, 'scrollbars=1');
}

function show_HotspotZappCoverage_Wnd(locale)
{
	showPopupWindow('/offer/data/hotspot/coverage/index_' + locale + '.html', 'wndHotspotZappInstructions', 750, 450, 0, 0, 'scrollbars=1');
}

/* --------------------------------------------------------------------------- */
/* end of file                                                                 */
/* --------------------------------------------------------------------------- */

