
	$(function(){
	
	
	
		  // Keep track of the iframe height.
		  var if_height;
		 
			// Pass the parent page URL into the Iframe in a meaningful way (this URL could be
			// passed via query string or hard coded into the child page, it depends on your needs).
			myChild = $("#hdnFrameURL1").val() + encodeURIComponent( document.location.href );		
			
			var myChildDomain='http://'+myChild.match(/:\/\/(.[^/]+)/)[1]; //http://packages.asiatravel.com
			
			// Append the Iframe into the DOM.
			iframeAppend = $( '<iframe "="" frameborder="0" height="550" scrolling="no" src="' + myChild + '" width="100%"><\/iframe>' ).appendTo( '#iframe' );
		  
				
				  // Setup a callback to handle the dispatched MessageEvent event. In cases where
				  // window.postMessage is supported, the passed event will have .data, .origin and
				  // .source properties. Otherwise, this will only have the .data property.
				  $.receiveMessage(function(e){
					
					
					// Get the height from the passsed data.
					var h = Number( e.data.replace( /.*if_height=(\d+)(?:&|$)/, '$1' ) );
					
					if ( !isNaN( h ) && h > 0 && h != if_height ) {
					  // Height has changed, update the iframe.
					  iframeAppend.height( if_height = h );
					}
					
				  // An optional origin URL (Ignored where window.postMessage is unsupported).				
				  }, myChildDomain);
		  
		})
