$(function () {
	$(".side_ads").load("./inc/side.html");
	$(".footer_area2").load("./inc/footer_area.html");
});

$(function(){
	$.iPadLoadStyle({
		common : "./css/ipad.css"
	});
}); 

$.extend({
  iPadLoadStyle: function(opt) {
    var opt = jQuery.extend( {
      common: false,
      landscape: false,
      portrait: false
    }, opt),
    iPad = /iPad/.test(navigator.userAgent),
    d = document,
    $head = $("head"),
    linktag = function(h,m){
      var tag = d.createElement("link");
      tag.href = h;
      tag.media = m;
      tag.type = "text/css";
      tag.rel = "stylesheet";
      return tag;
    };
    if(iPad){
      //common
      if(opt.common) $head.append(linktag(opt.common,"only screen and (max-device-width: 1024px)"));
      //landscape
      if(opt.landscape) $head.append(linktag(opt.landscape,"all and (orientation:landscape)"));
      //portrait
      if(opt.portrait) $head.append(linktag(opt.portrait,"all and (orientation:portrait)"));
    }
    return this;
  }
});
