//--built 07---------------------------------------------------------------------------//
//--by      martin hein  www.digitale-mehrwerte.eu  (hein@digitale-mehrwerte.eu)-------//
//alert("common.js");
																	
function setfontsize (fontsize, exit)
                    {//alert("setfontsize ("+fontsize+")");
                     document.getElementsByTagName('body')[0].style.fontSize = fontsize;
																					//alert(document.cookie);
																					//document.cookie = "fontsize="+fontsize+"; path=/;  expires=Tue, 07 Nov 2084 12:00:00 GMT";
																					cookie("set", "fontsize", fontsize, 1000 * 60 * 60 * 24 * 365, "/");
																			  fontsizechange(fontsize);
																				}
																				
function fontsizechange (fontsize)
                       {
																				    menuboxtitleOjb = document.getElementById("menuboxtitle_span");
																								//alert(menutitleOjb);return;
																								//alert(fontsize);
																					   if (menuboxtitleOjb)
																								  {
																										 if (fontsize!="11px")
																											  {
																														menuboxtitleOjb.innerHTML = menuboxtitleOjb.innerHTML.replace(/Internetgesch/, "Internet- Gesch");
																													}
																										 else 
																											    {//alert("else");
																															 //alert(menuboxtitleOjb.innerHTML);
																															 menuboxtitleOjb.innerHTML = menuboxtitleOjb.innerHTML.replace(/Internet- Gesch/, "Internetgesch");
																															}
																										}
                       }
																				
function cookie (mode, name, value, expires, path, domain, secure)
               {//alert("function cookie("+mode+", "+name+", "+value+", "+expires+", "+path+", "+domain+", "+secure+")");
															 if (mode=='get')
																  {
																		 cookie_array = document.cookie.split(";");
																			for (i=0; i<cookie_array.length; i++)
																			   {//alert(cookie_array[i]);
																							if (cookie_array[i].indexOf(name)!=-1) 
																							  {
																									 value = cookie_array[i].split("=")[1];
																										//alert("+"+value+"+");
																										return unescape(value);
																										break;
																									}
																						}
																			return null;
																		}
																if (mode=='set')
																  {
																		 now_date = new Date();
																		 expires_date =  new Date(now_date.getTime() + expires);
                   document.cookie = name+"="+escape(value)+
                   ((expires)?";expires="+expires_date.toGMTString():"")+ 
                   ((path)?";path="+path:"")+ 
                   ((domain)?";domain="+domain:"")+
                   ((secure)?";secure":"");
																			return true;
																		}
															}				
															
function printversion ()
                    	{
		                    links=document.getElementsByTagName('link');
		                    for (i=0; i<links.length; i++)
																						   {
			                       if (links[i].media=='print')
																												 {
																													 links[i+1].href="../_global/styles/printstyles.css";
																													}
																									}
																					}	
																					
function printpr ()
																{
																 if (browser=="iexplore")
																	  {
																				var OLECMDID = 7;
																				var PROMPT = 1; 
																				var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
																				document.body.insertAdjacentHTML('beforeEnd', WebBrowser); 
																				WebBrowser1.ExecWB(OLECMDID, PROMPT);
																				WebBrowser1.outerHTML = "";
																			}
																	else window.print();
																}		
																
																
function error_label (element_id)
                      {//alert("error_label("+element+")");
																						 labelObjA = document.getElementById("contentcontainer_div").getElementsByTagName('label');
																				   for (i=0; i<labelObjA.length; i++)
																				      {//alert(labelObjA[i].htmlFor+" == "+element_id);
																							    if (labelObjA[i].htmlFor == element_id)
																											  {
																													 labelObjA[i].className = "formerror";
																														return;
																													}
																							   }
																						}

function unerror_label (element_id)
                      {//alert("unerror_label("+element_id+")");
																						 labelObjA = document.getElementById("contentcontainer_div").getElementsByTagName('label');
																				   for (i=0; i<labelObjA.length; i++)
																				      {//alert(labelObjA[i].htmlFor+" == "+element_id);
																							    if (labelObjA[i].htmlFor == element_id)
																											  {
																													 labelObjA[i].className = "";
																														return;
																													}
																							   }
																						}

function crequest (r)
                 {//alert("crequest("+r+")");
                  var q;
                  a   = r.match(/#[^&?#]*/g);
                  while (r.match(/#[^&?#]*/)) r = r.replace(/#[^&?#]*/,"");
                  url = r.split("?")[0];
                  
                  if (r.split("?").length>1)
                    {
                     q   = r.split("?").slice(1).join("?").split(/[&?]/); 
                     tq=[];
                     for (var item in q) if (!tq[q[item].split(/=/)[0]]||q[item].split(/=/)[1]) tq[q[item].split(/=/)[0]] = q[item].split(/=/)[1];
                     q=[];
                     for (var item in tq) q[q.length] = item+((tq[item])?"="+tq[item]:"");
                    }
                  if (a) a = a[a.length-1];
                  
                  r = url;
                  if (q) r+="?"+q.join("&");
                  if (a) r+=a;
                  
                  return r;
                 }
                 
function convertURI (path) {
 //console.log('convertURI()');
 if (base = document.getElementsByTagName('base')[0]){
  URI = base.getAttribute('href').replace(/[^/]*$/, '');
  URI+= path;
 }
 return URI;
}



function writeFlash(p) {
	writeEmbed(
		'D27CDB6E-AE6D-11cf-96B8-444553540000',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
		'application/x-shockwave-flash',
		p
	);
}


function writeEmbed(cls, cb, mt, p) {
	var h = '', n;

	h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
	h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
	h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
	h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
	h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
	h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
	h += '>';

	for (n in p)
		h += '<param name="' + n + '" value="' + p[n] + '">';

	h += '<embed type="' + mt + '"';

	for (n in p)
		h += n + '="' + p[n] + '" ';

	h += '></embed></object>';

	document.write(h);
}

                 
																													
															
																																																				 																				

