 
 
 function csWindowHeight() {
   return $(document).height();
 }
 
 function csWindowWidth() {
   return $(document).width();
 }
 
 function csAjax(url, sendData, resultFunction) {
   $.post(url, sendData, function(rdata){window[resultFunction](rdata);});
 }
 
 function csFadeIn(callerID, elemID, speed, eventStr) {
   if (eventStr == "MouseMove") {
     $('#'+callerID).mousemove (function () { $('#'+elemID).fadeIn(speed,'swing'); });
   } else if (eventStr == "MouseClick") {
     $('#'+callerID).click (function () { $('#'+elemID).fadeIn(speed,'swing'); });
   }
 } 

 function csFadeOut(callerID, elemID, speed, eventStr) {
   if (eventStr == "MouseOut") {
     $('#'+callerID).mouseout (function() { $('#'+elemID).fadeOut(speed,'swing'); });
   } else if (eventStr == "MouseClick") {
     $('#'+callerID).click (function() { $('#'+elemID).fadeOut(speed,'swing'); });
   }
 }

   
 function csSlideToggle(callerID, elemID, speed, eventStr) {
   if (eventStr == "MouseClick") {
     $('#'+callerID).click (function() { $('#'+elemID).slideToggle(speed,'swing'); });
   }
 } 

 function csImageRoundById(imgId, borderSize, borderColor, radius) {
  $('#'+imgId).imgr({size:borderSize+"px",color:borderColor,radius:radius+"px"});
 }
 
 function csImageRoundByClass(imgClass, borderSize, borderColor, radius) {
  $('img.'+imgClass).imgr({size:borderSize+"px",color:borderColor,radius:radius+"px"});
 }

 function csGoogleMap(container, depthval, info, showinfo, latd, longd, icon, shadowimg, iconSizeWd, iconSizeHt, shadowSizeWd, shadowSizeHt ) {
   
   var amarkers = { latitude: latd, longitude: longd };
   
   if (info != '') {
     var ainfo = {info:{layer: "#" + info ,popup: showinfo}};
     amarkers = $.extend(amarkers, ainfo); 
   }
   var aicon = {icon: { image: icon, iconSizeW: iconSizeWd, iconSizeH: iconSizeHt }};
   
   if (shadowimg != '' ) {
     var ashadow = {shadow: shadowimg, shadowSizeW: shadowSizeWd, shadowSizeH: shadowSizeHt};
     aicon = jQuery.extend(aicon,ashadow);
     G_DEFAULT_ICON.shadow = shadowimg; //bugfix for some strange stuff in google API
     G_DEFAULT_ICON.shadowSize = new GSize(shadowSizeWd, shadowSizeHt);
   } else {
     G_DEFAULT_ICON.shadow = null;  //bugfix for google API always showing a default shadow
   }
                      
   amarkers = $.extend(amarkers, aicon);                    
   
   $(document).ready(function() { 
    	$('#'+container).googleMaps({ 
        latitude: 	latd,
        longitude: longd,    	  
    	  depth: depthval ,
      		markers: amarkers
    	}); 
   }); 
 }
 
 function csFancybox(arr) {
   $(document).ready(function() {
     if (arr['id']) {
       var id = arr["id"];
       $("#"+id).fancybox(arr["data"]);
     } else {
       var fclass = arr["class"];
       $("."+fclass).fancybox(arr["data"]);     
     }    
   });
 } 


