/**
 * www.seniorenzuhause.ch
 * Custom JS based on jquery
 *
 * @since 2011-05-16
 * @copyright internauta, zurich
 *
 * NOTES:

 */
 
 $(document).ready(function() {
 
 	$("#serviceicons img").mouseover(
					function(e){
						$(e.target).siblings(".tooltip").fadeIn(500);
						$(e.target).parent().siblings(".tooltip").fadeIn(500);
					}
				);
	$("#serviceicons img").mouseout(
					function(e){
						$(e.target).siblings(".tooltip").fadeOut(500);
						$(e.target).parent().siblings(".tooltip").fadeOut(500);
					}
	);
 
 
 	if ($.browser.msie) {/* IE soll alt tags nicht als tooltip zeigen*/
			$("#serviceicons img").attr('alt', '');
		
		}
		
	$("#scalefont").click(
					function(e){
						if(!$("body").attr('style')){
								$("body").attr('style', 'font-size:1.13em');
								 this.src = this.src.replace("Vergroessern","Verkleinern");
								 $(e.target).siblings(".tooltip").html("Schrift verkleinern");
							}else{
								$("body").removeAttr('style');
								 this.src = this.src.replace("Verkleinern","Vergroessern");
								 $(e.target).siblings(".tooltip").html("Schrift vergrössern");
						}
					}
				);
	/* Email*/
	$('span.emailadresse').html('<a href="mailto:kontakt@seniorenzuhause.ch">kontakt@seniorenzuhause.ch</a>');
	$('span.emailguldin').html('<a href="mailto:philippe.guldin@seniorenzuhause.ch">philippe.guldin@seniorenzuhause.ch</a>');
	$('span.emailwaelti').html('<a href="mailto:pia.waelti@seniorenzuhause.ch">pia.waelti@seniorenzuhause.ch</a>');
	
	var pref = '&#109;a' + 'i&#108;' + '&#116;o'; 
	var attribut = 'hr' + 'ef' + '='; var first = '%62%65%77%65%72%62%75%6E%67'; var at = '%40'; var last = '&#x73;&#x65;&#x6E;&#x69;&#x6F;&#x72;&#x65;&#x6E;&#x7A;&#x75;&#x68;&#x61;&#x75;&#x73;&#x65;&#x2E;&#x63;&#x68;'; 
	var first2 = '&#x62;&#x65;&#x77;&#x65;&#x72;&#x62;&#x75;&#x6E;&#x67;'; var at2 = '&#x40;'; var last2 = '&#115;&#101;&#110;&#105;&#111;&#114;&#101;&#110;&#122;&#117;&#104;&#97;&#117;&#115;&#101;&#46;&#99;&#104;'; 
	$('span.emailbewerbung').html('<a ' + attribut + '\'' + pref + ':' + first + at + last + '\'>'+first2 + at2 + last2+'<\/a>');
	
	/* print */
	$("#print").click(
					function(e){
						window.print();
					}
				);
				
 	/* auswahl postkarte */
 	$(".auswahl").click(
					function(e){
						
						$(e.target).siblings('input[type=radio]').attr('checked', true);
					}
			);
});



var openMyModal = function(source, windowheight)
		{
					modalWindow.windowId = "myModal";
					modalWindow.width = 805;
					modalWindow.height = windowheight;
					modalWindow.content = "<iframe width='805' height='"+windowheight+"' frameborder='0' scrolling='auto' allowtransparency='true' src='" + source + "'></iframe>";
					modalWindow.open();
		};
				
