function doSubmit(){
	var f = document.getElementById("ttwebForm");
	f.target=document.getElementsByTagName("iframe")[0].name;
	f.submit();
}

function submitForm(){
	jQuery.fn.colorbox({
	html:"Loading..",
	open: true,
	iframe: true,
	width: "80%",
	height: "80%",
	onComplete: doSubmit
	});
}



jQuery(document).ready(function(){
	
	var deviceAgent = navigator.userAgent.toLowerCase();
	var agentID = deviceAgent.match(/(iphone|ipod|ipad|blackberry|android)/);
	if(!(agentID)){
		jQuery("a[rel='colorbox']").colorbox({width:"80%", Height:"80%", iframe:true});
		jQuery("a[href*='index.php?eID=tx_cms_showpic&']").colorbox({});
		jQuery(".aktionsbutton").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='http://rdg.ttweb.net/raiba/securityDetail/']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='http://rdg.ttweb.net/raiba/redesign/currency/']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='http://rdg.ttweb.net/raiba/redesign/../portfolio/']").colorbox({width:"80%", height:"80%", iframe:true});
		
		jQuery("a[href*='/redesign/fundTool/']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='index.php?id=wertpapiersuche']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='index.php?id=sms_service']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='index.php?id=newsletter']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='index.php?id=musterdepot']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='index.php?id=factsheet']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[href*='index.php?id=analysensuche']").colorbox({width:"80%", height:"80%", iframe:true});
		jQuery("a[target='thePicture']").colorbox({});
		
	}
	

jQuery("a.download").each(function(){
var zufall = "?" +Math.random();
var newHREF = jQuery(this).attr('href') + zufall;
jQuery(this).attr('href',newHREF);
});

jQuery("a.external-link-new-window").each(function(){
var zufall = "?" +Math.random();
var newHREF = jQuery(this).attr('href') + zufall;
jQuery(this).attr('href',newHREF);
});	
	
	
	// MouseOver für Charts
	jQuery("#atx").mouseover(function(){
		jQuery("#chart").attr("src", "fileadmin/kursdaten/ATXRedesign.gif");
		jQuery("#atx").attr("class","active");
		jQuery("#dax").attr("class","normal");
		jQuery("#tecdax").attr("class","normal");
		jQuery("#dowj").attr("class","normal");
		jQuery("#nasdaq").attr("class","normal");
	});
	
	jQuery("#dax").mouseover(function(){
		jQuery("#chart").attr("src", "fileadmin/kursdaten/DAXRedesign.gif");
		jQuery("#atx").attr("class","normal");
		jQuery("#dax").attr("class","active");
		jQuery("#tecdax").attr("class","normal");
		jQuery("#dowj").attr("class","normal");
		jQuery("#nasdaq").attr("class","normal");		
	});
	
	jQuery("#tecdax").mouseover(function(){
		jQuery("#chart").attr("src", "fileadmin/kursdaten/TECDAXRedesign.gif");
		jQuery("#atx").attr("class","normal");
		jQuery("#dax").attr("class","normal");
		jQuery("#tecdax").attr("class","active");
		jQuery("#dowj").attr("class","normal");
		jQuery("#nasdaq").attr("class","normal");				
	});	
	
	jQuery("#dowj").mouseover(function(){
		jQuery("#chart").attr("src", "fileadmin/kursdaten/DJInduRedesign.gif");
		jQuery("#atx").attr("class","normal");
		jQuery("#dax").attr("class","normal");
		jQuery("#tecdax").attr("class","normal");
		jQuery("#dowj").attr("class","active");
		jQuery("#nasdaq").attr("class","normal");				
	});	
	
	jQuery("#nasdaq").mouseover(function(){
		jQuery("#chart").attr("src", "fileadmin/kursdaten/Nasdaq100Redesign.gif");
		jQuery("#atx").attr("class","normal");
		jQuery("#dax").attr("class","normal");
		jQuery("#tecdax").attr("class","normal");
		jQuery("#dowj").attr("class","normal");
		jQuery("#nasdaq").attr("class","active");				
	});		
		});
