// ================================================================================================ //
// This function parser all fields of the given form and creates a URL params string
function AD_ParamsFromForm(FormName_) {
	// Initialize params string
	var params = '?';
	// Parse given form
	with(document.forms[FormName_]) {
		var i=0;
		// Go through all elements
		for (i=0; i<elements.length; i++) {
			// Separate next pair (name, value)
			if (i > 0)
				params += '&';
			// Add current element to params string
			params += elements[i].name + '=' + elements[i].value;			
		}
	}
	// Return result
	return params;
}

// ================================================================================================ //
// This function opens new popup window, loads given page into it and also parses all the form
// inputs and gives them to the new page as parameters
function AD_NewPopUpWinFormParams(PageToLoad_, FormName_) {
	// First parse given form
	var params = AD_ParamsFromForm(FormName_);
	// Open popup window with given page to load and add url paramaters to it
	window.open(PageToLoad_ + params, 'SiemensAD', 'location, left=500, top=200, width=488, height=600, resizable=yes, scrollbars=yes');
	//document.write(params);
	return false;
}

// ================================================================================================ //
// This function opens new popup window, loads given page into it and also parses all the form
// inputs and gives them to the new page as parameters
function AD_NewPopUpWin(PageToLoad_) {
	// First parse given form
	//var params = AD_ParamsFromForm(FormName_);
	// Open popup window with given page to load and add url paramaters to it
	window.open(PageToLoad_, 'SiemensAD', 'location, left=500, top=200, width=488, height=600, resizable=yes, scrollbars=yes');
	//document.write(params);
	return false;
}

// ================================================================================================ //
// This function opens new popup window, loads given page into it and also parses all the form
// inputs and gives them to the new page as parameters
function AD_FlashMovie(URL_, w_, h_) {
	// First parse given form
	//var params = AD_ParamsFromForm(FormName_);
	$params = 'left=150, top=100' + ', width=' + w_ + ', height=' + h_;
	// Open popup window with given page to load and add url paramaters to it
	window.open(URL_ + '&width=' + w_ + '&height=' + h_, 'SiemensAD', $params);
	//document.write(params);
	return false;
}