
reinitialiseScrollPane = function(){
$('.scroll_container').jScrollPane();
};


pagetitle = "SAG'S MIT DEINEN AUGEN - ";


stoerer_anim_small=function(){
	$('.begeisterung .stoerer img').animate({
		width:110,
		height:110,
    	left: '-10',
		top: '-10'
   
  		}, 1000, function() {
   		stoerer_anim_big();
  	});
}



stoerer_anim_big=function(){
	$('.begeisterung .stoerer img').animate({
		width:130,
		height:130,
    	left: '0',
		top: '0'
   
  		}, 1000, function() {
   		setTimeout(stoerer_anim_small,1000);
  	});
}




function searchDoctors() {
$('#loading_ajax').show();

var addr = document.getElementById('addressText').value;
var url = "http://www.get.cibavision.com/index.shtml?brandSite=Y&brandSiteURL=www.cibavision-dailies.com/sagsmitdeinenaugen/DE/&style=drLocator.css&country=AUT&postalCd=";
document.getElementById('drLocatorFrame').src = url +addr;
$('#drLocatorFrame').delay(1000).fadeIn('slow');
$('#loading_ajax').delay(1000).hide();

}



load_doc = function(){
	$('#loading_ajax').show();
	
/*$.ajax({
  url: 'src/php/ip.php',
  success: function(data) {
	  //alert(data);

    $('#COOLWIDGET').geoWidget({
        ip: data,
        ipinfodbKey: 'ac3cd7176c5a71225a47e389e08bc81c6371d752ec2a0011f4d156e4cd077270',
        title: '',
        address: '', 
        latitude: '',
        longitude: '',        
        callback:function(address, latitude, longitude, errorCode, errorMessage){
			city = $('#COOLWIDGET_address').val();
			//alert(city);*/
			
			
			
			dl_content='<input type="text" value="Stadt" id="addressText" name="addressText"/><input class="button" type="button" value="Anpasser suchen" onClick="javascript:searchDoctors()"/><iframe style="display:none;" width="920px" height="440px" id="drLocatorFrame"</iframe>';
			
			$('#COOLWIDGET').html(dl_content);
			$('#COOLWIDGET').fadeIn();
			//$('#addressText').val(city);
			
			searchDoctors();

        //}});
   //}});
};

















$(document).ready(function() {
	
		$('.button').mouseenter(function(){
			$(this).addClass('hover');
		});
		
		$('.button').mouseleave(function(){
			$(this).removeClass('hover');
		});
		
		
			

		$('#accordion').accordion();
		
		
		$('.ui-accordion-content').css("height","");
		
		$('.ui-accordion-header').live('click',function(){
			reinitialiseScrollPane();
		});
	

$.backstretch("img/smda_background.jpg");


$('.ie6 #backstretch').css("position","absolute");

$('.scroll_container').jScrollPane();

/*$('li a').live('mouseover',function(){
	thislink = $(this).attr('href');
	$(this).removeAttr('href');
});

$('li a').live('mouseout',function(){
	$(this).attr('href',thislink);
});

 





$('li a').live('click',function(){
	
	
	
	$('#left').fadeOut();
	$('#right').fadeOut();
	$('#loading_ajax').show();

newtitle = $(this).text();	
	$.ajax({
 		  url: thislink,
  		  success: function(data) {
			  data = $(data).find('#load').html();
			   $('#ajax').html(data);
			   
			   if(newtitle=="Datenschutz" || newtitle=="Nutzungsbedingungen"){
			    	reinitialiseScrollPane();
			   		}
					
			   if(newtitle=="Augenoptiker suchen"){
				   load_doc();
			   		}
					
				 if(newtitle=="Ein-Tages- Kontaktlinsen" || newtitle=="Monats- Kontaktlinsen"){
				   stoerer_anim_small();
			   		}
					

					
				//newtitle = pagetitle + newtitle;
				//document.title = newtitle;
				
				
				$('#left').delay(300).fadeIn('slow');
				$('#right').delay(300).fadeIn('slow');
				$('#loading_ajax').fadeOut('slow');
				
				
	
  }
});
});*/
	
	


stoerer_anim_small();

	
	
});

